@shijiu/jsview-vue-samples 1.9.747

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/AnimPicture/App.vue +207 -0
  2. package/AnimPicture/assets/animated_webp.webp +0 -0
  3. package/AnimPicture/assets/ball_3.webp +0 -0
  4. package/AnimPicture/assets/girl_run.gif +0 -0
  5. package/AnimPicture/assets/quan.webp +0 -0
  6. package/Basic/App.vue +134 -0
  7. package/Basic/assets/border.png +0 -0
  8. package/Basic/assets/border2.png +0 -0
  9. package/Basic/assets/icon.png +0 -0
  10. package/Basic/assets/test.jpg +0 -0
  11. package/Basic/components/ContentBlock.vue +38 -0
  12. package/Basic/components/FontStyle.css +16 -0
  13. package/Basic/components/anim/AnimGroup.vue +66 -0
  14. package/Basic/components/anim/AnimKeyframeBasic.vue +119 -0
  15. package/Basic/components/anim/AnimKeyframeComposite.vue +52 -0
  16. package/Basic/components/anim/AnimTransition.vue +157 -0
  17. package/Basic/components/div/DivBackground.vue +44 -0
  18. package/Basic/components/div/DivClip.vue +159 -0
  19. package/Basic/components/div/DivCssScoped.vue +20 -0
  20. package/Basic/components/div/DivCssVar.vue +53 -0
  21. package/Basic/components/div/DivGroup1.vue +47 -0
  22. package/Basic/components/div/DivGroup2.vue +65 -0
  23. package/Basic/components/div/DivLayout.vue +70 -0
  24. package/Basic/components/div/DivRadius.vue +65 -0
  25. package/Basic/components/div/DivTransform.vue +32 -0
  26. package/Basic/components/img/ImageGroup.vue +31 -0
  27. package/Basic/components/img/ImgLayout.vue +41 -0
  28. package/Basic/components/panel/Panel1.vue +55 -0
  29. package/Basic/components/panel/Panel2.vue +31 -0
  30. package/Basic/components/panel/TitleBar.vue +29 -0
  31. package/Basic/components/text/TextAlign.vue +66 -0
  32. package/Basic/components/text/TextEmoji.vue +26 -0
  33. package/Basic/components/text/TextFontStyle.vue +89 -0
  34. package/Basic/components/text/TextGroup1.vue +49 -0
  35. package/Basic/components/text/TextGroup2.vue +28 -0
  36. package/Basic/components/text/TextOverflow.vue +110 -0
  37. package/BasicFocusControl/App.vue +104 -0
  38. package/BasicFocusControl/components/BaseBlock.vue +50 -0
  39. package/BasicFocusControl/components/MainArea.vue +83 -0
  40. package/BasicFocusControl/components/MainAreaLeftBlock.vue +17 -0
  41. package/BasicFocusControl/components/MainAreaRightBlock.vue +27 -0
  42. package/BasicFocusControl/components/SideBar.vue +58 -0
  43. package/BasicFocusControl/components/SideBarBlock.vue +27 -0
  44. package/Collision/App.vue +452 -0
  45. package/ColorSpace/App.vue +126 -0
  46. package/ColorSpace/bmpDemo.bmp +0 -0
  47. package/ColorSpace/jpegDemo.jpeg +0 -0
  48. package/ColorSpace/pngDemo.png +0 -0
  49. package/ColorSpace/pngNoAlphaDemo.png +0 -0
  50. package/DemoHomepage/App.vue +27 -0
  51. package/DemoHomepage/components/BodyFrame.vue +95 -0
  52. package/DemoHomepage/components/Dialog.vue +94 -0
  53. package/DemoHomepage/components/Item.vue +77 -0
  54. package/DemoHomepage/components/TabFrame.vue +85 -0
  55. package/DemoHomepage/router.js +196 -0
  56. package/DemoHomepage/views/Homepage.vue +195 -0
  57. package/FilterDemo/AnimatePic.vue +58 -0
  58. package/FilterDemo/App.vue +159 -0
  59. package/FilterDemo/VideoLayer.vue +62 -0
  60. package/FilterDemo/jpegDemo.jpeg +0 -0
  61. package/FilterDemo/webpDemo.webp +0 -0
  62. package/FlipCard/App.vue +71 -0
  63. package/FlipCard/FlipCard.vue +118 -0
  64. package/FlipCard/assets/blue_egg.png +0 -0
  65. package/FlipCard/assets/red_egg.png +0 -0
  66. package/FlipCard/data.js +13 -0
  67. package/GridDemo/App.vue +215 -0
  68. package/GridDemo/ButtonBlock.vue +112 -0
  69. package/GridDemo/FocusItem.vue +37 -0
  70. package/GridDemo/Item.vue +93 -0
  71. package/HashHistory/App.vue +115 -0
  72. package/HashHistory/components/HorizontalButtonList.vue +91 -0
  73. package/HashHistory/components/Item.vue +60 -0
  74. package/HashHistory/router.js +41 -0
  75. package/HashHistory/views/MainPage.vue +57 -0
  76. package/HashHistory/views/SubPage.vue +66 -0
  77. package/ImpactStop/App.vue +435 -0
  78. package/Input/App.vue +164 -0
  79. package/Input/FullKeyboard.vue +87 -0
  80. package/Input/InputPanel.vue +131 -0
  81. package/Input/KeyboardItem.vue +58 -0
  82. package/LongImage/App.vue +80 -0
  83. package/LongImage/Button.vue +58 -0
  84. package/LongImage/ButtonItem.vue +44 -0
  85. package/LongImage/LongImageScroll.vue +92 -0
  86. package/LongImage/Scroll.vue +14 -0
  87. package/LongImage/assets/1280x7200.jpg +0 -0
  88. package/LongText/App.vue +96 -0
  89. package/LongText/Button.vue +51 -0
  90. package/LongText/ButtonItem.vue +44 -0
  91. package/LongText/LongTextScroll.vue +192 -0
  92. package/LongText/Scroll.vue +14 -0
  93. package/Marquee/App.vue +247 -0
  94. package/Marquee/longText.js +14 -0
  95. package/MaskClip/App.vue +122 -0
  96. package/MaskClip/images/mask-025/config.json +29 -0
  97. package/MaskClip/images/mask-025/res/1.png +0 -0
  98. package/MaskClip/images/mask-025/res/2.png +0 -0
  99. package/MaskClip/images/mask-025/res/3.png +0 -0
  100. package/MaskClip/images/mask-025/res/4.png +0 -0
  101. package/MaskClip/images/mask-025/res/icon.png +0 -0
  102. package/MaskClip/images/mask-025/res/stroke.png +0 -0
  103. package/MaskClip/images/php.jpg +0 -0
  104. package/MetroWidgetDemos/Advanced/App.vue +46 -0
  105. package/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
  106. package/MetroWidgetDemos/Advanced/Buttons.vue +70 -0
  107. package/MetroWidgetDemos/Advanced/Mixed.vue +77 -0
  108. package/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
  109. package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
  110. package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +116 -0
  111. package/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  112. package/MetroWidgetDemos/Item.vue +85 -0
  113. package/MetroWidgetDemos/PerformanceTest/App.vue +210 -0
  114. package/MetroWidgetDemos/PerformanceTest/Item.vue +90 -0
  115. package/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
  116. package/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
  117. package/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
  118. package/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
  119. package/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
  120. package/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
  121. package/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
  122. package/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
  123. package/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
  124. package/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
  125. package/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
  126. package/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
  127. package/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
  128. package/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
  129. package/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
  130. package/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
  131. package/MetroWidgetDemos/PerformanceTest/border.png +0 -0
  132. package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +386 -0
  133. package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +129 -0
  134. package/MetroWidgetDemos/PerformanceTest/data.js +45 -0
  135. package/MetroWidgetDemos/PingPong/App.vue +135 -0
  136. package/MetroWidgetDemos/PingPong/AppPage.vue +73 -0
  137. package/MetroWidgetDemos/PingPong/AppTab.vue +62 -0
  138. package/MetroWidgetDemos/PingPong/TabItem.vue +84 -0
  139. package/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
  140. package/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
  141. package/MetroWidgetDemos/Simple/App.vue +45 -0
  142. package/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -0
  143. package/MetroWidgetDemos/WidgetItem.vue +89 -0
  144. package/MetroWidgetDemos/data.js +205 -0
  145. package/NinePatchDemo/App.vue +145 -0
  146. package/NinePatchDemo/Item.vue +69 -0
  147. package/NinePatchDemo/assets/border.png +0 -0
  148. package/Preload/App.vue +135 -0
  149. package/Preload/Item.vue +32 -0
  150. package/Preload/data.js +23 -0
  151. package/Preload/images/awesomeface.png +0 -0
  152. package/Preload/images/cat.jpg +0 -0
  153. package/Preload/images/rank.png +0 -0
  154. package/Preload/images/rank_focus.png +0 -0
  155. package/Preload/images/rule.png +0 -0
  156. package/Preload/images/rule_focus.png +0 -0
  157. package/Preload/images/start.png +0 -0
  158. package/Preload/images/start_focus.png +0 -0
  159. package/QrcodeDemo/App.vue +68 -0
  160. package/ScaleDownNeon/App.vue +107 -0
  161. package/SoundPool/App.vue +134 -0
  162. package/SoundPool/bgmusic.mp3 +0 -0
  163. package/SoundPool/coin.mp3 +0 -0
  164. package/SoundPool/jump.mp3 +0 -0
  165. package/SoundPool/lose.mp3 +0 -0
  166. package/SoundPool/run.mp3 +0 -0
  167. package/SprayView/App.vue +272 -0
  168. package/SprayView/assets/snow.png +0 -0
  169. package/SpriteImage/App.vue +173 -0
  170. package/SpriteImage/images/cat_run.png +0 -0
  171. package/SpriteImage/images/egg_break.json +116 -0
  172. package/SpriteImage/images/egg_break.png +0 -0
  173. package/SpriteImage/images/sprite.png +0 -0
  174. package/TextBox/App.vue +91 -0
  175. package/TextBox/RenderCenter.vue +133 -0
  176. package/TextBox/RenderLeft.vue +138 -0
  177. package/TextBox/RenderOneLine.vue +101 -0
  178. package/TextBox/RenderRight.vue +131 -0
  179. package/TextShadowDemo/App.vue +91 -0
  180. package/TextureAnimation/App.vue +336 -0
  181. package/TextureAnimation/App2.vue +111 -0
  182. package/TextureAnimation/assets/blackWhiteGrid.png +0 -0
  183. package/TextureAnimation/assets/light.png +0 -0
  184. package/TextureAnimation/assets/light2.png +0 -0
  185. package/TextureAnimation/assets/mask.png +0 -0
  186. package/TextureAnimation/assets/php.jpg +0 -0
  187. package/TextureAnimation/assets/php2.png +0 -0
  188. package/TextureAnimation/assets/swipLight.png +0 -0
  189. package/TextureSize/App.vue +132 -0
  190. package/TextureSize/bmpDemo.bmp +0 -0
  191. package/TextureSize/jpegDemo.jpeg +0 -0
  192. package/TextureSize/jpgDemo.jpg +0 -0
  193. package/TextureSize/pngDemo.png +0 -0
  194. package/TextureSize/pngNoAlphaDemo.png +0 -0
  195. package/ThrowMoveDemo/AccelerateDemo.vue +116 -0
  196. package/ThrowMoveDemo/App.vue +114 -0
  197. package/ThrowMoveDemo/LRParabolicDemo.vue +115 -0
  198. package/ThrowMoveDemo/TargetDemo.vue +116 -0
  199. package/ThrowMoveDemo/UDParabolicDemo.vue +121 -0
  200. package/TouchSample/App.vue +136 -0
  201. package/TouchSample/Item.vue +103 -0
  202. package/TouchSample/MetroWidgetHorizontal.vue +144 -0
  203. package/TouchSample/MetroWidgetVertical.vue +144 -0
  204. package/TouchSample/TouchContainerHorizontal.vue +160 -0
  205. package/TouchSample/TouchContainerVertical.vue +160 -0
  206. package/TouchSample/data.js +81 -0
  207. package/TransitPage/App.vue +29 -0
  208. package/VideoDemo/App.vue +121 -0
  209. package/VideoDemo/components/Button.vue +58 -0
  210. package/VideoDemo/components/Controllor.vue +197 -0
  211. package/VideoDemo/components/VideoFrame.vue +140 -0
  212. package/VisibleSensorDemo/App.vue +234 -0
  213. package/package.json +17 -0
