@shijiu/jsview-vue 0.9.502 → 0.9.590

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 (215) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/target_core_revision.js +4 -3
  4. package/index.js +10 -0
  5. package/package.json +8 -1
  6. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +16 -5
  7. package/samples/AnimPicture/App.vue +89 -106
  8. package/samples/Basic/App.vue +65 -68
  9. package/samples/Basic/components/ContentBlock.vue +31 -36
  10. package/samples/Basic/components/anim/AnimGroup.vue +61 -75
  11. package/samples/Basic/components/anim/AnimKeyframeBasic.vue +54 -43
  12. package/samples/Basic/components/anim/AnimKeyframeComposite.vue +25 -31
  13. package/samples/Basic/components/anim/AnimTransition.vue +142 -105
  14. package/samples/Basic/components/div/DivBackground.vue +38 -16
  15. package/samples/Basic/components/div/DivClip.vue +143 -78
  16. package/samples/Basic/components/div/DivCssScoped.vue +10 -10
  17. package/samples/Basic/components/div/DivCssVar.vue +40 -42
  18. package/samples/Basic/components/div/DivGroup1.vue +45 -39
  19. package/samples/Basic/components/div/DivGroup2.vue +56 -45
  20. package/samples/Basic/components/div/DivLayout.vue +34 -5
  21. package/samples/Basic/components/div/DivRadius.vue +51 -42
  22. package/samples/Basic/components/div/DivTransform.vue +21 -16
  23. package/samples/Basic/components/panel/Panel1.vue +46 -44
  24. package/samples/Basic/components/panel/Panel2.vue +22 -26
  25. package/samples/Basic/components/panel/TitleBar.vue +12 -12
  26. package/samples/Basic/components/text/TextAlign.vue +54 -44
  27. package/samples/Basic/components/text/TextEmoji.vue +16 -20
  28. package/samples/Basic/components/text/TextFontStyle.vue +77 -53
  29. package/samples/Basic/components/text/TextGroup1.vue +46 -38
  30. package/samples/Basic/components/text/TextGroup2.vue +25 -28
  31. package/samples/Basic/components/text/TextOverflow.vue +76 -57
  32. package/samples/BasicFocusControl/App.vue +22 -43
  33. package/samples/BasicFocusControl/components/BaseBlock.vue +42 -43
  34. package/samples/BasicFocusControl/components/MainArea.vue +55 -70
  35. package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +11 -15
  36. package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +21 -24
  37. package/samples/BasicFocusControl/components/SideBar.vue +32 -47
  38. package/samples/BasicFocusControl/components/SideBarBlock.vue +20 -23
  39. package/samples/ColorSpace/App.vue +15 -24
  40. package/samples/DemoHomepage/App.vue +7 -11
  41. package/samples/DemoHomepage/components/BodyFrame.vue +19 -9
  42. package/samples/DemoHomepage/components/TabFrame.vue +7 -8
  43. package/samples/DemoHomepage/router.js +32 -33
  44. package/samples/DemoHomepage/views/Homepage.vue +24 -8
  45. package/samples/FilterDemo/AnimatePic.vue +58 -0
  46. package/samples/FilterDemo/App.vue +99 -61
  47. package/samples/FilterDemo/VideoLayer.vue +62 -0
  48. package/samples/FlipCard/App.vue +32 -41
  49. package/samples/FlipCard/FlipCard.vue +48 -54
  50. package/samples/GridDemo/App.vue +109 -77
  51. package/samples/GridDemo/ButtonBlock.vue +50 -49
  52. package/samples/GridDemo/FocusItem.vue +19 -38
  53. package/samples/GridDemo/Item.vue +46 -54
  54. package/samples/HashHistory/App.vue +63 -79
  55. package/samples/HashHistory/components/HorizontalButtonList.vue +72 -95
  56. package/samples/HashHistory/components/Item.vue +42 -56
  57. package/samples/HashHistory/router.js +23 -12
  58. package/samples/HashHistory/views/MainPage.vue +35 -46
  59. package/samples/HashHistory/views/SubPage.vue +34 -47
  60. package/samples/Input/App.vue +2 -3
  61. package/samples/Input/FullKeyboard.vue +2 -6
  62. package/samples/Input/InputPanel.vue +2 -3
  63. package/samples/Input/KeyboardItem.vue +1 -1
  64. package/samples/LongImage/App.vue +11 -27
  65. package/samples/LongImage/Button.vue +50 -145
  66. package/samples/LongImage/ButtonItem.vue +44 -0
  67. package/samples/LongImage/LongImageScroll.vue +71 -106
  68. package/samples/LongImage/Scroll.vue +7 -9
  69. package/samples/LongText/App.vue +13 -28
  70. package/samples/LongText/Button.vue +43 -145
  71. package/samples/LongText/ButtonItem.vue +44 -0
  72. package/samples/LongText/LongTextScroll.vue +68 -101
  73. package/samples/LongText/Scroll.vue +7 -9
  74. package/samples/Marquee/App.vue +34 -37
  75. package/samples/MaskClip/App.vue +17 -30
  76. package/samples/MetroWidgetDemos/Advanced/App.vue +211 -0
  77. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
  78. package/samples/MetroWidgetDemos/Item.vue +67 -0
  79. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/App.vue +80 -104
  80. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/Item.vue +7 -0
  81. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/bg.jpg +0 -0
  82. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_content.png +0 -0
  83. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_left.png +0 -0
  84. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_mid.png +0 -0
  85. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_right.png +0 -0
  86. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/focus_border.png +0 -0
  87. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/holder_logo.png +0 -0
  88. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/jrbm.png +0 -0
  89. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_left.png +0 -0
  90. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_mid.png +0 -0
  91. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_right.png +0 -0
  92. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/loading.png +0 -0
  93. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/logo.png +0 -0
  94. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/mcjx.png +0 -0
  95. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tao.png +0 -0
  96. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tmall.png +0 -0
  97. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/border.png +0 -0
  98. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/ContentItem.vue +60 -86
  99. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/MyTab.vue +0 -0
  100. package/samples/MetroWidgetDemos/PerformanceTest/data.js +45 -0
  101. package/samples/MetroWidgetDemos/PingPong/App.vue +135 -0
  102. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +58 -0
  103. package/samples/MetroWidgetDemos/PingPong/AppTab.vue +69 -0
  104. package/samples/MetroWidgetDemos/PingPong/Item.vue +92 -0
  105. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
  106. package/samples/MetroWidgetDemos/Simple/App.vue +194 -0
  107. package/samples/MetroWidgetDemos/WidgetItem.vue +89 -0
  108. package/samples/MetroWidgetDemos/data.js +204 -0
  109. package/samples/NinePatchDemo/App.vue +114 -115
  110. package/samples/NinePatchDemo/Item.vue +7 -8
  111. package/samples/Preload/App.vue +61 -63
  112. package/samples/Preload/Item.vue +21 -29
  113. package/samples/QrcodeDemo/App.vue +24 -29
  114. package/samples/SoundPool/App.vue +77 -106
  115. package/samples/SprayView/App.vue +10 -8
  116. package/samples/SpriteImage/App.vue +1 -2
  117. package/samples/TextBox/App.vue +86 -101
  118. package/samples/TextBox/RenderCenter.vue +1 -1
  119. package/samples/TextBox/RenderLeft.vue +1 -1
  120. package/samples/TextBox/RenderOneLine.vue +1 -1
  121. package/samples/TextBox/RenderRight.vue +1 -1
  122. package/samples/TextShadowDemo/App.vue +1 -2
  123. package/samples/TextureAnimation/App.vue +16 -13
  124. package/samples/TextureSize/App.vue +15 -25
  125. package/samples/ThrowMoveDemo/AccelerateDemo.vue +2 -4
  126. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +2 -3
  127. package/samples/ThrowMoveDemo/TargetDemo.vue +3 -4
  128. package/samples/ThrowMoveDemo/UDParabolicDemo.vue +2 -3
  129. package/samples/TouchSample/App.vue +2 -3
  130. package/samples/TouchSample/Item.vue +15 -13
  131. package/samples/TouchSample/MetroWidgetHorizontal.vue +2 -2
  132. package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
  133. package/samples/TouchSample/TouchContainerHorizontal.vue +4 -3
  134. package/samples/TouchSample/TouchContainerVertical.vue +3 -2
  135. package/samples/TransitPage/App.vue +20 -32
  136. package/samples/VideoDemo/App.vue +65 -81
  137. package/samples/VideoDemo/components/Button.vue +41 -52
  138. package/samples/VideoDemo/components/Controllor.vue +171 -169
  139. package/samples/VideoDemo/components/VideoFrame.vue +87 -99
  140. package/samples/VisibleSensorDemo/App.vue +167 -0
  141. package/scripts/jsview-jsmap-serve.js +42 -0
  142. package/scripts/jsview-post-install.js +1 -1
  143. package/tsconfig.json +3 -0
  144. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +204 -193
  145. package/utils/JsViewEngineWidget/JsvFocusManager.js +30 -17
  146. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1555 -1656
  147. package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.js +136 -0
  148. package/utils/JsViewEngineWidget/MetroWidget/ToolFunctions.js +18 -0
  149. package/utils/JsViewEngineWidget/TemplateParser.js +111 -1
  150. package/utils/JsViewEngineWidget/WidgetCommon.js +8 -2
  151. package/utils/JsViewEngineWidget/index.js +4 -4
  152. package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +1 -1
  153. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +264 -54
  154. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +5 -1
  155. package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
  156. package/utils/JsViewVueTools/JsvRefTaker.js +35 -0
  157. package/utils/JsViewVueTools/index.js +19 -0
  158. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +8 -4
  159. package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
  160. package/utils/JsViewVueWidget/JsvGrid.vue +139 -41
  161. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -1
  162. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +8 -17
  163. package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -1
  164. package/utils/JsViewVueWidget/JsvPosterDiv.vue +37 -7
  165. package/utils/JsViewVueWidget/JsvPosterImage.vue +34 -13
  166. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -12
  167. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
  168. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -10
  169. package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -3
  170. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +25 -21
  171. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +7 -8
  172. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +141 -0
  173. package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +9 -0
  174. package/utils/JsViewVueWidget/index.js +42 -0
  175. package/samples/AdvanceMetroWidget/App.vue +0 -123
  176. package/samples/AdvanceMetroWidget/Frame.vue +0 -102
  177. package/samples/AdvanceMetroWidget/Item.vue +0 -63
  178. package/samples/AdvanceMetroWidget/data.js +0 -137
  179. package/samples/ClassNameDemo/App.vue +0 -119
  180. package/samples/ClassNameDemo/components/ContentItem.vue +0 -253
  181. package/samples/ClassNameDemo/components/LoadingView.vue +0 -43
  182. package/samples/ClassNameDemo/components/TitleView.vue +0 -24
  183. package/samples/ClassNameDemo/data.js +0 -24
  184. package/samples/FlowMultiWidget/App.vue +0 -91
  185. package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
  186. package/samples/FlowMultiWidget/components/Block.vue +0 -107
  187. package/samples/FlowMultiWidget/components/FlowPage.vue +0 -60
  188. package/samples/FlowMultiWidget/components/Item.vue +0 -103
  189. package/samples/FlowMultiWidget/components/MenuItem.vue +0 -72
  190. package/samples/FlowMultiWidget/components/MyMenu.vue +0 -90
  191. package/samples/FlowMultiWidget/data.js +0 -446
  192. package/samples/HashHistory/views/BasePage.vue +0 -19
  193. package/samples/HashHistory/views/SubPageFirst.vue +0 -10
  194. package/samples/HashHistory/views/SubPageSecond.vue +0 -10
  195. package/samples/SimpleWidgetDemo/assets/bg.jpg +0 -0
  196. package/samples/SimpleWidgetDemo/assets/coupon_content.png +0 -0
  197. package/samples/SimpleWidgetDemo/assets/coupon_left.png +0 -0
  198. package/samples/SimpleWidgetDemo/assets/coupon_mid.png +0 -0
  199. package/samples/SimpleWidgetDemo/assets/coupon_right.png +0 -0
  200. package/samples/SimpleWidgetDemo/assets/focus_border.png +0 -0
  201. package/samples/SimpleWidgetDemo/assets/holder_logo.png +0 -0
  202. package/samples/SimpleWidgetDemo/assets/jrbm.png +0 -0
  203. package/samples/SimpleWidgetDemo/assets/line_left.png +0 -0
  204. package/samples/SimpleWidgetDemo/assets/line_mid.png +0 -0
  205. package/samples/SimpleWidgetDemo/assets/line_right.png +0 -0
  206. package/samples/SimpleWidgetDemo/assets/loading.png +0 -0
  207. package/samples/SimpleWidgetDemo/assets/logo.png +0 -0
  208. package/samples/SimpleWidgetDemo/assets/mcjx.png +0 -0
  209. package/samples/SimpleWidgetDemo/assets/tao.png +0 -0
  210. package/samples/SimpleWidgetDemo/assets/tmall.png +0 -0
  211. package/samples/SimpleWidgetDemo/data.js +0 -124
  212. package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +0 -63
  213. package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +0 -51
  214. package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +0 -213
  215. package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +0 -154
