|
| 1 | +<template> |
| 2 | + <Page> |
| 3 | + <StackLayout> |
| 4 | + <CollectionView width="100%" height="50%" rowHeight="80" ref="listView" :items="itemList" @itemTap="onItemTap" itemIdGenerator="index"> |
| 5 | + <v-template> |
| 6 | + <GridLayout margin="4" borderRightWidth="20" borderRightColor="white" backgroundColor="darkgray"> |
| 7 | + <Label color="blue" fontSize="38" verticalAlignment="middle" paddingLeft="20" fontStyle="italic" textWrap> |
| 8 | + <Span :text="item.text1" fontWeight="bold" /> |
| 9 | + <Span :text="'\n' + item.text2" color="#ccc" fontSize="16" fontStyle="normal" /> |
| 10 | + <Span :text="item.text2" color="#eee" fontFamily="Lato-Regular" fontSize="16" fontStyle="normal" /> |
| 11 | + </Label> |
| 12 | + <Label color="white" fontSize="12" verticalAlignment="bottom" paddingLeft="20" paddingBottom="1" textWrap> |
| 13 | + <Span :text="item.icon1" fontSize="20" color="green" :fontFamily="mdiFontFamily" /> |
| 14 | + <Span :text="' ' + item.texticon1" verticalTextAlignment="center" /> |
| 15 | + <Span :text="' ' + item.icon2" fontSize="20" color="red" :fontFamily="mdiFontFamily" /> |
| 16 | + <Span :text="' ' + item.texticon2" verticalTextAlignment="center" /> |
| 17 | + <Span :text="' ' + item.icon3" fontSize="20" color="yellow" :fontFamily="mdiFontFamily" /> |
| 18 | + <Span :text="' ' + item.icon3" verticalTextAlignment="center" /> |
| 19 | + </Label> |
| 20 | + |
| 21 | + <Label fontSize="12" verticalAlignment="middle" horizontalAlignment="center" textAlignment="right" paddingRight="20" color="brown" width="60" textWrap> |
| 22 | + <span :text="item.icon1" fontSize="14" :fontFamily="mdiFontFamily" /> |
| 23 | + <Span :text="'\n' + item.texticon1" paddingRight="10" /> |
| 24 | + </Label> |
| 25 | + <Label fontFamily="arial" :text="item.text4" color="red" fontSize="14" textAlignment="right" paddingRight="20" paddingTop="4" verticalAlignment="center"/> |
| 26 | + </GridLayout> |
| 27 | + </v-template> |
| 28 | + </CollectionView> |
| 29 | + <CollectionView width="100%" height="50%" rowHeight="80" ref="listView" :items="itemList" @itemTap="onItemTap" itemIdGenerator="index"> |
| 30 | + <v-template> |
| 31 | + <GridLayout> |
| 32 | + <CanvasLabel id="canvaslabel" fontSize="10" color="white" backgroundColor="darkgray" margin="4" borderRightWidth="20" borderRightColor="white"> |
| 33 | + <!-- <Rectangle left="-20" width="20" height="100%" color="red" horizontalAlignment="right" /> --> |
| 34 | + <CGroup id="group1" color="blue" fontSize="38" verticalAlignment="middle" paddingLeft="20" fontStyle="italic"> |
| 35 | + <CSpan id="text1" :text="item.text1" fontWeight="bold" /> |
| 36 | + <CSpan id="text2" :text="'\n' + item.text2" color="#ccc" fontSize="16" fontStyle="normal" /> |
| 37 | + <CSpan id="text3" :text="item.text2" color="#eee" fontFamily="Lato-Regular" fontSize="16" fontStyle="normal" /> |
| 38 | + </CGroup> |
| 39 | + <!-- <Line id="line" :antiAlias="true" color="yellow" startX="10%" startY="34%" stopX="90%" stopY="90%" strokeCap="round" strokeJoin="round" strokeWidth="4" dash="1 10 0" /> --> |
| 40 | + <!-- <CGroup backgroundColor="yellow" verticalTextAlignment="top" textAlignment="right"> |
| 41 | + <CSpan text="TOTO" fontSize="20" color="green" /> |
| 42 | + </CGroup> --> |
| 43 | + <CGroup id="group2" fontSize="12" verticalAlignment="bottom" paddingLeft="20" paddingBottom="1"> |
| 44 | + <CSpan id="icon1" :text="item.icon1" fontSize="20" color="green" :fontFamily="mdiFontFamily" /> |
| 45 | + <CSpan id="texticon1" :text="' ' + item.texticon1" verticalTextAlignment="center" /> |
| 46 | + <CSpan id="icon2" :text="' ' + item.icon2" fontSize="20" color="red" :fontFamily="mdiFontFamily" /> |
| 47 | + <CSpan id="texticon2" :text="' ' + item.texticon2" verticalTextAlignment="center" /> |
| 48 | + <CSpan id="icon3" :text="' ' + item.icon3" fontSize="20" color="yellow" :fontFamily="mdiFontFamily" /> |
| 49 | + <CSpan id="icon3" :text="' ' + item.icon3" verticalTextAlignment="center" /> |
| 50 | + </CGroup> |
| 51 | + |
| 52 | + <CGroup id="group3" fontSize="12" verticalAlignment="middle" horizontalAlignment="center" textAlignment="right" paddingRight="20" color="brown" width="60"> |
| 53 | + <CSpan id="icon12" :text="item.icon1" fontSize="14" :fontFamily="mdiFontFamily" /> |
| 54 | + <CSpan id="texticon12" :text="'\n' + item.texticon1" paddingRight="10" /> |
| 55 | + </CGroup> |
| 56 | + <CSpan id="text4" fontFamily="arial" :text="item.text4" color="red" fontSize="14" textAlignment="right" paddingRight="20" paddingTop="4" verticalAlignment="center"/> |
| 57 | + <!-- <CGroup id="group1" fontSize="12" verticalAlignment="bottom" paddingLeft="20" paddingBottom="1" color="white" verticalTextAlignment="top"> |
| 58 | + <CSpan id="span1" text="test1" margin="2" backgroundColor="green" borderRadius="4" verticalTextAlignment="super" /> |
| 59 | + <CSpan id="span2" text="testtest2" backgroundColor="red" borderRadius="4" fontSize="24" /> |
| 60 | + <CGroup id="group2" backgroundColor="green" borderRadius="4"> |
| 61 | + <CSpan id="span3" text="mdi-access-point" fontSize="20" color="yellow" :fontFamily="mdiFontFamily" /> |
| 62 | + <CSpan id="span4" text="test2" margin="2" /> |
| 63 | + </CGroup> |
| 64 | + </CGroup> --> |
| 65 | + <!-- <CGroup> |
| 66 | + <CSpan fontSize="20" text="test1" margin="2" color="red" backgroundColor="green" borderRadius="10" @linkTap="onLinkTapped('test1')" /> |
| 67 | + </CGroup> --> |
| 68 | + <!-- <CSpan |
| 69 | + width="44" |
| 70 | + height="44" |
| 71 | + horizontalAlignment="right" |
| 72 | + verticalAlignment="bottom" |
| 73 | + textAlignment="center" |
| 74 | + verticalTextAlignment="center" |
| 75 | + text="mdi-access-point" |
| 76 | + fontSize="20" |
| 77 | + color="yellow" |
| 78 | + :fontFamily="mdiFontFamily" |
| 79 | + backgroundColor="blue" |
| 80 | + borderRadius="4" |
| 81 | + shadow="0 1 4 red" |
| 82 | + /> --> |
| 83 | + </CanvasLabel> |
| 84 | + </GridLayout> |
| 85 | + </v-template> |
| 86 | + </CollectionView> |
| 87 | + </StackLayout> |
| 88 | + </Page> |
| 89 | +</template> |
| 90 | + |
| 91 | +<script lang="ts"> |
| 92 | +import { stringify } from 'querystring'; |
| 93 | +const icons = [ |
| 94 | + 'mdi-numeric', |
| 95 | + 'mdi-hat-fedora', |
| 96 | + 'mdi-home-floor-g', |
| 97 | + 'mdi-account-key', |
| 98 | + 'mdi-ticket-confirmation', |
| 99 | + 'mdi-rotate-orbit', |
| 100 | + 'mdi-access-point', |
| 101 | + 'mdi-arrow-right-bold-circle-outline', |
| 102 | + 'mdi-crosshairs-gps', |
| 103 | + 'mdi-jabber', |
| 104 | + 'mdi-onepassword' |
| 105 | +]; |
| 106 | +
|
| 107 | +const randomLanguage = ['javascript', 'typescript', 'go', 'c++']; |
| 108 | +export default { |
| 109 | + data() { |
| 110 | + const items = new Array(1000).fill(null).map((v, i) => ({ |
| 111 | + index: i, |
| 112 | + // icon1: icons[Math.round(Math.random() * (icons.length - 1))], |
| 113 | + icon1: '1', |
| 114 | + icon2: 'mdi-access-point', |
| 115 | + icon3: '3', |
| 116 | + texticon1: randomLanguage[Math.round(Math.random() * (randomLanguage.length - 1))] + ` ${i}`, |
| 117 | + texticon2: randomLanguage[Math.round(Math.random() * (randomLanguage.length - 1))] + ` ${i}`, |
| 118 | + texticon3: randomLanguage[Math.round(Math.random() * (randomLanguage.length - 1))] + ` ${i}`, |
| 119 | + text1: `test asd g ${i}`, |
| 120 | + text2: 'asddg', |
| 121 | + text3: `icon ${i}`, |
| 122 | + text4: i % 3 === 0 ? 'test' : '' |
| 123 | + })); |
| 124 | + // console.log('items', JSON.stringify(items)); |
| 125 | +
|
| 126 | + return { |
| 127 | + mdiFontFamily: 'materialdesignicons-webfont,Material Design Icons', |
| 128 | + itemList: items, |
| 129 | + item:null |
| 130 | + }; |
| 131 | + }, |
| 132 | + methods: { |
| 133 | + onLinkTapped(text) { |
| 134 | + console.log('onLinkTapped', text); |
| 135 | + }, |
| 136 | + onItemTap({ index, item }) { |
| 137 | + console.log(`Tapped on ${index} ${item.title}`); |
| 138 | + }, |
| 139 | + logEvent(e) { |
| 140 | + console.log('logEvent', e.eventName, e.extraData); |
| 141 | + } |
| 142 | + // itemIdGenerator(item, i) { |
| 143 | + // return item.index; |
| 144 | + // } |
| 145 | + } |
| 146 | +}; |
| 147 | +</script> |
| 148 | + |
| 149 | +<style scoped> |
| 150 | +ActionBar { |
| 151 | + background-color: #53ba82; |
| 152 | + color: #ffffff; |
| 153 | +} |
| 154 | +
|
| 155 | +.message { |
| 156 | + vertical-align: center; |
| 157 | + text-align: center; |
| 158 | + font-size: 20; |
| 159 | + color: #333333; |
| 160 | +} |
| 161 | +</style> |
0 commit comments