@@ -0,0 +1,386 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2021-06-10 14:17:17
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2022-07-11 18:20:58
6
+ * @Description: file content
7
+ -->
8
+ <script setup>
9
+ import posterHolder from "../assets/holder_logo.png";
10
+ import couponLeft from "../assets/coupon_left.png";
11
+ import couponRight from "../assets/coupon_right.png";
12
+ import couponMid from "../assets/coupon_mid.png";
13
+ import borderLeft from "../assets/line_left.png";
14
+ import borderMid from "../assets/line_mid.png";
15
+ import borderRight from "../assets/line_right.png";
16
+ import { ref, shallowRef, computed } from "vue";
17
+
18
+ const props = defineProps({
19
+ data: Object,
20
+ query: Object,
21
+ onEdge: Function,
22
+ onAction: Object,
23
+ });
24
+
25
+ const focused = ref(false);
26
+ const onFocus = () => {
27
+ focused.value = true;
28
+ };
29
+
30
+ const onBlur = () => {
31
+ focused.value = false;
32
+ };
33
+
34
+ props.onAction.register("onFocus", onFocus);
35
+ props.onAction.register("onBlur", onBlur);
36
+
37
+ const focusTransform = computed(() => {
38
+ return focused.value ? "scale3d(1.2, 1.2, 1)" : null;
39
+ });
40
+
41
+ const savePrizeWidth = computed(() => {
42
+ return 10 * props.data.savePrize.length + 26;
43
+ });
44
+
45
+ const soldTotalWidth = computed(() => {
46
+ let width = 44 + 22; //base width;
47
+ if (props.data.soldTotal >= 10000) {
48
+ let text = parseInt(props.data.soldTotal / 10000) + "";
49
+ width += text.length * 12 + 22;
50
+ } else {
51
+ width += (props.data.soldTotal + "").length * 12;
52
+ }
53
+ return width;
54
+ });
55
+
56
+ const soldTotalText = computed(() => {
57
+ let text = "";
58
+ if (props.data.soldTotal >= 10000) {
59
+ text = parseInt(props.data.soldTotal / 10000) + "万";
60
+ } else {
61
+ text = props.data.soldTotal;
62
+ }
63
+ return text;
64
+ });
65
+ </script>
66
+
67
+ <template>
68
+ <div
69
+ class="frame-background"
70
+ :style="{
71
+ transform: focusTransform,
72
+ }"
73
+ >
74
+ <div class="poster-holder">
75
+ <div
76
+ :style="{
77
+ width: 107,
78
+ height: 23,
79
+ left: 53,
80
+ top: 95,
81
+ backgroundImage: posterHolder,
82
+ }"
83
+ />
84
+ </div>
85
+ <div
86
+ class="poster"
87
+ :style="{
88
+ backgroundImage: `url(${data.pictUrl})`,
89
+ }"
90
+ />
91
+ <div class="title-font title-layout">
92
+ {{ data.index + data.name }}
93
+ </div>
94
+ <div
95
+ :style="{
96
+ height: 24,
97
+ left: 13,
98
+ top: 256,
99
+ width: savePrizeWidth,
100
+ }"
101
+ >
102
+ <div
103
+ :style="{ width: 5, height: 24, backgroundImage: couponLeft }"
104
+ />
105
+ <div
106
+ :style="{
107
+ left: 5,
108
+ width: savePrizeWidth - 11,
109
+ height: 24,
110
+ backgroundImage: couponMid,
111
+ }"
112
+ />
113
+ <div
114
+ :style="{
115
+ left: savePrizeWidth - 6,
116
+ width: 5,
117
+ height: 24,
118
+ backgroundImage: couponRight,
119
+ }"
120
+ />
121
+ <div
122
+ class="ticket-text"
123
+ :style="{
124
+ width: savePrizeWidth,
125
+ }"
126
+ >
127
+ {{ `${data.savePrize}元券` }}
128
+ </div>
129
+ </div>
130
+
131
+ <div
132
+ :style="{
133
+ top: 256,
134
+ left: 27 + savePrizeWidth,
135
+ }"
136
+ >
137
+ <div
138
+ :style="{ width: 7, height: 25, backgroundImage: borderLeft }"
139
+ />
140
+ <div
141
+ :style="{
142
+ left: 7,
143
+ width: soldTotalWidth - 13,
144
+ height: 25,
145
+ backgroundImage: borderMid,
146
+ }"
147
+ />
148
+ <div
149
+ :style="{
150
+ left: soldTotalWidth - 7,
151
+ width: 7,
152
+ height: 25,
153
+ backgroundImage: borderRight,
154
+ }"
155
+ />
156
+ <div
157
+ class="sold-text"
158
+ :style="{
159
+ width: soldTotalWidth,
160
+ }"
161
+ >
162
+ {{ `已售${soldTotalText}件` }}
163
+ </div>
164
+ </div>
165
+
166
+ <div
167
+ :style="{
168
+ height: 24,
169
+ left: 13,
170
+ top: 270,
171
+ width: savePrizeWidth,
172
+ }"
173
+ >
174
+ <div
175
+ :style="{ width: 5, height: 24, backgroundImage: couponLeft }"
176
+ />
177
+ <div
178
+ :style="{
179
+ left: 5,
180
+ width: savePrizeWidth - 11,
181
+ height: 24,
182
+ backgroundImage: couponMid,
183
+ }"
184
+ />
185
+ <div
186
+ :style="{
187
+ left: savePrizeWidth - 6,
188
+ width: 5,
189
+ height: 24,
190
+ backgroundImage: couponRight,
191
+ }"
192
+ />
193
+ <div
194
+ class="ticket-text"
195
+ :style="{
196
+ width: savePrizeWidth,
197
+ }"
198
+ >
199
+ {{ `${data.savePrize}元券` }}
200
+ </div>
201
+ </div>
202
+ <div
203
+ :style="{
204
+ top: 270,
205
+ left: 27 + savePrizeWidth,
206
+ }"
207
+ >
208
+ <div
209
+ :style="{ width: 7, height: 25, backgroundImage: borderLeft }"
210
+ />
211
+ <div
212
+ :style="{
213
+ left: 7,
214
+ width: soldTotalWidth - 13,
215
+ height: 25,
216
+ backgroundImage: borderMid,
217
+ }"
218
+ />
219
+ <div
220
+ :style="{
221
+ left: soldTotalWidth - 7,
222
+ width: 7,
223
+ height: 25,
224
+ backgroundImage: borderRight,
225
+ }"
226
+ />
227
+ <div
228
+ class="sold-text"
229
+ :style="{
230
+ width: soldTotalWidth,
231
+ }"
232
+ >
233
+ {{ `已售${soldTotalText}件` }}
234
+ </div>
235
+ </div>
236
+
237
+ <div
238
+ :style="{
239
+ height: 24,
240
+ left: 13,
241
+ top: 280,
242
+ width: savePrizeWidth,
243
+ }"
244
+ >
245
+ <div
246
+ :style="{ width: 5, height: 24, backgroundImage: couponLeft }"
247
+ />
248
+ <div
249
+ :style="{
250
+ left: 5,
251
+ width: savePrizeWidth - 11,
252
+ height: 24,
253
+ backgroundImage: couponMid,
254
+ }"
255
+ />
256
+ <div
257
+ :style="{
258
+ left: savePrizeWidth - 6,
259
+ width: 5,
260
+ height: 24,
261
+ backgroundImage: couponRight,
262
+ }"
263
+ />
264
+ <div
265
+ class="ticket-text"
266
+ :style="{
267
+ width: savePrizeWidth,
268
+ }"
269
+ >
270
+ {{ `${data.savePrize}元券` }}
271
+ </div>
272
+ </div>
273
+ <div
274
+ :style="{
275
+ top: 280,
276
+ left: 27 + savePrizeWidth,
277
+ }"
278
+ >
279
+ <div
280
+ :style="{ width: 7, height: 25, backgroundImage: borderLeft }"
281
+ />
282
+ <div
283
+ :style="{
284
+ left: 7,
285
+ width: soldTotalWidth - 13,
286
+ height: 25,
287
+ backgroundImage: borderMid,
288
+ }"
289
+ />
290
+ <div
291
+ :style="{
292
+ left: soldTotalWidth - 7,
293
+ width: 7,
294
+ height: 25,
295
+ backgroundImage: borderRight,
296
+ }"
297
+ />
298
+ <div
299
+ class="sold-text"
300
+ :style="{
301
+ width: soldTotalWidth,
302
+ }"
303
+ >
304
+ {{ `已售${soldTotalText}件` }}
305
+ </div>
306
+ </div>
307
+
308
+ <div class="prize-title-font prize-title-layout">券后</div>
309
+ <div class="prize-font">
310
+ {{ `¥${data.prize - data.savePrize}` }}
311
+ </div>
312
+ </div>
313
+ </template>
314
+
315
+ <style scoped>
316
+ .frame-background {
317
+ width: 213px;
318
+ height: 337px;
319
+ border-radius: 10px 10px 10px 10px;
320
+ background-color: #f7f7f4;
321
+ transition: transform 0.2s linear;
322
+ }
323
+
324
+ .poster-holder {
325
+ width: 213px;
326
+ height: 213px;
327
+ border-radius: 10px 10px 0px 0px;
328
+ background-color: #cfcac6;
329
+ }
330
+ .poster {
331
+ width: 213px;
332
+ height: 213px;
333
+ border-radius: 7px 7px 0px 0px;
334
+ }
335
+
336
+ .title-font {
337
+ font-size: 21px;
338
+ color: #73665c;
339
+ line-height: 29px;
340
+ overflow: hidden;
341
+ white-space: nowrap;
342
+ text-overflow: ellipsis;
343
+ text-align: center;
344
+ }
345
+ .title-layout {
346
+ top: 221;
347
+ left: 13;
348
+ width: 193px;
349
+ height: 29px;
350
+ }
351
+ .ticket-text {
352
+ height: 24;
353
+ color: #ffffff;
354
+ font-size: 16px;
355
+ text-align: center;
356
+ line-height: 24px;
357
+ }
358
+ .sold-text {
359
+ height: 25px;
360
+ color: #ff7a00;
361
+ font-size: 20px;
362
+ text-align: center;
363
+ line-height: 25px;
364
+ }
365
+ .prize-title-layout {
366
+ width: 35px;
367
+ height: 24px;
368
+ top: 296;
369
+ left: 13;
370
+ }
371
+ .prize-title-font {
372
+ color: #de2825;
373
+ text-align: center;
374
+ font-size: 17px;
375
+ line-height: 24px;
376
+ }
377
+ .prize-font {
378
+ top: 289;
379
+ left: 53;
380
+ width: 158; /*213 - 55*/
381
+ height: 37px;
382
+ line-height: 37px;
383
+ font-size: 28px;
384
+ color: #de2825;
385
+ }
386
+ </style>
@@ -0,0 +1,129 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2021-09-29 16:13:35
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2021-09-29 17:07:19
6
+ * @Description: file content
7
+ -->
8
+ <script>
9
+ import { ref, shallowRef } from "vue";
10
+
11
+ export default {
12
+ props: {
13
+ name: Object,
14
+ onEdgeDown: Function,
15
+ onItemFocus: Function,
16
+ },
17
+ setup() {
18
+ let activeId = ref(0);
19
+ let focused = ref(false);
20
+ return {
21
+ activeId,
22
+ focused,
23
+ };
24
+ },
25
+ computed: {
26
+ tab1Class() {
27
+ if (this.activeId == 0) {
28
+ return this.focused
29
+ ? "text-active item-focused"
30
+ : "text-active item-normal";
31
+ } else {
32
+ return "text-normal item-normal";
33
+ }
34
+ },
35
+ tab2Class() {
36
+ if (this.activeId == 1) {
37
+ return this.focused
38
+ ? "text-active item-focused"
39
+ : "text-active item-normal";
40
+ } else {
41
+ return "text-normal item-normal";
42
+ }
43
+ },
44
+ tab3Class() {
45
+ if (this.activeId == 2) {
46
+ return this.focused
47
+ ? "text-active item-focused"
48
+ : "text-active item-normal";
49
+ } else {
50
+ return "text-normal item-normal";
51
+ }
52
+ },
53
+ },
54
+ methods: {
55
+ onKeyDown(ev) {
56
+ switch (ev.keyCode) {
57
+ case 37:
58
+ this.activeId--;
59
+ if (this.activeId < 0) {
60
+ this.activeId = 2;
61
+ }
62
+ this.onItemFocus(this.activeId);
63
+ break;
64
+ case 39:
65
+ this.activeId++;
66
+ if (this.activeId > 2) {
67
+ this.activeId = 0;
68
+ }
69
+ this.onItemFocus(this.activeId);
70
+ break;
71
+ case 40:
72
+ this.onEdgeDown();
73
+ break;
74
+ }
75
+ },
76
+ onFocus() {
77
+ this.focused = true;
78
+ },
79
+ onBlur() {
80
+ this.focused = false;
81
+ },
82
+ getOnAction() {
83
+ return {
84
+ onKeyDown: this.onKeyDown,
85
+ onFocus: this.onFocus,
86
+ onBlur: this.onBlur,
87
+ };
88
+ },
89
+ },
90
+ };
91
+ </script>
92
+
93
+ <template>
94
+ <jsv-focus-block :name="name" :onAction="getOnAction()"></jsv-focus-block>
95
+ <div :class="tab1Class">Tab1</div>
96
+ <div :class="tab2Class" :style="{ left: 220 }">Tab2</div>
97
+ <div :class="tab3Class" :style="{ left: 440 }">Tab3</div>
98
+ </template>
99
+
100
+ <style scoped>
101
+ .text-normal {
102
+ width: 200px;
103
+ height: 50px;
104
+ line-height: 50px;
105
+ color: #444444;
106
+ font-size: 25px;
107
+ text-align: center;
108
+ }
109
+
110
+ .text-active {
111
+ width: 200px;
112
+ height: 50px;
113
+ line-height: 50px;
114
+ color: #ffffff;
115
+ font-size: 25px;
116
+ text-align: center;
117
+ }
118
+
119
+ .item-focused {
120
+ width: 200px;
121
+ height: 50px;
122
+ background-color: #008080;
123
+ }
124
+ .item-normal {
125
+ width: 200px;
126
+ height: 50px;
127
+ background-color: #87CECB;
128
+ }
129
+ </style>
@@ -0,0 +1,45 @@
1
+ let data1 = [];
2
+
3
+ // 添加300个模拟数据
4
+ for (let i = 0; i < 40; i++) {
5
+ data1.push({
6
+ index: i,
7
+ name: `商品:骆驼奶粉蛋白质粉,限时抢购,立刻发货,序号:${i}`,
8
+ prize: `${Math.floor(Math.random() * 200) +
9
+ 200}` /* 测试数据要保证比最高优惠券(300左右)要高 */,
10
+ savePrize: `${i}`,
11
+ soldTotal: `${Math.floor(Math.random() * 50000)}`,
12
+ pictUrl:
13
+ "http://img.alicdn.com/bao/uploaded/i3/2207313464483/O1CN01Ab4vWz1izGAyRL1Yf_!!0-item_pic.jpg",
14
+ });
15
+ }
16
+
17
+ let data2 = [];
18
+ for (let i = 0; i < 50; i++) {
19
+ data2.push({
20
+ index: i,
21
+ name: `商品:骆驼奶粉蛋白质粉,限时抢购,立刻发货,序号:${i}`,
22
+ prize: `${Math.floor(Math.random() * 200) +
23
+ 200}` /* 测试数据要保证比最高优惠券(300左右)要高 */,
24
+ savePrize: `${i}`,
25
+ soldTotal: `${Math.floor(Math.random() * 50000)}`,
26
+ pictUrl:
27
+ "http://img.alicdn.com/bao/uploaded/i3/2207313464483/O1CN01Ab4vWz1izGAyRL1Yf_!!0-item_pic.jpg",
28
+ });
29
+ }
30
+
31
+ let data3 = [];
32
+ for (let i = 0; i < 30; i++) {
33
+ data3.push({
34
+ index: i,
35
+ name: `商品:骆驼奶粉蛋白质粉,限时抢购,立刻发货,序号:${i}`,
36
+ prize: `${Math.floor(Math.random() * 200) +
37
+ 200}` /* 测试数据要保证比最高优惠券(300左右)要高 */,
38
+ savePrize: `${i}`,
39
+ soldTotal: `${Math.floor(Math.random() * 50000)}`,
40
+ pictUrl:
41
+ "http://img.alicdn.com/bao/uploaded/i3/2207313464483/O1CN01Ab4vWz1izGAyRL1Yf_!!0-item_pic.jpg",
42
+ });
43
+ }
44
+
45
+ export { data1, data2, data3 };
@@ -0,0 +1,135 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2021-12-21 15:36:29
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2022-09-01 17:08:21
6
+ * @Description: file content
7
+ -->
8
+ <script>
9
+ import ViewSwiper from "./ViewSwiper.vue";
10
+ import AppTab from "./AppTab.vue";
11
+ import { reactive } from "vue";
12
+ import { EdgeDirection } from "jsview";
13
+ import { advanceMetroWidget, randomColor } from "../data.js";
14
+
15
+ const pageList = [];
16
+ const tabData = [];
17
+
18
+ for (let i = 0; i < 5; i++) {
19
+ tabData.push({
20
+ width: 100,
21
+ height: 50,
22
+ marginRight: 10,
23
+ content: "Tab_" + i,
24
+ color: randomColor(),
25
+ });
26
+
27
+ let data = JSON.parse(JSON.stringify(advanceMetroWidget));
28
+ data.forEach((item) => {
29
+ item.name = "testPage_" + i + "-" + item.name;
30
+ });
31
+ pageList.push({
32
+ width: 600,
33
+ height: 600,
34
+ data: data,
35
+ name: "testPage-" + i,
36
+ });
37
+ }
38
+ export default {
39
+ components: {
40
+ ViewSwiper,
41
+ AppTab,
42
+ },
43
+ setup() {
44
+ let globalInfo = reactive({
45
+ tabId: 0,
46
+ });
47
+ return {
48
+ tabData,
49
+ appPageName: "/page",
50
+ appTabName: "/tab",
51
+ globalInfo,
52
+ pageList,
53
+ preFocusName: "/tab",
54
+ curFocusName: "/tab",
55
+ };
56
+ },
57
+ provide() {
58
+ return {
59
+ globalInfo: this.globalInfo,
60
+ };
61
+ },
62
+ methods: {
63
+ $_app_onFocus() {
64
+ console.log("App onFocus");
65
+ this.$refs.focusNode.findBlockByName(this.curFocusName).requestFocus();
66
+ },
67
+ onKeyDown(ev) {
68
+ if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
69
+ this.$router?.go(-1);
70
+ }
71
+ return true;
72
+ },
73
+ $_app_pageOnEdge(info) {
74
+ console.log("App page on edge ", info);
75
+ if (info.direction === EdgeDirection.top) {
76
+ this.curFocusName = "/tab";
77
+ this.$refs.focusNode.findBlockByName(this.appTabName).requestFocus();
78
+ }
79
+ },
80
+ $_app_tabOnEdge(info) {
81
+ console.log("App tab on edge ", info);
82
+ if (info.direction === EdgeDirection.bottom) {
83
+ this.curFocusName = "/page";
84
+ this.$refs.focusNode.findBlockByName(this.appPageName).requestFocus();
85
+ }
86
+ },
87
+ },
88
+ };
89
+ </script>
90
+
91
+ <template>
92
+ <jsv-focus-block
93
+ ref="focusNode"
94
+ name="/main"
95
+ autoFocus
96
+ :onAction="{
97
+ onKeyDown: onKeyDown,
98
+ onFocus: $_app_onFocus,
99
+ }"
100
+ :style="{
101
+ width: 1920,
102
+ height: 1080,
103
+ backgroundColor: '#007788',
104
+ }"
105
+ >
106
+ <div
107
+ :style="{
108
+ top: 0,
109
+ left: 100,
110
+ }"
111
+ >
112
+ <app-tab
113
+ :data="tabData"
114
+ :name="appTabName"
115
+ :layout="{ width: 1920, height: 100 }"
116
+ :onEdge="$_app_tabOnEdge"
117
+ :style="{
118
+ top: 15,
119
+ }"
120
+ ></app-tab>
121
+ </div>
122
+
123
+ <div :style="{ top: 100, left: 200 }">
124
+ <view-swiper
125
+ :name="appPageName"
126
+ :pageData="pageList"
127
+ :onEdge="$_app_pageOnEdge"
128
+ :layout="{
129
+ width: 600,
130
+ height: 600,
131
+ }"
132
+ ></view-swiper>
133
+ </div>
134
+ </jsv-focus-block>
135
+ </template>