@@ -2,16 +2,15 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-04-10 21:20:39
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-04-11 09:51:24
5
+ * @LastEditTime: 2022-07-08 14:12:05
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import JsvTouchContainer from "jsview/utils/JsViewVueWidget/JsvTouchContainer.vue";
10
9
  import MetroWidgetHorizontal from "./MetroWidgetHorizontal.vue";
11
10
  import MetroWidgetVertical from "./MetroWidgetVertical.vue";
12
11
  import TouchContainerHorizontal from "./TouchContainerHorizontal.vue";
13
12
  import TouchContainerVertical from "./TouchContainerVertical.vue";
14
- import { jJsvRuntimeBridge } from "jsview/utils/JsViewVueTools/JsvRuntimeBridge";
13
+ import { jJsvRuntimeBridge, JsvTouchContainer } from "jsview";
15
14
 
16
15
  export default {
17
16
  components: {
@@ -6,7 +6,7 @@
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import { getPositionRelativeToView } from "jsview/utils/JsViewEngineWidget";
9
+ import { getPositionRelativeToView } from "jsview";
10
10
  function randomColor() {
11
11
  let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
12
12
  return (
@@ -29,7 +29,7 @@ export default {
29
29
  setup() {
30
30
  return {
31
31
  randomColor,
32
- }
32
+ };
33
33
  },
34
34
  computed: {
35
35
  style() {
@@ -44,7 +44,7 @@ export default {
44
44
  methods: {
45
45
  onFocus() {
46
46
  this.focused = true;
47
- console.log("cchtest item onfocus", this.data)
47
+ console.log("cchtest item onfocus", this.data);
48
48
  },
49
49
 
50
50
  onBlur() {
@@ -53,7 +53,7 @@ export default {
53
53
 
54
54
  onClick() {
55
55
  console.log(`item ${this.query.id} clicked`);
56
- }
56
+ },
57
57
  },
58
58
  created() {
59
59
  // console.log("cchtest item created", this.data.content)
@@ -69,7 +69,7 @@ export default {
69
69
  },
70
70
  updated() {
71
71
  // console.log("cchtest item update", this.data.content)
72
- }
72
+ },
73
73
  };
74
74
  </script>
75
75
 
@@ -77,18 +77,20 @@ export default {
77
77
  <div ref="element" :class="focused ? 'focus' : 'blur'" :style="style">
78
78
  {{ data.content }}
79
79
  </div>
80
- <div :style="{
81
- left: data.width/2,
82
- top: data.height/2,
83
- width: 10,
84
- height: 10,
85
- backgroundColor: focused ? '#000000' : '#FF0000'
86
- }"/>
80
+ <div
81
+ :style="{
82
+ left: data.width / 2,
83
+ top: data.height / 2,
84
+ width: 10,
85
+ height: 10,
86
+ backgroundColor: focused ? '#000000' : '#FF0000',
87
+ }"
88
+ />
87
89
  </template>
88
90
 
89
91
  <style scoped>
90
92
  .focus {
91
- transform: scale3d(1.0, 1.0, 1);
93
+ transform: scale3d(1, 1, 1);
92
94
  transition: transform 0.25s linear;
93
95
  font-size: 30px;
94
96
  }
@@ -5,7 +5,7 @@ import {
5
5
  WholePageSlide,
6
6
  SeamlessSlide,
7
7
  FixPositionSlide,
8
- } from "jsview/utils/JsViewEngineWidget";
8
+ } from "jsview";
9
9
 
10
10
  import Item from "./Item.vue";
11
11
 
@@ -51,7 +51,7 @@ export default {
51
51
 
52
52
  <template>
53
53
  <div class="rootSize">
54
- <div :style="{ width: 1280, height: 720, left: 50, }">
54
+ <div :style="{ width: 1280, height: 720, left: 50 }">
55
55
  <div
56
56
  :style="{
57
57
  top: 0,
@@ -5,7 +5,7 @@ import {
5
5
  WholePageSlide,
6
6
  SeamlessSlide,
7
7
  FixPositionSlide,
8
- } from "jsview/utils/JsViewEngineWidget";
8
+ } from "jsview";
9
9
 
10
10
  import Item from "./Item.vue";
11
11
 
@@ -2,15 +2,16 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-04-10 21:21:02
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-04-11 10:05:35
5
+ * @LastEditTime: 2022-07-08 14:40:19
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import JsvTouchContainer, {
9
+ import {
10
+ JsvTouchContainer,
10
11
  DIRECTION_VERTICAL,
11
12
  DIRECTION_HORIZONTAL,
12
13
  DIRECTION_DISABLE,
13
- } from "jsview/utils/JsViewVueWidget/JsvTouchContainer.vue";
14
+ } from "jsview";
14
15
  import { touchContainerH, measures } from "./data.js";
15
16
  function randomColor() {
16
17
  let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
@@ -6,11 +6,12 @@
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import JsvTouchContainer, {
9
+ import {
10
+ JsvTouchContainer,
10
11
  DIRECTION_VERTICAL,
11
12
  DIRECTION_HORIZONTAL,
12
13
  DIRECTION_DISABLE,
13
- } from "jsview/utils/JsViewVueWidget/JsvTouchContainer.vue";
14
+ } from "jsview";
14
15
  import { touchContainerV, measures } from "./data.js";
15
16
  function randomColor() {
16
17
  let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
@@ -1,41 +1,29 @@
1
- <script>
2
- import { Options, Vue } from "vue-class-component";
3
- import DemoApp from "../DemoHomepage/App.vue"
4
- import ActivityApp from "../SimpleWidgetDemo/App.vue" // TODO
5
- import { jJsvRuntimeBridge } from "jsview/utils/JsViewVueTools/JsvRuntimeBridge";
1
+ <script setup>
2
+ import DemoApp from "../DemoHomepage/App.vue";
3
+ import ActivityApp from "../MetroWidgetDemos/PerformanceTest/App.vue"; // TODO
4
+ import { jJsvRuntimeBridge } from "jsview";
5
+ import { ref, onMounted } from "vue";
6
6
 
7
- @Options({
8
- components: {
9
- DemoApp, ActivityApp,
10
- }
11
- })
12
- class TransitPage extends Vue {
13
- constructor(props) {
14
- super(props);
15
- this.showMode = TransitPage.getShowMode()
16
- }
17
- mounted() {
18
- jJsvRuntimeBridge.notifyPageLoaded();
7
+ const getShowMode = () => {
8
+ let showMode = 0;
9
+ // showMode信息可被URL中的?后缀信息替换
10
+ if (window.location.search.indexOf("showMode=0") >= 0) {
11
+ showMode = 0;
12
+ } else if (window.location.search.indexOf("showMode=1") >= 0) {
13
+ showMode = 1;
19
14
  }
20
15
 
21
- static getShowMode() {
22
- let showMode = 0
23
- // showMode信息可被URL中的?后缀信息替换
24
- if (window.location.search.indexOf("showMode=0") >= 0) {
25
- showMode = 0;
26
- } else if (window.location.search.indexOf("showMode=1") >= 0) {
27
- showMode = 1;
28
- }
16
+ return showMode;
17
+ };
29
18
 
30
- return showMode;
31
- }
32
- }
33
- TransitPage.Router = TransitPage.getShowMode() == 0 ? DemoApp.Router : ActivityApp.Router;
19
+ const showMode = ref(getShowMode());
34
20
 
35
- export default TransitPage;
21
+ onMounted(() => {
22
+ jJsvRuntimeBridge.notifyPageLoaded();
23
+ });
36
24
  </script>
37
25
 
38
26
  <template>
39
- <DemoApp v-if="showMode === 0" />
40
- <ActivityApp v-else-if="showMode === 1"/>
27
+ <DemoApp v-if="showMode === 0" />
28
+ <ActivityApp v-else-if="showMode === 1" />
41
29
  </template>
@@ -1,93 +1,78 @@
1
- <script>
2
- import { provide, reactive, ref, watch } from 'vue'
3
- import { Options, Vue } from "vue-class-component";
1
+ <script setup>
2
+ import { provide, reactive, ref, watch } from "vue";
4
3
  import Controllor from "./components/Controllor";
5
4
  import VideoFrame from "./components/VideoFrame";
6
5
 
7
- @Options({
8
- components: {
9
- Controllor,
10
- VideoFrame,
11
- },
12
- })
6
+ const Caption = {
7
+ offscreenVideo:
8
+ "名称:OffscreenVideo(自动播放)\n" +
9
+ "功能描述:\n" +
10
+ "1.离屏视频播放、支持前进/后退控制\n" +
11
+ "2.支持圆角设置\n" +
12
+ "3.支持平移、缩放、旋转等动画\n" +
13
+ "4.支持ObjectFit调整\n",
14
+ normalVideo:
15
+ "名称:Video\n" +
16
+ "功能描述:\n" +
17
+ "1.视频播放、支持前进/后退控制\n" +
18
+ "2.支持ObjectFit调整\n",
19
+ };
13
20
 
14
- class App extends Vue {
15
- constructor(props) {
16
- super(props);
17
- this.caption = null;
18
- this.useTexture = ref(null);
19
- this.videoTime = reactive({
20
- currentTime: 0,
21
- duration: 0,
22
- })
23
- this.objectFitTitle = ref(null);
24
- this.playStatus = ref('');
25
- provide('useTexture', this.useTexture)
26
- provide('objectFit', ref(null))
27
- provide('videoRect', ref({}))
28
- provide('playVideo', ref(null))
29
- provide('seekVideo', ref(null))
30
- provide('enableAnimation', ref(null))
31
- provide('videoTime', this.videoTime)
32
- provide('objectFitTitle', this.objectFitTitle)
33
- provide('playStatus', this.playStatus)
34
- watch(this.useTexture, () => {
35
- this.caption = (this.useTexture ? App.Caption.offscreenVideo : App.Caption.normalVideo);
36
- });
37
- }
38
- }
39
- App.Caption = {
40
- offscreenVideo: "名称:OffscreenVideo(自动播放)\n"
41
- + "功能描述:\n"
42
- + "1.离屏视频播放、支持前进/后退控制\n"
43
- + "2.支持圆角设置\n"
44
- + "3.支持平移、缩放、旋转等动画\n"
45
- + "4.支持ObjectFit调整\n",
46
- normalVideo: "名称:Video\n"
47
- + "功能描述:\n"
48
- + "1.视频播放、支持前进/后退控制\n"
49
- + "2.支持ObjectFit调整\n",
50
- }
51
-
52
- export default App;
21
+ let caption = ref(null);
22
+ let useTexture = ref(null);
23
+ let videoTime = reactive({
24
+ currentTime: 0,
25
+ duration: 0,
26
+ });
27
+ let objectFitTitle = ref(null);
28
+ let playStatus = ref("");
29
+ provide("useTexture", useTexture);
30
+ provide("objectFit", ref(null));
31
+ provide("videoRect", ref({}));
32
+ provide("playVideo", ref(null));
33
+ provide("seekVideo", ref(null));
34
+ provide("enableAnimation", ref(null));
35
+ provide("videoTime", videoTime);
36
+ provide("objectFitTitle", objectFitTitle);
37
+ provide("playStatus", playStatus);
38
+ watch(useTexture, () => {
39
+ caption.value = useTexture.value ? Caption.offscreenVideo : Caption.normalVideo;
40
+ });
53
41
  </script>
54
42
 
55
43
  <template>
56
- <div
44
+ <div
57
45
  :style="{
58
- top: 0, left: 0,
59
- width: 1280, height: 720,
60
- backgroundColor: 'rgb(222,211,140)'
46
+ top: 0,
47
+ left: 0,
48
+ width: 1280,
49
+ height: 720,
50
+ backgroundColor: 'rgb(222,211,140)',
61
51
  }"
62
- >
63
- <!-- :key="useTexture" => 当useTexture属性变化时,重建VideoFrame -->
64
- <VideoFrame
65
- :key="useTexture"
66
- />
67
-
68
- <!-- :key="useTexture" => JsView bug,当useTexture属性变化时,为了保证显示在VideoFrame前面 -->
69
- <div
70
- class="caption"
71
- :key="useTexture"
72
52
  >
73
- {{ caption }}
74
- </div>
75
- <div>
76
- <div class="text status">
77
- {{ '播放状态: ' + playStatus }}
78
- </div>
79
- <div class="text objectFit">
80
- {{ objectFitTitle }}
81
- </div>
82
- <div class="text current">
83
- {{ Math.ceil(videoTime.currentTime) }}
53
+ <!-- :key="useTexture" => 当useTexture属性变化时,重建VideoFrame -->
54
+ <VideoFrame :key="useTexture" />
55
+
56
+ <!-- :key="useTexture" => JsView bug,当useTexture属性变化时,为了保证显示在VideoFrame前面 -->
57
+ <div class="caption" :key="useTexture">
58
+ {{ caption }}
84
59
  </div>
85
- <div class="text duration">
86
- {{ '/' + Math.ceil(videoTime.duration) }}
60
+ <div>
61
+ <div class="text status">
62
+ {{ "播放状态: " + playStatus }}
63
+ </div>
64
+ <div class="text objectFit">
65
+ {{ objectFitTitle }}
66
+ </div>
67
+ <div class="text current">
68
+ {{ Math.ceil(videoTime.currentTime) }}
69
+ </div>
70
+ <div class="text duration">
71
+ {{ "/" + Math.ceil(videoTime.duration) }}
72
+ </div>
87
73
  </div>
74
+ <Controllor class="controllor" />
88
75
  </div>
89
- <Controllor class="controllor"/>
90
- </div>
91
76
  </template>
92
77
 
93
78
  <style scoped>
@@ -95,16 +80,16 @@ export default App;
95
80
  text-align: left;
96
81
  font-size: 24px;
97
82
  line-height: 30px;
98
- color: #FFFFFF;
83
+ color: #ffffff;
99
84
  left: 10;
100
85
  top: 10;
101
86
  width: 400;
102
87
  height: 180;
103
- background-color: rgba(27,38,151,0.8);
88
+ background-color: rgba(27, 38, 151, 0.8);
104
89
  }
105
90
 
106
91
  .text {
107
- color: #FF0000;
92
+ color: #ff0000;
108
93
  font-size: 24px;
109
94
  top: 550;
110
95
  width: 60;
@@ -133,5 +118,4 @@ export default App;
133
118
  left: 40;
134
119
  top: 600;
135
120
  }
136
-
137
121
  </style>
@@ -1,63 +1,52 @@
1
- <script>
2
- import { Options, Vue } from "vue-class-component";
3
-
4
- @Options({
5
- props: {
6
- style: Object,
7
- autoFocus: Boolean,
8
- name: String,
9
- onClick: Function,
10
- }
11
- })
12
-
13
- class Button extends Vue {
14
- constructor(props) {
15
- super(props);
16
-
17
- this.hasFocused = false;
18
- }
19
-
20
- onFocus() {
21
- this.hasFocused = true;
22
- }
23
-
24
- onBlur() {
25
- this.hasFocused = false;
1
+ <script setup>
2
+ import { ref } from "vue";
3
+ const props = defineProps({
4
+ style: Object,
5
+ autoFocus: Boolean,
6
+ name: String,
7
+ onClick: Function,
8
+ });
9
+
10
+ const hasFocused = ref(false);
11
+
12
+ const onFocus = () => {
13
+ hasFocused.value = true;
14
+ };
15
+
16
+ const onBlur = () => {
17
+ hasFocused.value = false;
18
+ };
19
+
20
+ const onKeyDown = (ev) => {
21
+ if (ev.keyCode === 13) {
22
+ // Enter
23
+ props.onClick?.();
24
+ return true;
26
25
  }
27
-
28
- onKeyDown(ev) {
29
- if(ev.keyCode === 13) { // Enter
30
- this.onClick?.();
31
- return true;
32
- }
33
- return false;
34
- }
35
-
36
- getAction() {
37
- return {
38
- onFocus: this.onFocus,
39
- onBlur: this.onBlur,
40
- onKeyDown: this.onKeyDown
41
- }
42
- }
43
- }
44
-
45
- export default Button;
26
+ return false;
27
+ };
46
28
  </script>
47
29
 
48
30
  <template>
49
- <jsv-focus-block :name="name" :autoFocus="autoFocus?'':undefined"
50
- :onAction="getAction()"
51
- >
52
- <div class="item"
31
+ <jsv-focus-block
32
+ :name="name"
33
+ :autoFocus="autoFocus ? '' : undefined"
34
+ :onAction="{
35
+ onFocus: onFocus,
36
+ onBlur: onBlur,
37
+ onKeyDown: onKeyDown,
38
+ }"
39
+ >
40
+ <div
41
+ class="item"
53
42
  :style="{
54
43
  ...style,
55
44
  backgroundColor: hasFocused ? '#FFFF00' : '#A8A8A8',
56
45
  }"
57
- >
58
- <slot/>
59
- </div>
60
- </jsv-focus-block>
46
+ >
47
+ <slot></slot>
48
+ </div>
49
+ </jsv-focus-block>
61
50
  </template>
62
51
 
63
52
  <style scoped>