@shijiu/jsview-vue 0.0.1-beta.0

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 (252) hide show
  1. package/docs/IMPORT_CHANGE_LOG.txt +3 -0
  2. package/docs/git_commit.md +15 -0
  3. package/docs/test_version_up.txt +1 -0
  4. package/dom/bin/jsview-dom-1.0.313.tgz +0 -0
  5. package/dom/browser-root-style.css +21 -0
  6. package/dom/jsv-browser-debug-dom.js +8 -0
  7. package/dom/jsv-dom.js +6 -0
  8. package/dom/jsv-forge-define.js +6 -0
  9. package/dom/target_core_revision.js +14 -0
  10. package/load/header_script_loader.js +134 -0
  11. package/load/jsview-main.js +42 -0
  12. package/load/jsview.config.default.js +37 -0
  13. package/load/jsview.default.config.js +37 -0
  14. package/load/loader.js +172 -0
  15. package/load/loader_webkit.js +40 -0
  16. package/package.json +27 -0
  17. package/patch/node_modules/@babel/preset-env/lib/available-plugins.js +219 -0
  18. package/patch/node_modules/@vue/cli-plugin-typescript/index.js +100 -0
  19. package/patch/node_modules/@vue/cli-service/lib/commands/serve.js +395 -0
  20. package/patch/node_modules/@vue/cli-service/lib/config/app.js +272 -0
  21. package/patch/node_modules/@vue/cli-service/lib/config/assets.js +70 -0
  22. package/patch/node_modules/@vue/cli-service/lib/config/base.js +212 -0
  23. package/patch/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +2566 -0
  24. package/patch/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +274 -0
  25. package/patch/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1596 -0
  26. package/patch/node_modules/postcss-js/objectifier.js +90 -0
  27. package/patch/node_modules/vue-loader/dist/resolveScript.js +70 -0
  28. package/patch/package-lock.json +30051 -0
  29. package/samples/AdvanceMetroWidget/App.vue +123 -0
  30. package/samples/AdvanceMetroWidget/Frame.vue +101 -0
  31. package/samples/AdvanceMetroWidget/Item.vue +58 -0
  32. package/samples/AdvanceMetroWidget/data.js +137 -0
  33. package/samples/AnimPicture/App.vue +224 -0
  34. package/samples/AnimPicture/assets/animated_webp.webp +0 -0
  35. package/samples/AnimPicture/assets/ball_3.webp +0 -0
  36. package/samples/AnimPicture/assets/girl_run.gif +0 -0
  37. package/samples/AnimPicture/assets/quan.webp +0 -0
  38. package/samples/Basic/App.vue +129 -0
  39. package/samples/Basic/assets/border.png +0 -0
  40. package/samples/Basic/assets/border2.png +0 -0
  41. package/samples/Basic/assets/icon.png +0 -0
  42. package/samples/Basic/assets/test.jpg +0 -0
  43. package/samples/Basic/components/ContentBlock.vue +36 -0
  44. package/samples/Basic/components/FontStyle.css +10 -0
  45. package/samples/Basic/components/TitleBar.vue +29 -0
  46. package/samples/Basic/components/anim/AnimGroup.vue +68 -0
  47. package/samples/Basic/components/anim/AnimKeyframeBasic.vue +102 -0
  48. package/samples/Basic/components/anim/AnimKeyframeComposite.vue +53 -0
  49. package/samples/Basic/components/anim/AnimTransition.vue +116 -0
  50. package/samples/Basic/components/div/DivBackground.vue +15 -0
  51. package/samples/Basic/components/div/DivClip.vue +81 -0
  52. package/samples/Basic/components/div/DivCssScoped.vue +27 -0
  53. package/samples/Basic/components/div/DivCssVar.vue +50 -0
  54. package/samples/Basic/components/div/DivGroup1.vue +33 -0
  55. package/samples/Basic/components/div/DivGroup2.vue +41 -0
  56. package/samples/Basic/components/div/DivLayout.vue +12 -0
  57. package/samples/Basic/components/div/DivRadius.vue +47 -0
  58. package/samples/Basic/components/text/TextAlign.vue +48 -0
  59. package/samples/Basic/components/text/TextFontStyle.vue +58 -0
  60. package/samples/Basic/components/text/TextGroup.vue +32 -0
  61. package/samples/Basic/components/text/TextOverflow.vue +78 -0
  62. package/samples/BasicFocusControl/App.vue +125 -0
  63. package/samples/BasicFocusControl/components/BaseBlock.vue +51 -0
  64. package/samples/BasicFocusControl/components/MainArea.vue +98 -0
  65. package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +21 -0
  66. package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +30 -0
  67. package/samples/BasicFocusControl/components/SideBar.vue +73 -0
  68. package/samples/BasicFocusControl/components/SideBarBlock.vue +30 -0
  69. package/samples/ClassNameDemo/App.vue +119 -0
  70. package/samples/ClassNameDemo/assets/bg.jpg +0 -0
  71. package/samples/ClassNameDemo/assets/coupon_content.png +0 -0
  72. package/samples/ClassNameDemo/assets/coupon_left.png +0 -0
  73. package/samples/ClassNameDemo/assets/coupon_mid.png +0 -0
  74. package/samples/ClassNameDemo/assets/coupon_right.png +0 -0
  75. package/samples/ClassNameDemo/assets/focus_border.png +0 -0
  76. package/samples/ClassNameDemo/assets/holder_logo.png +0 -0
  77. package/samples/ClassNameDemo/assets/jrbm.png +0 -0
  78. package/samples/ClassNameDemo/assets/line_left.png +0 -0
  79. package/samples/ClassNameDemo/assets/line_mid.png +0 -0
  80. package/samples/ClassNameDemo/assets/line_right.png +0 -0
  81. package/samples/ClassNameDemo/assets/loading.png +0 -0
  82. package/samples/ClassNameDemo/assets/logo.png +0 -0
  83. package/samples/ClassNameDemo/assets/mcjx.png +0 -0
  84. package/samples/ClassNameDemo/assets/tao.png +0 -0
  85. package/samples/ClassNameDemo/assets/tmall.png +0 -0
  86. package/samples/ClassNameDemo/components/ContentItem.vue +253 -0
  87. package/samples/ClassNameDemo/components/LoadingView.vue +43 -0
  88. package/samples/ClassNameDemo/components/TitleView.vue +24 -0
  89. package/samples/ClassNameDemo/data.js +24 -0
  90. package/samples/ColorSpace/App.vue +135 -0
  91. package/samples/ColorSpace/bmpDemo.bmp +0 -0
  92. package/samples/ColorSpace/jpegDemo.jpeg +0 -0
  93. package/samples/ColorSpace/pngDemo.png +0 -0
  94. package/samples/ColorSpace/pngNoAlphaDemo.png +0 -0
  95. package/samples/DemoHomepage/App.vue +31 -0
  96. package/samples/DemoHomepage/components/BodyFrame.vue +82 -0
  97. package/samples/DemoHomepage/components/Dialog.vue +94 -0
  98. package/samples/DemoHomepage/components/Item.vue +77 -0
  99. package/samples/DemoHomepage/components/TabFrame.vue +86 -0
  100. package/samples/DemoHomepage/router.js +132 -0
  101. package/samples/DemoHomepage/views/Homepage.vue +186 -0
  102. package/samples/FlipCard/App.vue +80 -0
  103. package/samples/FlipCard/FlipCard.vue +124 -0
  104. package/samples/FlipCard/assets/blue_egg.png +0 -0
  105. package/samples/FlipCard/assets/red_egg.png +0 -0
  106. package/samples/FlipCard/data.js +13 -0
  107. package/samples/FlowMultiWidget/App.vue +91 -0
  108. package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
  109. package/samples/FlowMultiWidget/components/Block.vue +107 -0
  110. package/samples/FlowMultiWidget/components/FlowPage.vue +60 -0
  111. package/samples/FlowMultiWidget/components/Item.vue +103 -0
  112. package/samples/FlowMultiWidget/components/MenuItem.vue +72 -0
  113. package/samples/FlowMultiWidget/components/MyMenu.vue +90 -0
  114. package/samples/FlowMultiWidget/data.js +446 -0
  115. package/samples/HashHistory/App.vue +124 -0
  116. package/samples/HashHistory/components/HorizontalButtonList.vue +114 -0
  117. package/samples/HashHistory/components/Item.vue +74 -0
  118. package/samples/HashHistory/router.js +30 -0
  119. package/samples/HashHistory/views/BasePage.vue +19 -0
  120. package/samples/HashHistory/views/MainPage.vue +68 -0
  121. package/samples/HashHistory/views/SubPage.vue +79 -0
  122. package/samples/HashHistory/views/SubPageFirst.vue +10 -0
  123. package/samples/HashHistory/views/SubPageSecond.vue +10 -0
  124. package/samples/LongImage/App.vue +96 -0
  125. package/samples/LongImage/Button.vue +153 -0
  126. package/samples/LongImage/LongImageScroll.vue +127 -0
  127. package/samples/LongImage/Scroll.vue +16 -0
  128. package/samples/LongImage/assets/1280x7200.jpg +0 -0
  129. package/samples/LongText/App.vue +111 -0
  130. package/samples/LongText/Button.vue +153 -0
  131. package/samples/LongText/LongTextScroll.vue +225 -0
  132. package/samples/LongText/Scroll.vue +16 -0
  133. package/samples/Preload/App.vue +146 -0
  134. package/samples/Preload/data.js +23 -0
  135. package/samples/Preload/images/awesomeface.png +0 -0
  136. package/samples/Preload/images/cat.jpg +0 -0
  137. package/samples/Preload/images/rank.png +0 -0
  138. package/samples/Preload/images/rank_focus.png +0 -0
  139. package/samples/Preload/images/rule.png +0 -0
  140. package/samples/Preload/images/rule_focus.png +0 -0
  141. package/samples/Preload/images/start.png +0 -0
  142. package/samples/Preload/images/start_focus.png +0 -0
  143. package/samples/Preload/preloadItem.vue +22 -0
  144. package/samples/QrcodeDemo/App.vue +73 -0
  145. package/samples/SimpleWidgetDemo/App.vue +204 -0
  146. package/samples/SimpleWidgetDemo/Item.vue +83 -0
  147. package/samples/SimpleWidgetDemo/assets/bg.jpg +0 -0
  148. package/samples/SimpleWidgetDemo/assets/coupon_content.png +0 -0
  149. package/samples/SimpleWidgetDemo/assets/coupon_left.png +0 -0
  150. package/samples/SimpleWidgetDemo/assets/coupon_mid.png +0 -0
  151. package/samples/SimpleWidgetDemo/assets/coupon_right.png +0 -0
  152. package/samples/SimpleWidgetDemo/assets/focus_border.png +0 -0
  153. package/samples/SimpleWidgetDemo/assets/holder_logo.png +0 -0
  154. package/samples/SimpleWidgetDemo/assets/jrbm.png +0 -0
  155. package/samples/SimpleWidgetDemo/assets/line_left.png +0 -0
  156. package/samples/SimpleWidgetDemo/assets/line_mid.png +0 -0
  157. package/samples/SimpleWidgetDemo/assets/line_right.png +0 -0
  158. package/samples/SimpleWidgetDemo/assets/loading.png +0 -0
  159. package/samples/SimpleWidgetDemo/assets/logo.png +0 -0
  160. package/samples/SimpleWidgetDemo/assets/mcjx.png +0 -0
  161. package/samples/SimpleWidgetDemo/assets/tao.png +0 -0
  162. package/samples/SimpleWidgetDemo/assets/tmall.png +0 -0
  163. package/samples/SimpleWidgetDemo/border.png +0 -0
  164. package/samples/SimpleWidgetDemo/components/ContentItem.vue +412 -0
  165. package/samples/SimpleWidgetDemo/components/MyTab.vue +117 -0
  166. package/samples/SimpleWidgetDemo/data.js +110 -0
  167. package/samples/SprayView/App.vue +270 -0
  168. package/samples/SprayView/assets/snow.png +0 -0
  169. package/samples/SpriteImage/App.vue +174 -0
  170. package/samples/SpriteImage/images/cat_run.png +0 -0
  171. package/samples/SpriteImage/images/egg_break.json +116 -0
  172. package/samples/SpriteImage/images/egg_break.png +0 -0
  173. package/samples/SpriteImage/images/sprite.png +0 -0
  174. package/samples/TextBox/App.vue +179 -0
  175. package/samples/TextBox/RenderCenter.vue +109 -0
  176. package/samples/TextBox/RenderLeft.vue +109 -0
  177. package/samples/TextBox/RenderOneLine.vue +120 -0
  178. package/samples/TextBox/RenderRight.vue +107 -0
  179. package/samples/TextShadowDemo/App.vue +98 -0
  180. package/samples/TextureSize/App.vue +142 -0
  181. package/samples/TextureSize/bmpDemo.bmp +0 -0
  182. package/samples/TextureSize/jpegDemo.jpeg +0 -0
  183. package/samples/TextureSize/jpgDemo.jpg +0 -0
  184. package/samples/TextureSize/pngDemo.png +0 -0
  185. package/samples/TextureSize/pngNoAlphaDemo.png +0 -0
  186. package/samples/ThrowMoveDemo/AccelerateDemo.vue +118 -0
  187. package/samples/ThrowMoveDemo/App.vue +114 -0
  188. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +116 -0
  189. package/samples/ThrowMoveDemo/TargetDemo.vue +117 -0
  190. package/samples/ThrowMoveDemo/UDParabolicDemo.vue +122 -0
  191. package/samples/TransitPage/App.vue +41 -0
  192. package/samples/VideoDemo/App.vue +137 -0
  193. package/samples/VideoDemo/components/Button.vue +69 -0
  194. package/samples/VideoDemo/components/Controllor.vue +195 -0
  195. package/samples/VideoDemo/components/VideoFrame.vue +152 -0
  196. package/scripts/git-commit-empty.js +21 -0
  197. package/scripts/install-local-packages.js +121 -0
  198. package/scripts/make-js.sh +181 -0
  199. package/scripts/post-build.js +132 -0
  200. package/scripts/post-install.js +127 -0
  201. package/scripts/pre-pack.js +2 -0
  202. package/scripts/run-android.js +64 -0
  203. package/utils/JsViewEngineWidget/bin/shijiu-jsview-vue-widget-1.0.1.tgz +0 -0
  204. package/utils/JsViewEngineWidget/index.d.ts +32 -0
  205. package/utils/JsViewEngineWidget/index.js +6 -0
  206. package/utils/JsViewVueTools/DebugContentShellJBridge.js +16 -0
  207. package/utils/JsViewVueTools/DebugTool.js +21 -0
  208. package/utils/JsViewVueTools/DefaultKeyMap.js +12 -0
  209. package/utils/JsViewVueTools/JsvDynamicCssStyle.js +73 -0
  210. package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +128 -0
  211. package/utils/JsViewVueTools/JsvHashHistory.js +112 -0
  212. package/utils/JsViewVueTools/JsvRuntimeBridge.js +417 -0
  213. package/utils/JsViewVueTools/JsvStyleClass.js +290 -0
  214. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +80 -0
  215. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +148 -0
  216. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +55 -0
  217. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/ApicDataBase.js +29 -0
  218. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +124 -0
  219. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/GifData.js +83 -0
  220. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/LoopToolBase.js +25 -0
  221. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/NormalLoopTool.js +61 -0
  222. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/PartLoopTool.js +119 -0
  223. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/Viewer.js +106 -0
  224. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/WebpData.js +141 -0
  225. package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetLoader.js +20 -0
  226. package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetWrapper.js +11 -0
  227. package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +204 -0
  228. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +64 -0
  229. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +427 -0
  230. package/utils/JsViewVueWidget/JsvActorMove/index.js +12 -0
  231. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +179 -0
  232. package/utils/JsViewVueWidget/JsvApic/index.js +17 -0
  233. package/utils/JsViewVueWidget/JsvMarquee.vue +197 -0
  234. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +92 -0
  235. package/utils/JsViewVueWidget/JsvNinePatch.vue +76 -0
  236. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +351 -0
  237. package/utils/JsViewVueWidget/JsvPreload/index.js +21 -0
  238. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +140 -0
  239. package/utils/JsViewVueWidget/JsvQrcode/index.js +18 -0
  240. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +140 -0
  241. package/utils/JsViewVueWidget/JsvSpray/index.js +15 -0
  242. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +448 -0
  243. package/utils/JsViewVueWidget/JsvSpriteAnim/SpriteController.js +57 -0
  244. package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +6 -0
  245. package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +35 -0
  246. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +495 -0
  247. package/utils/JsViewVueWidget/JsvSwiper/index.js +10 -0
  248. package/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue +35 -0
  249. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +404 -0
  250. package/utils/JsViewVueWidget/JsvSwiper3D/index.js +10 -0
  251. package/utils/JsViewVueWidget/JsvTextBox.vue +111 -0
  252. package/utils/JsViewVueWidget/JsvVideo.vue +36 -0
