@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,135 @@
1
+ <script>
2
+ import { Vue } from "vue-class-component";
3
+ import jpegDemo from "./jpegDemo.jpeg";
4
+ import pngDemo from "./pngDemo.png";
5
+ import pngNoAlphaDemo from "./pngNoAlphaDemo.png";
6
+ import bmpDemo from "./bmpDemo.bmp";
7
+
8
+ class App extends Vue {
9
+ constructor(props) {
10
+ super(props);
11
+
12
+ this.jpegDemo = jpegDemo;
13
+ this.pngDemo = pngDemo;
14
+ this.pngNoAlphaDemo = pngNoAlphaDemo;
15
+ this.bmpDemo = bmpDemo;
16
+ }
17
+
18
+ onKeyDown(ev) {
19
+ // 8:Backspace, 27:Escape, 10000:盒子返回键
20
+ if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
21
+ window.JsView?.setGlobalConfig({
22
+ texCache: -1,
23
+ });
24
+
25
+ this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
26
+ return true;
27
+ }
28
+
29
+ return false;
30
+ }
31
+ }
32
+ export default App;
33
+ </script>
34
+ <template>
35
+ <jsv-focus-block autoFocus :onKeyDown="onKeyDown">
36
+ <div class="allBgc">
37
+ <div class="block">
38
+ <div :style="{ left: 0, top: 0 }">
39
+ <div class="leftFont top0">
40
+ {{ `RBG_8888\n透明区域透明\n色彩不失真` }}
41
+ </div>
42
+ <div class="leftFont top250">
43
+ {{ `RBG_565\n透明区域为黑色\n色彩略失真` }}
44
+ </div>
45
+ </div>
46
+
47
+ <div :style="{ left: 220, top: 0 }">
48
+ <img class="graphSize top0" :src="bmpDemo" />
49
+ <img
50
+ class="graphSize top250"
51
+ jsvImgColorSpace="RGB_565"
52
+ :src="bmpDemo"
53
+ />
54
+ <div class="underFont">
55
+ {{ `bmp图片` }}
56
+ </div>
57
+ </div>
58
+
59
+ <div :style="{ left: 440, top: 0 }">
60
+ <img class="graphSize top0" :src="jpegDemo" />
61
+ <img
62
+ class="graphSize top250"
63
+ jsvImgColorSpace="RGB_565"
64
+ :src="jpegDemo"
65
+ />
66
+ <div class="underFont">
67
+ {{ "jpg/jpeg图片" }}
68
+ </div>
69
+ </div>
70
+
71
+ <div :style="{ left: 660, top: 0 }">
72
+ <img class="graphSize top0" :src="pngDemo" />
73
+ <img
74
+ class="graphSize top250"
75
+ jsvImgColorSpace="RGB_565"
76
+ :src="pngDemo"
77
+ />
78
+ <div class="underFont">
79
+ {{ `png有透明图片\nRGB_565下透明部分为黑色` }}
80
+ </div>
81
+ </div>
82
+
83
+ <div :style="{ left: 880, top: 0 }">
84
+ <img class="graphSize top0" :src="pngNoAlphaDemo" />
85
+ <img
86
+ class="graphSize top250"
87
+ jsvImgColorSpace="RGB_565"
88
+ :src="pngNoAlphaDemo"
89
+ />
90
+ <div class="underFont">
91
+ {{ `png无透明图片` }}
92
+ </div>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </jsv-focus-block>
97
+ </template>
98
+ <style scoped>
99
+ .allBgc {
100
+ width: 1920;
101
+ height: 1080;
102
+ background-color: #334c4c;
103
+ }
104
+ .block {
105
+ left: 20;
106
+ top: 50;
107
+ }
108
+ .leftFont {
109
+ left: 0;
110
+ width: 200;
111
+ height: 200;
112
+ color: #ffffff;
113
+ font-size: 30px;
114
+ }
115
+ .top0 {
116
+ top: 0;
117
+ }
118
+ .top250 {
119
+ top: 250;
120
+ }
121
+ .graphSize {
122
+ left: 0;
123
+ width: 200;
124
+ height: 200;
125
+ border-radius: 15px 15px 15px 15px;
126
+ }
127
+ .underFont {
128
+ left: 0;
129
+ top: 500;
130
+ width: 200;
131
+ height: 200;
132
+ color: #ffffff;
133
+ font-size: 20px;
134
+ }
135
+ </style>
Binary file
Binary file
Binary file
@@ -0,0 +1,31 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2021-06-02 13:31:00
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2021-10-14 17:21:34
6
+ * @Description: file content
7
+ -->
8
+ <script lang="ts">
9
+ import { Vue } from "vue-class-component";
10
+ import { router } from "./router.js";
11
+ import { jJsvRuntimeBridge } from "jsview/utils/JsViewVueTools/JsvRuntimeBridge";
12
+
13
+ class App extends Vue {
14
+ static Router = router;
15
+
16
+ mounted() {
17
+ jJsvRuntimeBridge.notifyPageLoaded();
18
+ }
19
+ }
20
+
21
+ export default App;
22
+ </script>
23
+
24
+ <template>
25
+ <div>
26
+ <router-view />
27
+ </div>
28
+ </template>
29
+
30
+ <style scoped>
31
+ </style>
@@ -0,0 +1,82 @@
1
+ <script>
2
+ import {
3
+ SimpleWidget,
4
+ VERTICAL,
5
+ } from "jsview/utils/JsViewEngineWidget";
6
+ import Item from "./Item.vue";
7
+
8
+ export default {
9
+ components: {
10
+ Item,
11
+ SimpleWidget,
12
+ },
13
+ props: {
14
+ data: Array,
15
+ name: String,
16
+ onEdge: Function,
17
+ },
18
+ setup() {
19
+ return {
20
+ direction: VERTICAL,
21
+ width: 1280,
22
+ height: 600,
23
+ initFoucsId: 0,
24
+ };
25
+ },
26
+ methods: {
27
+ measures(item) {
28
+ return {
29
+ width: item.width,
30
+ height: item.height,
31
+ focusable: item.focusable,
32
+ };
33
+ },
34
+ itemClick(index, data) {
35
+ if (!data.path) {
36
+ console.error("Route path is not defined.");
37
+ return;
38
+ }
39
+ this.$router.push(data.path);
40
+ localStorage.curFocusId = index;
41
+ },
42
+ },
43
+ beforeCreate() {
44
+ if (typeof localStorage.curFocusId !== "undefined") {
45
+ this.initFocusId = parseInt(localStorage.curFocusId);
46
+ }
47
+ localStorage.curFocusId = 0;
48
+ },
49
+ };
50
+ </script>
51
+
52
+ <template>
53
+ <simple-widget
54
+ :name="name"
55
+ :width="width"
56
+ :height="height"
57
+ :direction="direction"
58
+ :data="data"
59
+ :measures="measures"
60
+ :padding="{ left: 10, top: 10, right: 10, bottom: 10 }"
61
+ :onEdge="onEdge"
62
+ :initFocusId="initFocusId"
63
+ >
64
+ <template #renderItem="{ data, query, onEdge, onAction }">
65
+ <Item
66
+ :style="{
67
+ width: data.width,
68
+ height: data.height,
69
+ backgroundColor: data.backgroundColor,
70
+ color: '#000000',
71
+ }"
72
+ :data="data"
73
+ :query="query"
74
+ :onEdge="onEdge"
75
+ :onAction="onAction"
76
+ :itemClick="itemClick"
77
+ >
78
+ {{ data.name }}
79
+ </Item>
80
+ </template>
81
+ </simple-widget>
82
+ </template>
@@ -0,0 +1,94 @@
1
+ <script>
2
+ export default {
3
+ props: {
4
+ name: String,
5
+ onAction: Function,
6
+ },
7
+ data() {
8
+ return {
9
+ focusId: 0,
10
+ };
11
+ },
12
+ methods: {
13
+ onKeyDown(ev) {
14
+ switch (ev.keyCode) {
15
+ case 37:
16
+ if (this.focusId == 1) {
17
+ this.focusId = 0;
18
+ }
19
+ break;
20
+ case 39:
21
+ if (this.focusId == 0) {
22
+ this.focusId = 1;
23
+ }
24
+ break;
25
+ case 10000:
26
+ case 27:
27
+ this.onAction("back");
28
+ break;
29
+ case 13:
30
+ this.onAction(this.focusId == 0 ? "ok" : "cancel");
31
+ break;
32
+ default:
33
+ }
34
+ return true;
35
+ },
36
+ },
37
+ };
38
+ </script>
39
+
40
+ <template>
41
+ <jsv-focus-block
42
+ autoFocus
43
+ :name="name"
44
+ :onAction="{
45
+ onKeyDown: onKeyDown,
46
+ }"
47
+ >
48
+ <div :style="{ top: 200, left: 465 }">
49
+ <div class="background"></div>
50
+ <div class="message">是否退出</div>
51
+ <div :style="{ top: 120, left: 30 }">
52
+ <div v-if="focusId == 0" class="focus"></div>
53
+ <div class="normal">确定</div>
54
+ </div>
55
+ <div :style="{ top: 120, left: 220 }">
56
+ <div v-if="focusId == 1" class="focus"></div>
57
+ <div class="normal">取消</div>
58
+ </div>
59
+ </div>
60
+ </jsv-focus-block>
61
+ </template>
62
+
63
+ <style scoped>
64
+ .focus {
65
+ top: -5px;
66
+ left: -5px;
67
+ width: 100px;
68
+ height: 50px;
69
+ background-color: #0000ff;
70
+ }
71
+
72
+ .normal {
73
+ width: 90px;
74
+ height: 40px;
75
+ color: #ffffff;
76
+ text-align: center;
77
+ font-size: 30px;
78
+ }
79
+ .background {
80
+ left: 0px;
81
+ top: 0px;
82
+ width: 350px;
83
+ height: 200px;
84
+ background-color: rgba(0, 0, 0, 0.7);
85
+ }
86
+ .message {
87
+ top: 20px;
88
+ width: 350px;
89
+ height: 50px;
90
+ color: #ffffff;
91
+ font-size: 40px;
92
+ text-align: center;
93
+ }
94
+ </style>
@@ -0,0 +1,77 @@
1
+ <script>
2
+ export default {
3
+ props: {
4
+ style: Object,
5
+ itemClick: Function,
6
+ itemFocus: Function,
7
+ data: Object,
8
+ query: Object,
9
+ onEdge: Function,
10
+ onAction: Object,
11
+ },
12
+ data() {
13
+ return {
14
+ focused: false,
15
+ anim: "flip 1s",
16
+ };
17
+ },
18
+ computed: {
19
+ foucsStyle() {
20
+ return {
21
+ width: this.style.width,
22
+ height: this.style.height,
23
+ };
24
+ },
25
+ itemStyle() {
26
+ return {
27
+ width: this.style.width - 10,
28
+ height: this.style.height - 10,
29
+ backgroundColor: this.style.backgroundColor,
30
+ color: this.style.color,
31
+ };
32
+ },
33
+ },
34
+ methods: {
35
+ onFocus() {
36
+ this.focused = true;
37
+ if (this.itemFocus) {
38
+ this.itemFocus(this.data);
39
+ }
40
+ },
41
+ onBlur() {
42
+ this.focused = false;
43
+ },
44
+ onClick() {
45
+ if (this.itemClick) {
46
+ this?.itemClick(this.query.id, this.data);
47
+ }
48
+ },
49
+ },
50
+ created() {
51
+ this.onAction.register("onFocus", this.onFocus);
52
+ this.onAction.register("onBlur", this.onBlur);
53
+ this.onAction.register("onClick", this.onClick);
54
+ },
55
+ };
56
+ </script>
57
+
58
+ <template>
59
+ <div>
60
+ <div class="focus" :style="foucsStyle" v-if="focused" />
61
+ <div class="item" :style="itemStyle">
62
+ <slot></slot>
63
+ </div>
64
+ </div>
65
+ </template>
66
+
67
+ <style scoped>
68
+ .focus {
69
+ top: -5;
70
+ left: -5;
71
+ background-color: #0000ff;
72
+ }
73
+ .item {
74
+ text-align: center;
75
+ font-size: 30;
76
+ }
77
+ </style>
@@ -0,0 +1,86 @@
1
+ <script>
2
+ import {
3
+ SimpleWidget,
4
+ VERTICAL,
5
+ } from "jsview/utils/JsViewEngineWidget";
6
+ import Item from "./Item.vue";
7
+
8
+ const measures = (item) => {
9
+ return {
10
+ width: item.width,
11
+ height: item.height,
12
+ focusable: item.focusable,
13
+ };
14
+ };
15
+
16
+ export default {
17
+ components: {
18
+ SimpleWidget,
19
+ Item,
20
+ },
21
+ props: {
22
+ name: String,
23
+ itemFocus: Function,
24
+ onEdge: Function,
25
+ },
26
+ setup() {
27
+ const width = 1280;
28
+ const height = 100;
29
+ const data = [
30
+ {
31
+ width: 200,
32
+ height: 50,
33
+ name: "功能实例",
34
+ focusable: true,
35
+ id: 0,
36
+ },
37
+ {
38
+ width: 200,
39
+ height: 50,
40
+ name: "场景实例",
41
+ focusable: true,
42
+ id: 1,
43
+ },
44
+ ];
45
+ const direction = VERTICAL;
46
+ return {
47
+ width,
48
+ height,
49
+ data,
50
+ direction,
51
+ measures,
52
+ };
53
+ },
54
+ };
55
+ </script>
56
+
57
+ <template>
58
+ <simple-widget
59
+ :name="name"
60
+ :width="width"
61
+ :height="height"
62
+ :direction="direction"
63
+ :data="data"
64
+ :measures="measures"
65
+ :padding="{ left: 10, top: 10, right: 10, bottom: 10 }"
66
+ :onEdge="onEdge"
67
+ >
68
+ <template #renderItem="{ data, query, onEdge, onAction }">
69
+ <Item
70
+ :style="{
71
+ width: data.width,
72
+ height: data.height,
73
+ backgroundColor: '#00AA00',
74
+ color: '#FFFFFF',
75
+ }"
76
+ :data="data"
77
+ :query="query"
78
+ :onEdge="onEdge"
79
+ :onAction="onAction"
80
+ :itemFocus="itemFocus"
81
+ >
82
+ {{ data.name }}
83
+ </Item>
84
+ </template>
85
+ </simple-widget>
86
+ </template>
@@ -0,0 +1,132 @@
1
+ import { createRouter } from "vue-router";
2
+ import { createJsvHashHistory } from "jsview/utils/JsViewVueTools/JsvHashHistory";
3
+
4
+ const routeList = [
5
+ // 功能实例
6
+ {
7
+ name: "Home",
8
+ path: "/",
9
+ component: () => import("./views/Homepage"),
10
+ },
11
+ {
12
+ name: "基础示例合集",
13
+ path: "/feature/Basic",
14
+ component: () => import("jsview/samples/Basic/App"),
15
+ },
16
+ {
17
+ name: "SimpleWidget",
18
+ path: "/feature/SimpleWidgetDemo",
19
+ component: () => import("jsview/samples/SimpleWidgetDemo/App"),
20
+ },
21
+ {
22
+ name: "SimpleWidget(进阶)",
23
+ path: "/feature/AdvanceMetroWidget",
24
+ component: () => import("jsview/samples/AdvanceMetroWidget/App"),
25
+ },
26
+ {
27
+ name: "视频",
28
+ path: "/feature/VideoDemo",
29
+ component: () => import("jsview/samples/VideoDemo/App"),
30
+ },
31
+ {
32
+ name: "焦点切换demo",
33
+ path: "/feature/BasicFocusControl",
34
+ component: () => import("jsview/samples/BasicFocusControl/App"),
35
+ },
36
+ {
37
+ name: "Hash方式路由切换",
38
+ path: "/feature/HashHistory",
39
+ props: { routePath: "/feature/HashHistory" },
40
+ component: () => import("jsview/samples/HashHistory/App"),
41
+ },
42
+ //TODO MetroPage未完成
43
+ // {
44
+ // name: "ClassName写法样例",
45
+ // path: "/feature/ClassNameDemo",
46
+ // component: () => import("jsview/samples/ClassNameDemo/App"),
47
+ // },
48
+ {
49
+ name: "翻牌游戏",
50
+ path: "/feature/FlipCard",
51
+ component: () => import("jsview/samples/FlipCard/App"),
52
+ },
53
+ {
54
+ name: "设置颜色空间",
55
+ path: "/feature/ColorSpace",
56
+ component: () => import("jsview/samples/ColorSpace/App"),
57
+ },
58
+ {
59
+ name: "制定Texture尺寸",
60
+ path: "/feature/TextureSize",
61
+ component: () => import("jsview/samples/TextureSize/App"),
62
+ },
63
+ {
64
+ name: "橱窗",
65
+ path: "/feature/FlowMultiWidget",
66
+ component: () => import("jsview/samples/FlowMultiWidget/App"),
67
+ },
68
+ {
69
+ name: "动图",
70
+ path: "/feature/AnimPicture",
71
+ component: () => import("jsview/samples/AnimPicture/App"),
72
+ },
73
+ {
74
+ name: "粒子效果",
75
+ path: "/feature/SprayView",
76
+ component: () => import("jsview/samples/SprayView/App"),
77
+ },
78
+ //TODO 代码需要优化
79
+ {
80
+ name: "长文字",
81
+ path: "/feature/LongText",
82
+ component: () => import("jsview/samples/LongText/App"),
83
+ },
84
+ //TODO 代码需要优化
85
+ {
86
+ name: "长图片",
87
+ path: "/feature/LongImage",
88
+ component: () => import("jsview/samples/LongImage/App"),
89
+ },
90
+ {
91
+ name: "二维码",
92
+ path: "/feature/QrcodeDemo",
93
+ component: () => import("jsview/samples/QrcodeDemo/App"),
94
+ },
95
+ {
96
+ name: "文字阴影",
97
+ path: "/feature/TextShadowDemo",
98
+ component: () => import("jsview/samples/TextShadowDemo/App"),
99
+ },
100
+ {
101
+ name: "多行文字区域内对齐",
102
+ path: "/feature/TextBox",
103
+ component: () => import("jsview/samples/TextBox/App"),
104
+ },
105
+ {
106
+ name: "抛物运动写法样例",
107
+ path: "/feature/ThrowMoveDemo",
108
+ component: () => import("jsview/samples/ThrowMoveDemo/App"),
109
+ },
110
+ {
111
+ name: "精灵图",
112
+ path: "/feature/SpriteImage",
113
+ component: () => import("jsview/samples/SpriteImage/App"),
114
+ },
115
+
116
+ // 场景实例
117
+ {
118
+ name: "直播间(TBD)",
119
+ path: "/scene/LiveRoom",
120
+ // component: () => import("jsview/samples/Basic/App"),
121
+ },
122
+ ];
123
+
124
+ const router = createRouter({
125
+ // 浏览器调试和盒子上都可以使用类WebHashHistory的createJsvHashHistory(推荐)
126
+ // 或 createMemoryHistory;
127
+ // createWebHashHistory只能用于浏览器调试,盒子不支持
128
+ history: createJsvHashHistory(),
129
+ routes: routeList,
130
+ });
131
+
132
+ export { router, routeList };