@shijiu/jsview-vue-samples 1.9.888 → 1.9.931

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 (185) hide show
  1. package/AnimPicture/App.vue +10 -10
  2. package/Basic/App.vue +1 -1
  3. package/Basic/components/FontStyle.css +3 -3
  4. package/Basic/components/anim/AnimKeyframeBasic.vue +1 -1
  5. package/Basic/components/anim/AnimKeyframeComposite.vue +2 -2
  6. package/Basic/components/anim/AnimTransition.vue +4 -4
  7. package/Basic/components/div/DivClip.vue +0 -39
  8. package/Basic/components/div/DivCssScoped.vue +1 -1
  9. package/Basic/components/div/DivLayout.vue +6 -1
  10. package/Basic/components/div/DivRadius.vue +4 -4
  11. package/Basic/components/img/ImageGroup.vue +2 -2
  12. package/Basic/components/img/ImgLayout.vue +78 -14
  13. package/Basic/components/text/TextDirection.vue +9 -9
  14. package/Basic/components/text/TextEmoji.vue +7 -2
  15. package/Basic/components/text/TextFontStyle.vue +4 -4
  16. package/Basic/components/text/TextGroup1.vue +1 -1
  17. package/Basic/components/text/TextGroup2.vue +2 -2
  18. package/BasicFocusControl/App.vue +2 -2
  19. package/BasicFocusControl/components/BaseBlock.vue +2 -2
  20. package/BasicFocusControl/components/MainArea.vue +2 -2
  21. package/BasicFocusControl/components/SideBar.vue +2 -2
  22. package/Collision/App.vue +16 -16
  23. package/ColorSpace/App.vue +11 -11
  24. package/CssPreprocessor/App.vue +70 -0
  25. package/CssPreprocessor/Less/App.vue +32 -0
  26. package/CssPreprocessor/Less/PanelData.js +51 -0
  27. package/CssPreprocessor/Less/components/less-group1/LessComments.vue +34 -0
  28. package/CssPreprocessor/Less/components/less-group1/LessConditionals.vue +32 -0
  29. package/CssPreprocessor/Less/components/less-group1/LessOperations.vue +24 -0
  30. package/CssPreprocessor/Less/components/less-group1/LessVariables.vue +48 -0
  31. package/CssPreprocessor/Less/components/less-group2/LessIteration.vue +32 -0
  32. package/CssPreprocessor/Less/components/less-group2/LessMethods.vue +27 -0
  33. package/CssPreprocessor/Less/components/less-group3/LessExtends.vue +32 -0
  34. package/CssPreprocessor/Less/components/less-group3/LessNesting.vue +63 -0
  35. package/CssPreprocessor/Less/components/less-group4/LessKeyframes.vue +40 -0
  36. package/CssPreprocessor/Less/components/less-group4/LessMaps.vue +33 -0
  37. package/CssPreprocessor/Less/components/less-group4/LessMixins.vue +33 -0
  38. package/CssPreprocessor/Less/components/less-group5/LessImporting.vue +34 -0
  39. package/CssPreprocessor/Less/components/less-group5/TextSettings.less +4 -0
  40. package/CssPreprocessor/Scss/App.vue +32 -0
  41. package/CssPreprocessor/Scss/PanelData.js +51 -0
  42. package/CssPreprocessor/Scss/components/scss-group1/ScssComments.vue +34 -0
  43. package/CssPreprocessor/Scss/components/scss-group1/ScssConditionals.vue +36 -0
  44. package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +30 -0
  45. package/CssPreprocessor/Scss/components/scss-group1/ScssVariables.vue +48 -0
  46. package/CssPreprocessor/Scss/components/scss-group2/ScssIteration.vue +36 -0
  47. package/CssPreprocessor/Scss/components/scss-group2/ScssMethods.vue +84 -0
  48. package/CssPreprocessor/Scss/components/scss-group3/ScssExtends.vue +34 -0
  49. package/CssPreprocessor/Scss/components/scss-group3/ScssNesting.vue +75 -0
  50. package/CssPreprocessor/Scss/components/scss-group4/ScssKeyframes.vue +40 -0
  51. package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +35 -0
  52. package/CssPreprocessor/Scss/components/scss-group4/ScssMixins.vue +33 -0
  53. package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +34 -0
  54. package/CssPreprocessor/Scss/components/scss-group5/TextSettings.scss +4 -0
  55. package/CssPreprocessor/Stylus/App.vue +32 -0
  56. package/CssPreprocessor/Stylus/PanelData.js +51 -0
  57. package/CssPreprocessor/Stylus/components/stylus-group1/StylusComments.vue +34 -0
  58. package/CssPreprocessor/Stylus/components/stylus-group1/StylusConditionals.vue +36 -0
  59. package/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +30 -0
  60. package/CssPreprocessor/Stylus/components/stylus-group1/StylusVariables.vue +47 -0
  61. package/CssPreprocessor/Stylus/components/stylus-group2/StylusIteration.vue +34 -0
  62. package/CssPreprocessor/Stylus/components/stylus-group2/StylusMethods.vue +78 -0
  63. package/CssPreprocessor/Stylus/components/stylus-group3/StylusExtends.vue +34 -0
  64. package/CssPreprocessor/Stylus/components/stylus-group3/StylusNesting.vue +63 -0
  65. package/CssPreprocessor/Stylus/components/stylus-group4/StylusKeyframes.vue +40 -0
  66. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMaps.vue +33 -0
  67. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMixins.vue +33 -0
  68. package/CssPreprocessor/Stylus/components/stylus-group5/StylusImporting.vue +34 -0
  69. package/CssPreprocessor/Stylus/components/stylus-group5/TextSettings.styl +4 -0
  70. package/CssPreprocessor/utils/ContentBlock.vue +43 -0
  71. package/CssPreprocessor/utils/ContentList.vue +34 -0
  72. package/CssPreprocessor/utils/FontStyle.css +19 -0
  73. package/CssPreprocessor/utils/Panel.vue +49 -0
  74. package/CssPreprocessor/utils/TitleBar.vue +29 -0
  75. package/DemoHomepage/App.vue +46 -11
  76. package/DemoHomepage/components/Dialog.vue +15 -15
  77. package/DemoHomepage/router.js +21 -13
  78. package/DemoHomepage/views/Homepage.vue +90 -102
  79. package/DivMetroPerformance/App.vue +150 -0
  80. package/DivMetroPerformance/Item.vue +58 -0
  81. package/DivMetroPerformance/assets/bg.jpg +0 -0
  82. package/DivMetroPerformance/assets/coupon_content.png +0 -0
  83. package/DivMetroPerformance/assets/coupon_left.png +0 -0
  84. package/DivMetroPerformance/assets/coupon_mid.png +0 -0
  85. package/DivMetroPerformance/assets/coupon_right.png +0 -0
  86. package/DivMetroPerformance/assets/focus_border.png +0 -0
  87. package/DivMetroPerformance/assets/holder_logo.png +0 -0
  88. package/DivMetroPerformance/assets/jrbm.png +0 -0
  89. package/DivMetroPerformance/assets/line_left.png +0 -0
  90. package/DivMetroPerformance/assets/line_mid.png +0 -0
  91. package/DivMetroPerformance/assets/line_right.png +0 -0
  92. package/DivMetroPerformance/assets/loading.png +0 -0
  93. package/DivMetroPerformance/assets/logo.png +0 -0
  94. package/DivMetroPerformance/assets/mcjx.png +0 -0
  95. package/DivMetroPerformance/assets/tao.png +0 -0
  96. package/DivMetroPerformance/assets/tmall.png +0 -0
  97. package/DivMetroPerformance/border.png +0 -0
  98. package/DivMetroPerformance/components/ContentItem.vue +385 -0
  99. package/DivMetroPerformance/components/MyTab.vue +129 -0
  100. package/DivMetroPerformance/data.js +124 -0
  101. package/DivMetroPerformance/utils/GridItem.vue +28 -0
  102. package/DivMetroPerformance/utils/GridPlate.vue +85 -0
  103. package/FilterDemo/AnimatePic.vue +2 -2
  104. package/FilterDemo/App.vue +3 -3
  105. package/FlipCard/App.vue +2 -2
  106. package/FlipCard/FlipCard.vue +2 -2
  107. package/GridDemo/Item.vue +13 -13
  108. package/HashHistory/App.vue +0 -1
  109. package/HashHistory/components/Item.vue +2 -2
  110. package/HashHistory/views/MainPage.vue +1 -1
  111. package/HashHistory/views/SubPage.vue +2 -2
  112. package/ImpactStop/App.vue +9 -11
  113. package/Input/InputPanel.vue +2 -4
  114. package/LongImage/App.vue +2 -2
  115. package/LongImage/Button.vue +1 -1
  116. package/LongImage/ButtonItem.vue +1 -1
  117. package/LongText/App.vue +3 -3
  118. package/LongText/Button.vue +1 -1
  119. package/LongText/ButtonItem.vue +1 -1
  120. package/LongText/LongTextScroll.vue +4 -4
  121. package/Marquee/longText.js +0 -2
  122. package/MaskClip/App.vue +4 -4
  123. package/MediaDemo/App.vue +127 -0
  124. package/MediaDemo/assets/audio-poster.png +0 -0
  125. package/MediaDemo/components/Button.vue +69 -0
  126. package/MediaDemo/components/Controllor.vue +279 -0
  127. package/MediaDemo/components/StatusBar.vue +100 -0
  128. package/MediaDemo/components/frames/AudioFrame.vue +39 -0
  129. package/MediaDemo/components/frames/AudioPoster.vue +48 -0
  130. package/MediaDemo/components/frames/MediaFrame.vue +153 -0
  131. package/MediaDemo/components/frames/VideoFrame.vue +39 -0
  132. package/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
  133. package/MetroWidgetDemos/Advanced/widgets/Item.vue +5 -5
  134. package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +2 -2
  135. package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +57 -56
  136. package/MetroWidgetDemos/Item.vue +4 -5
  137. package/MetroWidgetDemos/PerformanceTest/App.vue +3 -3
  138. package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
  139. package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +15 -15
  140. package/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
  141. package/MetroWidgetDemos/PingPong/TabItem.vue +2 -2
  142. package/MetroWidgetDemos/PingPong/ViewSwiper.vue +9 -9
  143. package/MetroWidgetDemos/Simple/RelativeTemplate.vue +2 -2
  144. package/MetroWidgetDemos/WidgetItem.vue +2 -2
  145. package/NinePatchDemo/App.vue +3 -3
  146. package/NinePatchDemo/Item.vue +5 -5
  147. package/Preload/App.vue +5 -5
  148. package/Preload/Item.vue +1 -1
  149. package/QrcodeDemo/App.vue +3 -3
  150. package/ScaleDownNeon/App.vue +9 -9
  151. package/SoundPool/App.vue +6 -9
  152. package/SprayView/App.vue +22 -22
  153. package/SpriteImage/App.vue +4 -4
  154. package/Swiper/App.vue +2 -8
  155. package/TextBox/App.vue +1 -2
  156. package/TextBox/RenderCenter.vue +16 -16
  157. package/TextBox/RenderLeft.vue +16 -16
  158. package/TextBox/RenderOneLine.vue +12 -12
  159. package/TextBox/RenderRight.vue +16 -16
  160. package/TextShadowDemo/App.vue +4 -4
  161. package/TextureAnimation/App.vue +1 -17
  162. package/TextureAnimation/App2.vue +3 -3
  163. package/TextureSize/App.vue +8 -8
  164. package/ThrowMoveDemo/AccelerateDemo.vue +4 -4
  165. package/ThrowMoveDemo/LRParabolicDemo.vue +4 -4
  166. package/ThrowMoveDemo/TargetDemo.vue +4 -4
  167. package/ThrowMoveDemo/UDParabolicDemo.vue +4 -4
  168. package/TouchSample/App.vue +2 -2
  169. package/TouchSample/Item.vue +2 -2
  170. package/TouchSample/MetroWidgetHorizontal.vue +3 -3
  171. package/TouchSample/MetroWidgetVertical.vue +3 -3
  172. package/TouchSample/TouchContainerHorizontal.vue +2 -2
  173. package/TouchSample/TouchContainerVertical.vue +2 -2
  174. package/TransitPage/App.vue +1 -1
  175. package/VideoDemo/App.vue +4 -4
  176. package/VideoDemo/components/Button.vue +1 -1
  177. package/VideoDemo/components/Controllor.vue +2 -2
  178. package/VideoDemo/components/VideoFrame.vue +1 -1
  179. package/VisibleSensorDemo/App.vue +7 -7
  180. package/assets/bmpDemo.bmp +0 -0
  181. package/assets/jpegDemo.jpeg +0 -0
  182. package/assets/pngDemo.png +0 -0
  183. package/assets/pngNoAlphaDemo.png +0 -0
  184. package/assets/webpDemo.webp +0 -0
  185. package/package.json +6 -1