@@ -0,0 +1,412 @@
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
+ query: Object,
22
+ onEdge: Function,
23
+ onAction: Object,
24
+ },
25
+ })
26
+ class ContentItem extends Vue {
27
+ constructor(props) {
28
+ super(props);
29
+ // console.log("cchtest2 ContentItem constructor " + new Date().getTime());
30
+ this.focused = false;
31
+ this.setup = setup(() => {
32
+ return {
33
+ posterHolder,
34
+ couponLeft,
35
+ couponMid,
36
+ couponRight,
37
+ borderLeft,
38
+ borderMid,
39
+ borderRight,
40
+ };
41
+ });
42
+ }
43
+
44
+ onFocus() {
45
+ this.focused = true;
46
+ }
47
+
48
+ onBlur() {
49
+ this.focused = false;
50
+ }
51
+
52
+ onClick() {}
53
+
54
+ created() {
55
+ this.onAction.register("onFocus", this.onFocus);
56
+ this.onAction.register("onBlur", this.onBlur);
57
+ this.onAction.register("onClick", this.onClick);
58
+ }
59
+
60
+ get focusTransform() {
61
+ return this.focused ? "scale3d(1.2, 1.2, 1)" : null;
62
+ }
63
+
64
+ get savePrizeWidth() {
65
+ return 10 * this.data.savePrize.length + 26;
66
+ }
67
+
68
+ get soldTotalWidth() {
69
+ let width = 44 + 22; //base width;
70
+ if (this.data.soldTotal >= 10000) {
71
+ let text = parseInt(this.data.soldTotal / 10000) + "";
72
+ width += text.length * 12 + 22;
73
+ } else {
74
+ width += (this.data.soldTotal + "").length * 12;
75
+ }
76
+ return width;
77
+ }
78
+
79
+ get soldTotalText() {
80
+ let text = "";
81
+ if (this.data.soldTotal >= 10000) {
82
+ text = parseInt(this.data.soldTotal / 10000) + "万";
83
+ } else {
84
+ text = this.data.soldTotal;
85
+ }
86
+ return text;
87
+ }
88
+ }
89
+
90
+ export default ContentItem;
91
+ </script>
92
+
93
+ <template>
94
+ <div
95
+ class="frame-background"
96
+ :style="{
97
+ transform: focusTransform,
98
+ }"
99
+ >
100
+ <div class="poster-holder">
101
+ <div
102
+ :style="{
103
+ width: 107,
104
+ height: 23,
105
+ left: 53,
106
+ top: 95,
107
+ backgroundImage: setup.posterHolder,
108
+ }"
109
+ />
110
+ </div>
111
+ <div
112
+ class="poster"
113
+ :style="{
114
+ backgroundImage: `url(${data.pictUrl})`,
115
+ }"
116
+ />
117
+ <div class="title-font title-layout">
118
+ {{ data.index + data.name }}
119
+ </div>
120
+ <div
121
+ :style="{
122
+ height: 24,
123
+ left: 13,
124
+ top: 256,
125
+ width: savePrizeWidth,
126
+ }"
127
+ >
128
+ <div
129
+ :style="{ width: 5, height: 24, backgroundImage: setup.couponLeft }"
130
+ />
131
+ <div
132
+ :style="{
133
+ left: 5,
134
+ width: savePrizeWidth - 11,
135
+ height: 24,
136
+ backgroundImage: setup.couponMid,
137
+ }"
138
+ />
139
+ <div
140
+ :style="{
141
+ left: savePrizeWidth - 6,
142
+ width: 5,
143
+ height: 24,
144
+ backgroundImage: setup.couponRight,
145
+ }"
146
+ />
147
+ <div
148
+ class="ticket-text"
149
+ :style="{
150
+ width: savePrizeWidth,
151
+ }"
152
+ >
153
+ {{ `${data.savePrize}元券` }}
154
+ </div>
155
+ </div>
156
+
157
+ <div
158
+ :style="{
159
+ top: 256,
160
+ left: 27 + savePrizeWidth,
161
+ }"
162
+ >
163
+ <div
164
+ :style="{ width: 7, height: 25, backgroundImage: setup.borderLeft }"
165
+ />
166
+ <div
167
+ :style="{
168
+ left: 7,
169
+ width: soldTotalWidth - 13,
170
+ height: 25,
171
+ backgroundImage: setup.borderMid,
172
+ }"
173
+ />
174
+ <div
175
+ :style="{
176
+ left: soldTotalWidth - 7,
177
+ width: 7,
178
+ height: 25,
179
+ backgroundImage: setup.borderRight,
180
+ }"
181
+ />
182
+ <div
183
+ class="sold-text"
184
+ :style="{
185
+ width: soldTotalWidth,
186
+ }"
187
+ >
188
+ {{ `已售${soldTotalText}件` }}
189
+ </div>
190
+ </div>
191
+
192
+ <div
193
+ :style="{
194
+ height: 24,
195
+ left: 13,
196
+ top: 270,
197
+ width: savePrizeWidth,
198
+ }"
199
+ >
200
+ <div
201
+ :style="{ width: 5, height: 24, backgroundImage: setup.couponLeft }"
202
+ />
203
+ <div
204
+ :style="{
205
+ left: 5,
206
+ width: savePrizeWidth - 11,
207
+ height: 24,
208
+ backgroundImage: setup.couponMid,
209
+ }"
210
+ />
211
+ <div
212
+ :style="{
213
+ left: savePrizeWidth - 6,
214
+ width: 5,
215
+ height: 24,
216
+ backgroundImage: setup.couponRight,
217
+ }"
218
+ />
219
+ <div
220
+ class="ticket-text"
221
+ :style="{
222
+ width: savePrizeWidth,
223
+ }"
224
+ >
225
+ {{ `${data.savePrize}元券` }}
226
+ </div>
227
+ </div>
228
+ <div
229
+ :style="{
230
+ top: 270,
231
+ left: 27 + savePrizeWidth,
232
+ }"
233
+ >
234
+ <div
235
+ :style="{ width: 7, height: 25, backgroundImage: setup.borderLeft }"
236
+ />
237
+ <div
238
+ :style="{
239
+ left: 7,
240
+ width: soldTotalWidth - 13,
241
+ height: 25,
242
+ backgroundImage: setup.borderMid,
243
+ }"
244
+ />
245
+ <div
246
+ :style="{
247
+ left: soldTotalWidth - 7,
248
+ width: 7,
249
+ height: 25,
250
+ backgroundImage: setup.borderRight,
251
+ }"
252
+ />
253
+ <div
254
+ class="sold-text"
255
+ :style="{
256
+ width: soldTotalWidth,
257
+ }"
258
+ >
259
+ {{ `已售${soldTotalText}件` }}
260
+ </div>
261
+ </div>
262
+
263
+ <div
264
+ :style="{
265
+ height: 24,
266
+ left: 13,
267
+ top: 280,
268
+ width: savePrizeWidth,
269
+ }"
270
+ >
271
+ <div
272
+ :style="{ width: 5, height: 24, backgroundImage: setup.couponLeft }"
273
+ />
274
+ <div
275
+ :style="{
276
+ left: 5,
277
+ width: savePrizeWidth - 11,
278
+ height: 24,
279
+ backgroundImage: setup.couponMid,
280
+ }"
281
+ />
282
+ <div
283
+ :style="{
284
+ left: savePrizeWidth - 6,
285
+ width: 5,
286
+ height: 24,
287
+ backgroundImage: setup.couponRight,
288
+ }"
289
+ />
290
+ <div
291
+ class="ticket-text"
292
+ :style="{
293
+ width: savePrizeWidth,
294
+ }"
295
+ >
296
+ {{ `${data.savePrize}元券` }}
297
+ </div>
298
+ </div>
299
+ <div
300
+ :style="{
301
+ top: 280,
302
+ left: 27 + savePrizeWidth,
303
+ }"
304
+ >
305
+ <div
306
+ :style="{ width: 7, height: 25, backgroundImage: setup.borderLeft }"
307
+ />
308
+ <div
309
+ :style="{
310
+ left: 7,
311
+ width: soldTotalWidth - 13,
312
+ height: 25,
313
+ backgroundImage: setup.borderMid,
314
+ }"
315
+ />
316
+ <div
317
+ :style="{
318
+ left: soldTotalWidth - 7,
319
+ width: 7,
320
+ height: 25,
321
+ backgroundImage: setup.borderRight,
322
+ }"
323
+ />
324
+ <div
325
+ class="sold-text"
326
+ :style="{
327
+ width: soldTotalWidth,
328
+ }"
329
+ >
330
+ {{ `已售${soldTotalText}件` }}
331
+ </div>
332
+ </div>
333
+
334
+ <div class="prize-title-font prize-title-layout">券后</div>
335
+ <div class="prize-font">
336
+ {{ `¥${data.prize - data.savePrize}` }}
337
+ </div>
338
+ </div>
339
+ </template>
340
+
341
+ <style scoped>
342
+ .frame-background {
343
+ width: 213px;
344
+ height: 337px;
345
+ border-radius: 10px 10px 10px 10px;
346
+ background-color: #f7f7f4;
347
+ transition: transform 0.2s linear;
348
+ }
349
+
350
+ .poster-holder {
351
+ width: 213px;
352
+ height: 213px;
353
+ border-radius: 10px 10px 0px 0px;
354
+ background-color: #cfcac6;
355
+ }
356
+ .poster {
357
+ width: 213px;
358
+ height: 213px;
359
+ border-radius: 7px 7px 0px 0px;
360
+ }
361
+
362
+ .title-font {
363
+ font-size: 21px;
364
+ color: #73665c;
365
+ line-height: 29px;
366
+ overflow: hidden;
367
+ white-space: nowrap;
368
+ text-overflow: ellipsis;
369
+ text-align: center;
370
+ }
371
+ .title-layout {
372
+ top: 221;
373
+ left: 13;
374
+ width: 193px;
375
+ height: 29px;
376
+ }
377
+ .ticket-text {
378
+ height: 24;
379
+ color: #ffffff;
380
+ font-size: 16px;
381
+ text-align: center;
382
+ line-height: 24px;
383
+ }
384
+ .sold-text {
385
+ height: 25px;
386
+ color: #ff7a00;
387
+ font-size: 20px;
388
+ text-align: center;
389
+ line-height: 25px;
390
+ }
391
+ .prize-title-layout {
392
+ width: 35px;
393
+ height: 24px;
394
+ top: 296;
395
+ left: 13;
396
+ }
397
+ .prize-title-font {
398
+ color: #de2825;
399
+ text-align: center;
400
+ font-size: 17px;
401
+ line-height: 24px;
402
+ }
403
+ .prize-font {
404
+ top: 289;
405
+ left: 53;
406
+ width: 158; /*213 - 55*/
407
+ height: 37px;
408
+ line-height: 37px;
409
+ font-size: 28px;
410
+ color: #de2825;
411
+ }
412
+ </style>
@@ -0,0 +1,117 @@
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: 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
+ },
45
+ methods: {
46
+ onKeyDown(ev) {
47
+ switch (ev.keyCode) {
48
+ case 37:
49
+ if (this.activeId == 1) {
50
+ this.activeId = 0;
51
+ this.onItemFocus(0);
52
+ }
53
+ break;
54
+ case 39:
55
+ if (this.activeId == 0) {
56
+ this.activeId = 1;
57
+ this.onItemFocus(1);
58
+ }
59
+ break;
60
+ case 40:
61
+ this.onEdgeDown();
62
+ break;
63
+ }
64
+ },
65
+ onFocus() {
66
+ this.focused = true;
67
+ },
68
+ onBlur() {
69
+ this.focused = false;
70
+ },
71
+ getOnAction() {
72
+ return {
73
+ onKeyDown: this.onKeyDown,
74
+ onFocus: this.onFocus,
75
+ onBlur: this.onBlur,
76
+ };
77
+ },
78
+ },
79
+ };
80
+ </script>
81
+
82
+ <template>
83
+ <jsv-focus-block :name="name" :onAction="getOnAction()"></jsv-focus-block>
84
+ <div :class="tab1Class">Tab1</div>
85
+ <div :class="tab2Class" :style="{ left: 220 }">Tab2</div>
86
+ </template>
87
+
88
+ <style scoped>
89
+ .text-normal {
90
+ width: 200px;
91
+ height: 50px;
92
+ line-height: 50px;
93
+ color: #444444;
94
+ font-size: 25px;
95
+ text-align: center;
96
+ }
97
+
98
+ .text-active {
99
+ width: 200px;
100
+ height: 50px;
101
+ line-height: 50px;
102
+ color: #ffffff;
103
+ font-size: 25px;
104
+ text-align: center;
105
+ }
106
+
107
+ .item-focused {
108
+ width: 200px;
109
+ height: 50px;
110
+ background-color: #008080;
111
+ }
112
+ .item-normal {
113
+ width: 200px;
114
+ height: 50px;
115
+ background-color: #87CECB;
116
+ }
117
+ </style>
@@ -0,0 +1,110 @@
1
+ // const data = [
2
+ // {
3
+ // blocks: {
4
+ // w: 200,
5
+ // h: 160
6
+ // },
7
+ // focusable: true,
8
+ // color: "#000022",
9
+ // content: 0
10
+ // },
11
+ // {
12
+ // blocks: {
13
+ // w: 200,
14
+ // h: 160
15
+ // },
16
+ // focusable: true,
17
+ // color: "#003300",
18
+ // content: 1
19
+ // },
20
+ // {
21
+ // blocks: {
22
+ // w: 200,
23
+ // h: 160
24
+ // },
25
+ // focusable: true,
26
+ // color: "#000044",
27
+ // content: 2
28
+ // },
29
+ // {
30
+ // blocks: {
31
+ // w: 400,
32
+ // h: 320
33
+ // },
34
+ // focusable: true,
35
+ // color: "#000055",
36
+ // content: 3
37
+ // },
38
+ // {
39
+ // blocks: {
40
+ // w: 200,
41
+ // h: 160
42
+ // },
43
+ // focusable: true,
44
+ // color: "#000066",
45
+ // content: 4
46
+ // },
47
+ // {
48
+ // blocks: {
49
+ // w: 200,
50
+ // h: 160
51
+ // },
52
+ // focusable: true,
53
+ // color: "#0000CD",
54
+ // content: 5
55
+ // },
56
+ // ];
57
+
58
+ // let content = 6;
59
+ // for (let i = 0; i < 10; i++) {
60
+ // data.push({
61
+ // blocks: {
62
+ // w: 200,
63
+ // h: 320
64
+ // },
65
+ // focusable: true,
66
+ // color: "#000022",
67
+ // content: content++
68
+ // });
69
+ // data.push({
70
+ // blocks: {
71
+ // w: 200,
72
+ // h: 160
73
+ // },
74
+ // focusable: true,
75
+ // color: "#003300",
76
+ // content: content++
77
+ // });
78
+ // }
79
+
80
+ let data1 = [];
81
+
82
+ // 添加300个模拟数据
83
+ for (let i = 0; i < 500; i++) {
84
+ data1.push({
85
+ index: i,
86
+ name: `商品:骆驼奶粉蛋白质粉,限时抢购,立刻发货,序号:${i}`,
87
+ prize: `${Math.floor(Math.random() * 200) +
88
+ 200}` /* 测试数据要保证比最高优惠券(300左右)要高 */,
89
+ savePrize: `${i}`,
90
+ soldTotal: `${Math.floor(Math.random() * 50000)}`,
91
+ pictUrl:
92
+ "http://img.alicdn.com/bao/uploaded/i3/2207313464483/O1CN01Ab4vWz1izGAyRL1Yf_!!0-item_pic.jpg",
93
+ });
94
+ }
95
+
96
+ let data2 = [];
97
+ for (let i = 0; i < 500; i++) {
98
+ data2.push({
99
+ index: i,
100
+ name: `商品:骆驼奶粉蛋白质粉,限时抢购,立刻发货,序号:${i}`,
101
+ prize: `${Math.floor(Math.random() * 200) +
102
+ 200}` /* 测试数据要保证比最高优惠券(300左右)要高 */,
103
+ savePrize: `${i}`,
104
+ soldTotal: `${Math.floor(Math.random() * 50000)}`,
105
+ pictUrl:
106
+ "http://img.alicdn.com/bao/uploaded/i3/2207313464483/O1CN01Ab4vWz1izGAyRL1Yf_!!0-item_pic.jpg",
107
+ });
108
+ }
109
+
110
+ export { data1, data2 };