@@ -0,0 +1,58 @@
1
+ <script>
2
+ export default {
3
+ props: {
4
+ data: Object,
5
+ query: Object,
6
+ onEdge: Function,
7
+ onAction: Object,
8
+ },
9
+ methods: {
10
+ onFocus() {
11
+ this.focus = true;
12
+ },
13
+ onBlur() {
14
+ this.focus = false;
15
+ },
16
+ onClick() {
17
+ console.log("item click");
18
+ },
19
+ getStyle() {
20
+ const width = this.focus
21
+ ? (this.data.blocks.w - 10) * (1 / 0.8)
22
+ : this.data.blocks.w - 10;
23
+ const height = this.focus
24
+ ? (this.data.blocks.h - 10) * (1 / 0.8)
25
+ : this.data.blocks.h - 10;
26
+ const posx = this.focus ? (this.data.blocks.w - 10 - width) / 2 : 0;
27
+ const posy = this.focus ? (this.data.blocks.h - 10 - height) / 2 : 0;
28
+ return {
29
+ left: posx,
30
+ top: posy,
31
+ width: width,
32
+ height: height,
33
+ color: "#FFFFFF",
34
+ backgroundColor: this.focus ? "#FF0000" : this.data.color,
35
+ };
36
+ },
37
+ },
38
+ data() {
39
+ return {
40
+ focus: false,
41
+ anim: null,
42
+ };
43
+ },
44
+ created() {
45
+ this.onAction.register("onFocus", this.onFocus);
46
+ this.onAction.register("onBlur", this.onBlur);
47
+ this.onAction.register("onClick", this.onClick);
48
+ },
49
+ };
50
+ </script>
51
+
52
+ <template>
53
+ <div :style="{ ...getStyle() }">
54
+ {{ data.content }}
55
+ </div>
56
+ </template>
57
+
58
+ <style scoped></style>
Binary file
@@ -0,0 +1,385 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2021-06-10 14:17:17
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2021-10-18 14:14:05
6
+ * @Description: file content
7
+ -->
8
+ <script>
9
+ import { Options, Vue, setup } from "vue-class-component";
10
+ import posterHolder from "../assets/holder_logo.png";
11
+ import couponLeft from "../assets/coupon_left.png";
12
+ import couponRight from "../assets/coupon_right.png";
13
+ import couponMid from "../assets/coupon_mid.png";
14
+ import borderLeft from "../assets/line_left.png";
15
+ import borderMid from "../assets/line_mid.png";
16
+ import borderRight from "../assets/line_right.png";
17
+
18
+ @Options({
19
+ props: {
20
+ data: Object,
21
+ },
22
+ })
23
+ class ContentItem extends Vue {
24
+ constructor(props) {
25
+ super(props);
26
+ // console.log("cchtest2 ContentItem constructor " + new Date().getTime());
27
+ this.setup = setup(() => {
28
+ return {
29
+ posterHolder,
30
+ couponLeft,
31
+ couponMid,
32
+ couponRight,
33
+ borderLeft,
34
+ borderMid,
35
+ borderRight,
36
+ };
37
+ });
38
+ }
39
+
40
+ created() {}
41
+
42
+ get savePrizeWidth() {
43
+ return 10 * this.data.savePrize.length + 26;
44
+ }
45
+
46
+ get soldTotalWidth() {
47
+ let width = 44 + 22; //base width;
48
+ if (this.data.soldTotal >= 10000) {
49
+ let text = parseInt(this.data.soldTotal / 10000) + "";
50
+ width += text.length * 12 + 22;
51
+ } else {
52
+ width += (this.data.soldTotal + "").length * 12;
53
+ }
54
+ return width;
55
+ }
56
+
57
+ get soldTotalText() {
58
+ let text = "";
59
+ if (this.data.soldTotal >= 10000) {
60
+ text = parseInt(this.data.soldTotal / 10000) + "万";
61
+ } else {
62
+ text = this.data.soldTotal;
63
+ }
64
+ return text;
65
+ }
66
+ }
67
+
68
+ export default ContentItem;
69
+ </script>
70
+
71
+ <template>
72
+ <div class="frame-background">
73
+ <div class="poster-holder">
74
+ <div
75
+ :style="{
76
+ width: 107,
77
+ height: 23,
78
+ left: 53,
79
+ top: 95,
80
+ backgroundImage: setup.posterHolder,
81
+ }"
82
+ />
83
+ </div>
84
+ <div
85
+ class="poster"
86
+ :style="{
87
+ backgroundImage: `url(${data.pictUrl})`,
88
+ }"
89
+ />
90
+ <div class="title-font title-layout">
91
+ {{ data.index + data.name }}
92
+ </div>
93
+ <div
94
+ :style="{
95
+ height: 24,
96
+ left: 13,
97
+ top: 256,
98
+ width: savePrizeWidth,
99
+ }"
100
+ >
101
+ <div
102
+ :style="{ width: 5, height: 24, backgroundImage: setup.couponLeft }"
103
+ />
104
+ <div
105
+ :style="{
106
+ left: 5,
107
+ width: savePrizeWidth - 11,
108
+ height: 24,
109
+ backgroundImage: setup.couponMid,
110
+ }"
111
+ />
112
+ <div
113
+ :style="{
114
+ left: savePrizeWidth - 6,
115
+ width: 5,
116
+ height: 24,
117
+ backgroundImage: setup.couponRight,
118
+ }"
119
+ />
120
+ <div
121
+ class="ticket-text"
122
+ :style="{
123
+ width: savePrizeWidth,
124
+ }"
125
+ >
126
+ {{ `${data.savePrize}元券` }}
127
+ </div>
128
+ </div>
129
+
130
+ <div
131
+ :style="{
132
+ top: 256,
133
+ left: 27 + savePrizeWidth,
134
+ }"
135
+ >
136
+ <div
137
+ :style="{ width: 7, height: 25, backgroundImage: setup.borderLeft }"
138
+ />
139
+ <div
140
+ :style="{
141
+ left: 7,
142
+ width: soldTotalWidth - 13,
143
+ height: 25,
144
+ backgroundImage: setup.borderMid,
145
+ }"
146
+ />
147
+ <div
148
+ :style="{
149
+ left: soldTotalWidth - 7,
150
+ width: 7,
151
+ height: 25,
152
+ backgroundImage: setup.borderRight,
153
+ }"
154
+ />
155
+ <div
156
+ class="sold-text"
157
+ :style="{
158
+ width: soldTotalWidth,
159
+ }"
160
+ >
161
+ {{ `已售${soldTotalText}件` }}
162
+ </div>
163
+ </div>
164
+
165
+ <div
166
+ :style="{
167
+ height: 24,
168
+ left: 13,
169
+ top: 270,
170
+ width: savePrizeWidth,
171
+ }"
172
+ >
173
+ <div
174
+ :style="{ width: 5, height: 24, backgroundImage: setup.couponLeft }"
175
+ />
176
+ <div
177
+ :style="{
178
+ left: 5,
179
+ width: savePrizeWidth - 11,
180
+ height: 24,
181
+ backgroundImage: setup.couponMid,
182
+ }"
183
+ />
184
+ <div
185
+ :style="{
186
+ left: savePrizeWidth - 6,
187
+ width: 5,
188
+ height: 24,
189
+ backgroundImage: setup.couponRight,
190
+ }"
191
+ />
192
+ <div
193
+ class="ticket-text"
194
+ :style="{
195
+ width: savePrizeWidth,
196
+ }"
197
+ >
198
+ {{ `${data.savePrize}元券` }}
199
+ </div>
200
+ </div>
201
+ <div
202
+ :style="{
203
+ top: 270,
204
+ left: 27 + savePrizeWidth,
205
+ }"
206
+ >
207
+ <div
208
+ :style="{ width: 7, height: 25, backgroundImage: setup.borderLeft }"
209
+ />
210
+ <div
211
+ :style="{
212
+ left: 7,
213
+ width: soldTotalWidth - 13,
214
+ height: 25,
215
+ backgroundImage: setup.borderMid,
216
+ }"
217
+ />
218
+ <div
219
+ :style="{
220
+ left: soldTotalWidth - 7,
221
+ width: 7,
222
+ height: 25,
223
+ backgroundImage: setup.borderRight,
224
+ }"
225
+ />
226
+ <div
227
+ class="sold-text"
228
+ :style="{
229
+ width: soldTotalWidth,
230
+ }"
231
+ >
232
+ {{ `已售${soldTotalText}件` }}
233
+ </div>
234
+ </div>
235
+
236
+ <div
237
+ :style="{
238
+ height: 24,
239
+ left: 13,
240
+ top: 280,
241
+ width: savePrizeWidth,
242
+ }"
243
+ >
244
+ <div
245
+ :style="{ width: 5, height: 24, backgroundImage: setup.couponLeft }"
246
+ />
247
+ <div
248
+ :style="{
249
+ left: 5,
250
+ width: savePrizeWidth - 11,
251
+ height: 24,
252
+ backgroundImage: setup.couponMid,
253
+ }"
254
+ />
255
+ <div
256
+ :style="{
257
+ left: savePrizeWidth - 6,
258
+ width: 5,
259
+ height: 24,
260
+ backgroundImage: setup.couponRight,
261
+ }"
262
+ />
263
+ <div
264
+ class="ticket-text"
265
+ :style="{
266
+ width: savePrizeWidth,
267
+ }"
268
+ >
269
+ {{ `${data.savePrize}元券` }}
270
+ </div>
271
+ </div>
272
+ <div
273
+ :style="{
274
+ top: 280,
275
+ left: 27 + savePrizeWidth,
276
+ }"
277
+ >
278
+ <div
279
+ :style="{ width: 7, height: 25, backgroundImage: setup.borderLeft }"
280
+ />
281
+ <div
282
+ :style="{
283
+ left: 7,
284
+ width: soldTotalWidth - 13,
285
+ height: 25,
286
+ backgroundImage: setup.borderMid,
287
+ }"
288
+ />
289
+ <div
290
+ :style="{
291
+ left: soldTotalWidth - 7,
292
+ width: 7,
293
+ height: 25,
294
+ backgroundImage: setup.borderRight,
295
+ }"
296
+ />
297
+ <div
298
+ class="sold-text"
299
+ :style="{
300
+ width: soldTotalWidth,
301
+ }"
302
+ >
303
+ {{ `已售${soldTotalText}件` }}
304
+ </div>
305
+ </div>
306
+
307
+ <div class="prize-title-font prize-title-layout">券后</div>
308
+ <div class="prize-font">
309
+ {{ `¥${data.prize - data.savePrize}` }}
310
+ </div>
311
+ </div>
312
+ </template>
313
+
314
+ <style scoped>
315
+ .frame-background {
316
+ width: 213;
317
+ height: 337;
318
+ border-radius: 10 10 10 10;
319
+ background-color: #f7f7f4;
320
+ transition: transform 0.2s linear;
321
+ }
322
+
323
+ .poster-holder {
324
+ width: 213;
325
+ height: 213;
326
+ border-radius: 10 10 0 0;
327
+ background-color: #cfcac6;
328
+ }
329
+ .poster {
330
+ width: 213;
331
+ height: 213;
332
+ border-radius: 7 7 0 0;
333
+ }
334
+
335
+ .title-font {
336
+ font-size: 21;
337
+ color: #73665c;
338
+ line-height: 29;
339
+ overflow: hidden;
340
+ white-space: nowrap;
341
+ text-overflow: ellipsis;
342
+ text-align: center;
343
+ }
344
+ .title-layout {
345
+ top: 221;
346
+ left: 13;
347
+ width: 193;
348
+ height: 29;
349
+ }
350
+ .ticket-text {
351
+ height: 24;
352
+ color: #ffffff;
353
+ font-size: 16;
354
+ text-align: center;
355
+ line-height: 24;
356
+ }
357
+ .sold-text {
358
+ height: 25;
359
+ color: #ff7a00;
360
+ font-size: 20;
361
+ text-align: center;
362
+ line-height: 25;
363
+ }
364
+ .prize-title-layout {
365
+ width: 35;
366
+ height: 24;
367
+ top: 296;
368
+ left: 13;
369
+ }
370
+ .prize-title-font {
371
+ color: #de2825;
372
+ text-align: center;
373
+ font-size: 17;
374
+ line-height: 24;
375
+ }
376
+ .prize-font {
377
+ top: 289;
378
+ left: 53;
379
+ width: 158; /*213 - 55*/
380
+ height: 37;
381
+ line-height: 37;
382
+ font-size: 28;
383
+ color: #de2825;
384
+ }
385
+ </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 } from "vue";
10
+
11
+ export default {
12
+ props: {
13
+ name: String,
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: 200;
103
+ height: 50;
104
+ line-height: 50;
105
+ color: #444444;
106
+ font-size: 25;
107
+ text-align: center;
108
+ }
109
+
110
+ .text-active {
111
+ width: 200;
112
+ height: 50;
113
+ line-height: 50;
114
+ color: #ffffff;
115
+ font-size: 25;
116
+ text-align: center;
117
+ }
118
+
119
+ .item-focused {
120
+ width: 200;
121
+ height: 50;
122
+ background-color: #008080;
123
+ }
124
+ .item-normal {
125
+ width: 200;
126
+ height: 50;
127
+ background-color: #87CECB;
128
+ }
129
+ </style>