@shijiu/jsview-vue-samples 2.2.426-test.0 → 2.3.151-test.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 (246) hide show
  1. package/BakeViewDemo/AnimatePic.vue +1 -1
  2. package/Basic/components/text/TextDirection.vue +7 -1
  3. package/BasicFocusControl/components/BaseBlock.vue +65 -18
  4. package/BreakRender/assets/imageList.json +235 -235
  5. package/ColorSpace/App.vue +2 -2
  6. package/CoupletsTest/App.vue +1 -1
  7. package/CoupletsTest/widget/Banger/Banger.vue +3 -3
  8. package/CoupletsTest/widget/Banger/MaroonLoader.vue +5 -5
  9. package/CoupletsTest/widget/Couplets/Couplets.vue +4 -4
  10. package/CoupletsTest/widget/Fireworks/Fireworks.vue +13 -13
  11. package/CustomShader/App.vue +4 -4
  12. package/CustomShader/gaussianBlur.glsl +1 -1
  13. package/DashPath/App.vue +80 -0
  14. package/DashPath/AppForOperator.vue +33 -0
  15. package/DemoForOperator/AnimPic/AnimPic.vue +69 -0
  16. package/DemoForOperator/AnimPic/App.vue +28 -0
  17. package/DemoForOperator/Banger/App.vue +26 -0
  18. package/DemoForOperator/Banger/Banger/Banger.vue +316 -0
  19. package/DemoForOperator/Banger/Banger/Maroon.vue +123 -0
  20. package/DemoForOperator/Banger/Banger/MaroonLoader.vue +78 -0
  21. package/DemoForOperator/Banger/Banger/SpriteDeal.js +30 -0
  22. package/DemoForOperator/Blur/Blur.vue +146 -0
  23. package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +158 -0
  24. package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
  25. package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +113 -0
  26. package/DemoForOperator/BookFlip/App.vue +115 -0
  27. package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +179 -0
  28. package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +310 -0
  29. package/DemoForOperator/BookFlip/BookFlip/flip.glsl +135 -0
  30. package/DemoForOperator/BookFlip/BookPage.vue +82 -0
  31. package/DemoForOperator/Bounce/App.vue +43 -0
  32. package/DemoForOperator/Bounce/Bounce.vue +81 -0
  33. package/DemoForOperator/Bounce/FreeMoveBuilder.js +139 -0
  34. package/DemoForOperator/ChunLian/App.vue +47 -0
  35. package/DemoForOperator/ChunLian/Couplets.vue +291 -0
  36. package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
  37. package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
  38. package/DemoForOperator/DominantColor/App.vue +187 -0
  39. package/DemoForOperator/EpisodeList/App.vue +80 -0
  40. package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +110 -0
  41. package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +250 -0
  42. package/DemoForOperator/EpisodeList/GroupItem.vue +65 -0
  43. package/DemoForOperator/EpisodeList/ListItem.vue +48 -0
  44. package/DemoForOperator/Firework1/App.vue +25 -0
  45. package/DemoForOperator/Firework1/Fireworks.vue +397 -0
  46. package/DemoForOperator/Firework1/SpriteDeal.js +30 -0
  47. package/DemoForOperator/FlipPage/App.vue +75 -0
  48. package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +178 -0
  49. package/DemoForOperator/FlipPage/FlipPage/flipIn.glsl +41 -0
  50. package/DemoForOperator/FlipPage/FlipPage/flipOut.glsl +41 -0
  51. package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +95 -0
  52. package/DemoForOperator/Focus/Alpha/AlphaPage.vue +40 -0
  53. package/DemoForOperator/Focus/Alpha/Item.vue +64 -0
  54. package/DemoForOperator/Focus/App.vue +124 -0
  55. package/DemoForOperator/Focus/CommonPageSetting.js +30 -0
  56. package/DemoForOperator/Focus/Item.vue +46 -0
  57. package/DemoForOperator/Focus/Light/Item.vue +67 -0
  58. package/DemoForOperator/Focus/Light/LightFocusBox.vue +87 -0
  59. package/DemoForOperator/Focus/Light/LightPage.vue +43 -0
  60. package/DemoForOperator/Focus/Light/utils/FrameCanvasStore.ts +68 -0
  61. package/DemoForOperator/Focus/Light/utils/RotateFrame.vue +146 -0
  62. package/DemoForOperator/Focus/Light/utils/circleHaloMask.png +0 -0
  63. package/DemoForOperator/Focus/Normal/Item.vue +64 -0
  64. package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +65 -0
  65. package/DemoForOperator/Focus/Normal/NormalPage.vue +41 -0
  66. package/DemoForOperator/Focus/SwipeLight/Item.vue +73 -0
  67. package/DemoForOperator/Focus/SwipeLight/SwipeLightBox.vue +62 -0
  68. package/DemoForOperator/Focus/SwipeLight/SwipeLightPage.vue +44 -0
  69. package/DemoForOperator/FrameShadow/App.vue +193 -0
  70. package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
  71. package/DemoForOperator/FullscreenIn/App.vue +105 -0
  72. package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +56 -0
  73. package/DemoForOperator/FullscreenIn/Item.vue +50 -0
  74. package/DemoForOperator/Genie/App.vue +78 -0
  75. package/DemoForOperator/Genie/geniePakcer/Genie.vue +741 -0
  76. package/DemoForOperator/Genie/geniePakcer/genieBottom.glsl +49 -0
  77. package/DemoForOperator/Genie/geniePakcer/genieLeft.glsl +50 -0
  78. package/DemoForOperator/Genie/geniePakcer/genieRight.glsl +57 -0
  79. package/DemoForOperator/Genie/geniePakcer/genieTop.glsl +50 -0
  80. package/DemoForOperator/GrayFilter/App.vue +51 -0
  81. package/DemoForOperator/GrayFilter/GrayFilter.vue +59 -0
  82. package/DemoForOperator/Jigsaw/App.vue +45 -0
  83. package/DemoForOperator/Jigsaw/JigsawFull.vue +142 -0
  84. package/DemoForOperator/Jigsaw/JigsawSingle.vue +118 -0
  85. package/DemoForOperator/LongChatBox/App.vue +36 -0
  86. package/DemoForOperator/LongChatBox/Bubble.vue +104 -0
  87. package/DemoForOperator/LongChatBox/LongChat.vue +173 -0
  88. package/DemoForOperator/LongChatBox/TextManager.ts +147 -0
  89. package/DemoForOperator/LongChatBox/VirtualList.vue +298 -0
  90. package/DemoForOperator/LongChatBox/testData.js +51 -0
  91. package/DemoForOperator/LongChatBox/utile.js +331 -0
  92. package/DemoForOperator/Particle/App.vue +69 -0
  93. package/DemoForOperator/Particle/Drop/DropParticle.vue +208 -0
  94. package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +120 -0
  95. package/DemoForOperator/PosterAnim/App.vue +125 -0
  96. package/DemoForOperator/PosterAnim/Bounce/BouncePage.vue +54 -0
  97. package/DemoForOperator/PosterAnim/Bounce/Item.vue +85 -0
  98. package/DemoForOperator/PosterAnim/Breath/BreathPage.vue +47 -0
  99. package/DemoForOperator/PosterAnim/Breath/Item.vue +58 -0
  100. package/DemoForOperator/PosterAnim/CommonPageSetting.js +30 -0
  101. package/DemoForOperator/PosterAnim/Item.vue +46 -0
  102. package/DemoForOperator/PosterAnim/PosterAnim.js +79 -0
  103. package/DemoForOperator/PosterAnim/Scale/Item.vue +72 -0
  104. package/DemoForOperator/PosterAnim/Scale/ScalePage.vue +48 -0
  105. package/DemoForOperator/PosterAnim/Shake/Item.vue +85 -0
  106. package/DemoForOperator/PosterAnim/Shake/ShakePage.vue +53 -0
  107. package/DemoForOperator/PosterOverflow/App.vue +116 -0
  108. package/DemoForOperator/PosterOverflow/Item.vue +67 -0
  109. package/DemoForOperator/PosterOverflow/PosterOverflow.vue +39 -0
  110. package/DemoForOperator/Resize/App.vue +157 -0
  111. package/DemoForOperator/Resize/Resize/Item.vue +234 -0
  112. package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
  113. package/DemoForOperator/Ripple/App.vue +54 -0
  114. package/DemoForOperator/Ripple/Ripple.vue +65 -0
  115. package/DemoForOperator/ScreenShootScale/App.vue +96 -0
  116. package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
  117. package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
  118. package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
  119. package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
  120. package/DemoForOperator/SmoothSwiper/App.vue +50 -0
  121. package/DemoForOperator/Sound/Bounce/App.vue +56 -0
  122. package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
  123. package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
  124. package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
  125. package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
  126. package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
  127. package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
  128. package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
  129. package/DemoForOperator/Sound/Rain/App.vue +11 -0
  130. package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
  131. package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
  132. package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
  133. package/DemoForOperator/Sound/Sound/index.js +4 -0
  134. package/DemoForOperator/Sound/Sound/useSound.js +112 -0
  135. package/DemoForOperator/Sprite/App.vue +33 -0
  136. package/DemoForOperator/Sprite/Sprite.vue +147 -0
  137. package/DemoForOperator/Stretch/App.vue +103 -0
  138. package/DemoForOperator/Stretch/Stretch/Item.vue +192 -0
  139. package/DemoForOperator/Stretch/Stretch/Stretch.vue +218 -0
  140. package/DemoForOperator/Swiper/App.vue +101 -0
  141. package/DemoForOperator/Swiper/Item.vue +56 -0
  142. package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
  143. package/DemoForOperator/TabContent/App.vue +89 -0
  144. package/DemoForOperator/TabContent/ContentPage.vue +66 -0
  145. package/DemoForOperator/TabContent/Item.vue +85 -0
  146. package/DemoForOperator/TabContent/PageItem.vue +40 -0
  147. package/DemoForOperator/TabContent/TabContent/CreepFocus.vue +160 -0
  148. package/DemoForOperator/TabContent/TabContent/Item.vue +63 -0
  149. package/DemoForOperator/TabContent/TabContent/TabContent.vue +184 -0
  150. package/DemoForOperator/TabContent/TabContent/TabItem.vue +368 -0
  151. package/DemoForOperator/TabContent/TabContent/TabWidget.vue +243 -0
  152. package/DemoForOperator/TabContent/TabContent/Util.js +3 -0
  153. package/DemoForOperator/TabContent/TabContent/ViewSwiper.vue +110 -0
  154. package/DemoForOperator/TabContent/testData.js +241 -0
  155. package/DemoForOperator/TabContentVertical/App.vue +104 -0
  156. package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
  157. package/DemoForOperator/TabContentVertical/Item.vue +94 -0
  158. package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
  159. package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
  160. package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
  161. package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
  162. package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
  163. package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
  164. package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
  165. package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
  166. package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
  167. package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
  168. package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
  169. package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
  170. package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
  171. package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
  172. package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
  173. package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
  174. package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
  175. package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
  176. package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
  177. package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
  178. package/DemoForOperator/TabContentVertical/testData.js +76 -0
  179. package/DemoForOperator/Vortex/App.vue +78 -0
  180. package/DemoForOperator/Vortex/Vortex/Vortex.vue +180 -0
  181. package/DemoForOperator/Vortex/Vortex/vortexIn.glsl +38 -0
  182. package/DemoForOperator/Vortex/Vortex/vortexOut.glsl +38 -0
  183. package/DemoForOperator/index.js +6 -0
  184. package/DemoForOperator/routeList.js +259 -0
  185. package/DemoHomepage/App.vue +50 -30
  186. package/DemoHomepage/components/Dialog.vue +1 -0
  187. package/DemoHomepage/components/Item.vue +11 -0
  188. package/DemoHomepage/components/TabFrame.vue +7 -0
  189. package/DemoHomepage/router.js +178 -81
  190. package/DemoHomepage/views/Homepage.vue +7 -2
  191. package/DivMetroPerformance/data.js +3 -3
  192. package/DriftScopeTest/App.vue +1 -1
  193. package/FilterDemo/AnimatePic.vue +1 -1
  194. package/FilterDemo/VideoLayer.vue +2 -2
  195. package/FullScreenFlex/TestFrame2.vue +1 -1
  196. package/GiftRain/App.vue +12 -12
  197. package/GiftRain/components/SpriteTranslate.vue +68 -48
  198. package/HashHistory/App.vue +2 -2
  199. package/HashHistory/router.js +1 -1
  200. package/JsvPreDownloader/App.vue +4 -4
  201. package/MediaDemo/components/frames/AudioFrame.vue +1 -1
  202. package/MediaDemo/components/frames/VideoFrame.vue +1 -1
  203. package/MetroWidgetDemos/MassiveItems/ContentItem.vue +1 -1
  204. package/MetroWidgetDemos/MassiveItems/data.js +1 -1
  205. package/MetroWidgetDemos/PerformanceTest/data.js +3 -3
  206. package/MetroWidgetDemos/RefreshDemo/assets/imageList.json +235 -235
  207. package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.json +235 -235
  208. package/MetroWidgetDemos/TripleWidget/App.vue +7 -1
  209. package/MetroWidgetDemos/TripleWidget/Item.vue +16 -2
  210. package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +7 -1
  211. package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +8 -2
  212. package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +3 -1
  213. package/MetroWidgetDemos/routeList.js +34 -17
  214. package/Poster3d/App.vue +69 -0
  215. package/Poster3d/Poster3d.vue +92 -0
  216. package/PosterPacker/App.vue +5 -5
  217. package/PosterPacker/tools/vortexPacker/Vortex.vue +1 -1
  218. package/QrcodeDemo/App.vue +1 -1
  219. package/Ripple/App.vue +1 -1
  220. package/ScaleDownNeon/App.vue +4 -4
  221. package/SceneTransition/App.vue +2 -2
  222. package/SceneTransition/maskConfig/config2.js +12 -12
  223. package/SceneTransition/maskConfig/config3.js +14 -14
  224. package/SprayView/App.vue +96 -51
  225. package/SpringFestival/App.vue +73 -0
  226. package/SpringFestival/SpringFestivalScene/ChunLian.vue +211 -0
  227. package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +139 -0
  228. package/SpringFestival/SpringFestivalScene/LanternAnim.js +60 -0
  229. package/SpringFestival/SpringFestivalScene/Rain.vue +137 -0
  230. package/SpringFestival/SpringFestivalScene/Scene.vue +218 -0
  231. package/SpringFestival/SpringFestivalScene/imageConfig.js +87 -0
  232. package/SpringFestival/SpringFestivalScene/index.js +1 -0
  233. package/Swiper/App.vue +28 -29
  234. package/Swiper/Item.vue +19 -0
  235. package/SwiperTest/App.vue +9 -9
  236. package/TestNativeSharedView/AckEventDefine.ts +82 -0
  237. package/TestNativeSharedView/App.vue +4 -6
  238. package/TestNativeSharedView/JsvDemoTester.js +131 -0
  239. package/TextureAnimation/App.vue +16 -6
  240. package/TextureAnimation/App3.vue +100 -0
  241. package/TextureAnimation/utils/FrameCanvasStore.ts +68 -0
  242. package/TextureAnimation/utils/RotateFrame.vue +146 -0
  243. package/TextureAnimation/utils/circleHaloMask.png +0 -0
  244. package/TombSweepingDayTest/Raining/RainScene.vue +4 -4
  245. package/ViewOpacity/App.vue +21 -2
  246. package/package.json +1 -1
@@ -0,0 +1,243 @@
1
+ <script setup>
2
+ import { onMounted, inject, ref, provide, shallowRef, computed } from "vue";
3
+ import {
4
+ getTextWidth,
5
+ ListWidget,
6
+ useFocusHub,
7
+ FixPositionSlide,
8
+ EdgeDirection,
9
+ HORIZONTAL,
10
+ } from "jsview";
11
+ import TabItem from "./TabItem.vue";
12
+ import CreepFocus from "./CreepFocus.vue";
13
+ import { getTouchFlag } from "./Util.js";
14
+
15
+ const touchFlag = getTouchFlag();
16
+ const modeIsKey = inject("modeIsKey");
17
+
18
+ const tabFocus = inject("tabFocus");
19
+ const focusHub = useFocusHub();
20
+ const props = defineProps({
21
+ data: Array,
22
+ name: String,
23
+ onEdge: Function,
24
+ layout: Object,
25
+ padding: Object,
26
+ itemGap: Number,
27
+ initFocusId: Number,
28
+ tabTextFontSize: Number,
29
+ creepFocusColor: String,
30
+ });
31
+ console.log("layout", props.layout);
32
+ const itemWidthExpand = 60;
33
+ const globalInfo = inject("globalInfo");
34
+ const slideType = new FixPositionSlide();
35
+
36
+ const creepFocus = ref(null);
37
+ const showFocus = ref(true);
38
+ let currentFocusRect = {};
39
+ const focusFrameController = {
40
+ focusVisible: (visible) => {
41
+ showFocus.value = visible ? true : false;
42
+ },
43
+ onFocusChange: (rect, focusIndex, doAnim) => {
44
+ creepFocus.value?.changeRect(rect, doAnim);
45
+ currentFocusRect = rect;
46
+ },
47
+ };
48
+ provide("focusFrameController", focusFrameController);
49
+ const itemHeight = computed(
50
+ () =>
51
+ props.layout.height -
52
+ (props.padding?.top ?? 0) -
53
+ (props.padding?.bottom ?? 0)
54
+ );
55
+
56
+ const SizeObj = {
57
+ fontSize: props.tabTextFontSize,
58
+ };
59
+ const data = [];
60
+ const getChildTabList = (childTab) => {
61
+ if (!childTab) {
62
+ return null;
63
+ }
64
+ const list = [];
65
+ for (let i = 0; i < childTab.length; ++i) {
66
+ const childTextSize = getTextWidth(childTab[i].itemTitle, SizeObj);
67
+ let obj = {
68
+ width: childTextSize + itemWidthExpand,
69
+ height: itemHeight.value,
70
+ marginRight: props.itemGap,
71
+ content: childTab[i].itemTitle,
72
+ index: i,
73
+ ...childTab[i],
74
+ };
75
+ list.push(obj);
76
+ }
77
+ return list;
78
+ };
79
+
80
+ for (let i = 0; i < props.data.length; ++i) {
81
+ const textSize = getTextWidth(props.data[i].itemTitle, SizeObj);
82
+ const childList = getChildTabList(props.data[i].childTab);
83
+ let totalWidth = 0;
84
+ if (childList) {
85
+ childList.forEach((item) => {
86
+ totalWidth += item.width + item.marginRight;
87
+ });
88
+ }
89
+ let obj = {
90
+ width: textSize + itemWidthExpand,
91
+ height: itemHeight.value,
92
+ content: props.data[i].itemTitle,
93
+ marginRight: props.itemGap,
94
+ name: "item_" + i, // focus name
95
+ ...props.data[i],
96
+ };
97
+ if (childList) {
98
+ obj.childTab = {
99
+ width: totalWidth,
100
+ list: childList,
101
+ };
102
+ }
103
+ data.push(obj);
104
+ }
105
+ const provideData = () => {
106
+ return data;
107
+ };
108
+
109
+ const measures = (item) => {
110
+ return {
111
+ width: item.width,
112
+ height: item.height,
113
+ marginRight: item.marginRight,
114
+ enableTap: touchFlag == 1,
115
+ };
116
+ };
117
+
118
+ const widgetRef = shallowRef();
119
+ onMounted(() => {
120
+ provide("parentWidget", widgetRef);
121
+ });
122
+
123
+ const onFocusRectChange = () => {
124
+ //展开时的滑动不需要更新焦点大小
125
+ if (showFocus.value) {
126
+ const curFocusIndex = widgetRef.value.getCurrentFocusIndex();
127
+ const rect = widgetRef.value.getTemplatePosition(curFocusIndex);
128
+ focusFrameController.onFocusChange(rect, curFocusIndex);
129
+ }
130
+ };
131
+ const onAllResizeDone = () => {
132
+ console.log("onAllResizeDone");
133
+ };
134
+
135
+ const onItemFocus = (item_data, onBlur) => {
136
+ console.log("testtest onItemFocus", item_data);
137
+ globalInfo.tabId = item_data.indexId;
138
+ if (globalInfo.updateTabId == -1 || !modeIsKey()) {
139
+ globalInfo.updateTabId = item_data.indexId;
140
+ }
141
+ if (globalInfo.tabCode != item_data.itemCode) {
142
+ globalInfo.tabCode = item_data.itemCode;
143
+ // if (props.data.icon4) {
144
+ // changeBg(props.data.icon4);
145
+ // }
146
+ }
147
+ };
148
+
149
+ const onEdge = (edgeInfo) => {
150
+ props.onEdge(edgeInfo);
151
+ };
152
+
153
+ const onItemClick = (data, onBlur, onFocus) => {
154
+ // manager.onItemTap({ onBlur: onBlur, onFocus: onFocus });
155
+ // if (data) {
156
+ // focusHub.setFocus(props.name);
157
+ // widgetRef.value.setFocusId(data.index);
158
+ // }
159
+ };
160
+
161
+ const onBlur = () => {
162
+ showFocus.value = false;
163
+ tabFocus.value = false;
164
+ };
165
+
166
+ const onFocus = () => {
167
+ showFocus.value = true;
168
+ tabFocus.value = true;
169
+ };
170
+
171
+ // Manager 实现
172
+ const manager = {
173
+ previousItem: null,
174
+
175
+ // 注册 onBlur 方法
176
+ registerOnBlur(item) {
177
+ if (this.previousItem && this.previousItem.onBlur) {
178
+ this.previousItem.onBlur(); // 调用上一个 item 的 onBlur
179
+ }
180
+ if (item.onFocus) {
181
+ item.onFocus();
182
+ }
183
+ this.previousItem = item; // 更新上一个 item
184
+ },
185
+
186
+ // 处理 item 被点击
187
+ onItemTap(item) {
188
+ this.registerOnBlur(item);
189
+ },
190
+ };
191
+ </script>
192
+
193
+ <template>
194
+ <div :style="{ left: layout.left, top: layout.top }">
195
+ <list-widget
196
+ ref="widgetRef"
197
+ :name="name"
198
+ :onFocusRectChange="onFocusRectChange"
199
+ :onAllItemResizeDone="onAllResizeDone"
200
+ :width="layout.width"
201
+ :height="layout.height"
202
+ :slideSetting="slideType"
203
+ :direction="HORIZONTAL"
204
+ :provideData="provideData"
205
+ :measures="measures"
206
+ :padding="padding"
207
+ :initFocusId="initFocusId"
208
+ :onEdge="onEdge"
209
+ :onFocus="onFocus"
210
+ :onBlur="onBlur"
211
+ :touchFlag="touchFlag"
212
+ >
213
+ <template #renderItem="{ data, onAction, query, onItemEdge }">
214
+ <tab-item
215
+ :data="data"
216
+ :onAction="onAction"
217
+ :query="query"
218
+ :onItemEdge="onItemEdge"
219
+ :onItemFocus="onItemFocus"
220
+ :onItemClick="onItemClick"
221
+ :creepFocusColor="creepFocusColor"
222
+ >
223
+ <template #tabItem="{ data, onAction, query }">
224
+ <slot
225
+ name="tabItem"
226
+ :data="data"
227
+ :query="query"
228
+ :onAction="onAction"
229
+ ></slot>
230
+ </template>
231
+ </tab-item>
232
+ </template>
233
+ <template #background>
234
+ <creep-focus
235
+ v-show="showFocus && modeIsKey()"
236
+ ref="creepFocus"
237
+ :color="creepFocusColor"
238
+ >
239
+ </creep-focus>
240
+ </template>
241
+ </list-widget>
242
+ </div>
243
+ </template>
@@ -0,0 +1,3 @@
1
+ export function getTouchFlag() {
2
+ return 0;
3
+ }
@@ -0,0 +1,110 @@
1
+ <script setup>
2
+ import { onMounted, inject, ref, watch } from "vue";
3
+
4
+ const props = defineProps({
5
+ onEdge: Function,
6
+ name: String,
7
+ layout: Object,
8
+ dataLoader: Function, // (tabId) => Promise
9
+ animDuration: { type: Number, default: 200 },
10
+ onFocus: Function,
11
+ onBlur: Function,
12
+ });
13
+
14
+ const globalInfo = inject("globalInfo");
15
+ const animState = inject("animState");
16
+
17
+ const page0Show = ref(false);
18
+ let page0Data = null;
19
+ const page0Anim = ref({ anim: null, onend: null });
20
+ const appSwiper_onFocus = () => {
21
+ console.log("testtest swiper on focus")
22
+ props.onFocus();
23
+ };
24
+ const appSwiper_onBlur = () => {
25
+ console.log("testtest swiper on blur")
26
+ props.onBlur();
27
+ };
28
+
29
+ const appSwiper_tabIdWatcher = (newValue, oldValue) => {
30
+ let direction = newValue > oldValue ? "left" : "right";
31
+ page0Show.value = false;
32
+ page0Data = null;
33
+ page0Anim.value = ref({ anim: null, onend: null });
34
+ props.dataLoader(newValue).then((data) => {
35
+ console.log("testtest swiper data", data);
36
+ if (oldValue > -1) {
37
+ animState.value = 1;
38
+ }
39
+ page0Anim.value = {
40
+ anim:
41
+ oldValue != -1
42
+ ? `app-swiper-${direction}-slide-in ${
43
+ props.animDuration / 1000
44
+ }s cubic-bezier(0.05, 0.55, 0.13, 0.78) 1`
45
+ : null,
46
+ onend: () => {
47
+ animState.value = 0;
48
+ },
49
+ };
50
+ page0Data = data;
51
+ page0Show.value = true;
52
+ });
53
+ };
54
+
55
+ watch(
56
+ () => globalInfo.updateTabId,
57
+ (newValue, oldValue) => {
58
+ console.log("ccht updateTabId changed", globalInfo.updateTabId);
59
+ appSwiper_tabIdWatcher(newValue, oldValue);
60
+ }
61
+ );
62
+ </script>
63
+
64
+ <template>
65
+ <jsv-focus-block
66
+ :name="name"
67
+ ref="focusNode"
68
+ :onAction="{
69
+ onFocus: appSwiper_onFocus,
70
+ onBlur: appSwiper_onBlur,
71
+ }"
72
+ >
73
+ <div
74
+ id="page0"
75
+ :style="{
76
+ left: layout.left,
77
+ top: layout.top,
78
+ width: layout.width,
79
+ height: layout.height,
80
+ animation: page0Anim.anim,
81
+ animationFillMode: 'forwards',
82
+ }"
83
+ @animationend="page0Anim.onend"
84
+ >
85
+ <slot v-if="page0Show" :data="page0Data" :onEdge="onEdge"></slot>
86
+ </div>
87
+ </jsv-focus-block>
88
+ </template>
89
+
90
+ <style>
91
+ @keyframes app-swiper-left-slide-in {
92
+ from {
93
+ transform: translate3d(280px, 0px, 0px);
94
+ }
95
+ to {
96
+ transform: translate3d(0px, 0px, 0px);
97
+ /* animation-timing-function: cubic-bezier(0.05, 0.55, 0.13, 0.78); */
98
+ }
99
+ }
100
+
101
+ @keyframes app-swiper-right-slide-in {
102
+ from {
103
+ transform: translate3d(-280px, 0px, 0px);
104
+ }
105
+ to {
106
+ transform: translate3d(0px, 0px, 0px);
107
+ /* animation-timing-function: cubic-bezier(0.05, 0.55, 0.13, 0.78); */
108
+ }
109
+ }
110
+ </style>
@@ -0,0 +1,241 @@
1
+ export const testData = [
2
+ {
3
+ "indexId": 0,
4
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_89605309/images/biz_89605309_bg_20230610145407.jpg",
5
+ "itemTitle": "更多",
6
+ "itemSubTitle": "",
7
+ "itemType": "biz",
8
+ "itemCode": "biz_89605309",
9
+ "itemIcon": "",
10
+ "hImg": "",
11
+ "vImg": "",
12
+ "opimg1": "",
13
+ "opimg2": "",
14
+ "linkType": "",
15
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_89605309.json",
16
+ "title": "更多",
17
+ "icon": "",
18
+ "icon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_89605309/images/biz_89605309_bg_20230610145407.jpg"
19
+ },
20
+ {
21
+ "indexId": 1,
22
+ "itemTitle": "短视频",
23
+ "itemSubTitle": "",
24
+ "itemType": "biz",
25
+ "itemCode": "biz_520",
26
+ "itemIcon": "",
27
+ "hImg": "",
28
+ "vImg": "",
29
+ "opimg1": "",
30
+ "opimg2": "",
31
+ "linkType": "",
32
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_520.json",
33
+ "title": "短视频",
34
+ "icon": ""
35
+ },
36
+ {
37
+ "indexId": 2,
38
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_84518310/images/biz_84518310_bg_20230607114159.jpg",
39
+ "itemTitle": "推荐",
40
+ "itemSubTitle": "",
41
+ "itemType": "biz",
42
+ "itemCode": "biz_84518310",
43
+ "itemIcon": "",
44
+ "hImg": "",
45
+ "vImg": "",
46
+ "opimg1": "",
47
+ "opimg2": "",
48
+ "linkType": "",
49
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_84518310.json",
50
+ "title": "推荐",
51
+ "icon": "",
52
+ "icon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_84518310/images/biz_84518310_bg_20230607114159.jpg",
53
+ "subTitle": "default"
54
+ },
55
+ {
56
+ "indexId": 3,
57
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_36146605/images/biz_36146605_bg_20230607140144.png",
58
+ "itemTitle": "直播",
59
+ "itemSubTitle": "",
60
+ "itemType": "biz",
61
+ "itemCode": "biz_36146605",
62
+ "itemIcon": "",
63
+ "hImg": "",
64
+ "vImg": "",
65
+ "opimg1": "",
66
+ "opimg2": "",
67
+ "linkType": "",
68
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_36146605.json",
69
+ "title": "直播",
70
+ "icon": "",
71
+ "icon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_36146605/images/biz_36146605_bg_20230607140144.png"
72
+ },
73
+ {
74
+ "indexId": 4,
75
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_51744660/biz_01028457/images/biz_01028457_bg_20230607140144.jpg",
76
+ "itemTitle": "电影 ",
77
+ "itemSubTitle": "",
78
+ "itemType": "biz",
79
+ "itemCode": "biz_01028457",
80
+ "itemIcon": "",
81
+ "hImg": "",
82
+ "vImg": "",
83
+ "opimg1": "",
84
+ "opimg2": "",
85
+ "linkType": "",
86
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_01028457.json",
87
+ "childTab": [
88
+ {
89
+ "indexId": 4,
90
+ "isSubTab": true,
91
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_51744660/biz_01028457/images/biz_01028457_bg_20230607140144.jpg",
92
+ "itemTitle": "电影 ",
93
+ "itemSubTitle": "",
94
+ "itemType": "biz",
95
+ "itemCode": "biz_01028457",
96
+ "itemIcon": "",
97
+ "hImg": "",
98
+ "vImg": "",
99
+ "opimg1": "",
100
+ "opimg2": "",
101
+ "linkType": "",
102
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_01028457.json"
103
+ },
104
+ {
105
+ "indexId": 5,
106
+ "isSubTab": true,
107
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_25950192/images/biz_25950192_bg_20230607140145.png",
108
+ "itemTitle": "电视剧",
109
+ "itemSubTitle": "",
110
+ "itemType": "biz",
111
+ "itemCode": "biz_25950192",
112
+ "itemIcon": "",
113
+ "hImg": "",
114
+ "vImg": "",
115
+ "opimg1": "",
116
+ "opimg2": "",
117
+ "linkType": "",
118
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_25950192.json"
119
+ },
120
+ {
121
+ "indexId": 6,
122
+ "isSubTab": true,
123
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_51744660/biz_91290873/images/biz_91290873_bg_20230608154804.jpg",
124
+ "itemTitle": "综艺",
125
+ "itemSubTitle": "",
126
+ "itemType": "biz",
127
+ "itemCode": "biz_91290873",
128
+ "itemIcon": "",
129
+ "hImg": "",
130
+ "vImg": "",
131
+ "opimg1": "",
132
+ "opimg2": "",
133
+ "linkType": "",
134
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_91290873.json"
135
+ },
136
+ {
137
+ "indexId": 7,
138
+ "isSubTab": true,
139
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_71011586/biz_48135919/images/biz_48135919_bg_20230607171837.png",
140
+ "itemTitle": "少儿",
141
+ "itemSubTitle": "",
142
+ "itemType": "biz",
143
+ "itemCode": "biz_48135919",
144
+ "itemIcon": "",
145
+ "hImg": "",
146
+ "vImg": "",
147
+ "opimg1": "",
148
+ "opimg2": "",
149
+ "linkType": "",
150
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_48135919.json"
151
+ }
152
+ ],
153
+ "title": "电影 ",
154
+ "icon": "",
155
+ "icon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_51744660/biz_01028457/images/biz_01028457_bg_20230607140144.jpg"
156
+ },
157
+ {
158
+ "indexId": 8,
159
+ "itemTitle": "动漫",
160
+ "itemSubTitle": "",
161
+ "itemType": "biz",
162
+ "itemCode": "biz_46299945",
163
+ "itemIcon": "",
164
+ "hImg": "",
165
+ "vImg": "",
166
+ "opimg1": "",
167
+ "opimg2": "",
168
+ "linkType": "",
169
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_46299945.json",
170
+ "title": "动漫",
171
+ "icon": ""
172
+ },
173
+ {
174
+ "indexId": 9,
175
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_71011586/biz_80556920/images/biz_80556920_bg_20230608180100.png",
176
+ "itemTitle": "新闻",
177
+ "itemSubTitle": "",
178
+ "itemType": "biz",
179
+ "itemCode": "biz_80556920",
180
+ "itemIcon": "",
181
+ "hImg": "",
182
+ "vImg": "",
183
+ "opimg1": "",
184
+ "opimg2": "",
185
+ "linkType": "",
186
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_80556920.json",
187
+ "title": "新闻",
188
+ "icon": "",
189
+ "icon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_71011586/biz_80556920/images/biz_80556920_bg_20230608180100.png"
190
+ },
191
+ {
192
+ "indexId": 10,
193
+ "itemIcon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_21417580/images/biz_21417580_bg_20230610165411.png",
194
+ "itemTitle": "体育",
195
+ "itemSubTitle": "",
196
+ "itemType": "biz",
197
+ "itemCode": "biz_21417580",
198
+ "itemIcon": "",
199
+ "hImg": "",
200
+ "vImg": "",
201
+ "opimg1": "",
202
+ "opimg2": "",
203
+ "linkType": "",
204
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_21417580.json",
205
+ "title": "体育",
206
+ "icon": "",
207
+ "icon4": "https://oss.image.qcast.cn/epg/resource/apk_site/biz_70204360/biz_21417580/images/biz_21417580_bg_20230610165411.png"
208
+ },
209
+ {
210
+ "indexId": 11,
211
+ "itemTitle": "电影票",
212
+ "itemSubTitle": "",
213
+ "itemType": "biz",
214
+ "itemCode": "biz_82694109",
215
+ "itemIcon": "",
216
+ "hImg": "",
217
+ "vImg": "",
218
+ "opimg1": "",
219
+ "opimg2": "",
220
+ "linkType": "",
221
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_82694109.json",
222
+ "title": "电影票",
223
+ "icon": ""
224
+ },
225
+ {
226
+ "indexId": 12,
227
+ "itemTitle": "放映厅",
228
+ "itemSubTitle": "",
229
+ "itemType": "biz",
230
+ "itemCode": "biz_15167730",
231
+ "itemIcon": "",
232
+ "hImg": "",
233
+ "vImg": "",
234
+ "opimg1": "",
235
+ "opimg2": "",
236
+ "linkType": "",
237
+ "dataLink": "http://192.168.0.226:8077/src/epg/api/page/biz_15167730.json",
238
+ "title": "放映厅",
239
+ "icon": ""
240
+ }
241
+ ]
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div
3
+ :style="{
4
+ width: 1280,
5
+ height: 720,
6
+ backgroundColor: '#007788',
7
+ }"
8
+ ></div>
9
+ <tab-content
10
+ :name="name"
11
+ :data="testData"
12
+ :tabLayout="{ width: 120, height: 650 }"
13
+ :tabPadding="{ left: 20, right: 20, top: 20, height: 20 }"
14
+ :contentLayout="{ left: 140, top: 50, width: 1000, height: 600 }"
15
+ :tabItemGap="30"
16
+ :contentDataLoader="pageDataLoader"
17
+ :initFocusId="2"
18
+ :contentOnFocus="contentOnFocus"
19
+ :contentOnBlur="contentOnBlur"
20
+ creepFocusColor="#e26c44"
21
+ >
22
+ <template #tabItem="{ data, onAction, query }">
23
+ <item :data="data" :onAction="onAction" :query="query"></item>
24
+ </template>
25
+ <template #content="{ data, onEdge }">
26
+ <content-page
27
+ name="contentPage"
28
+ :pageData="data"
29
+ :onEdge="onEdge"
30
+ ></content-page>
31
+ </template>
32
+ </tab-content>
33
+ </template>
34
+
35
+ <script setup>
36
+ import TabContent from "./TabContent/TabContent.vue";
37
+ import { onMounted } from "vue";
38
+ import { useFocusHub } from "jsview";
39
+ /** 注意, tab数据中有子tab的, 子tab的数据必须在childTab字段下, 类似这里的testData */
40
+ import { testData } from "./testData.js";
41
+ import Item from "./Item.vue";
42
+ import ContentPage from "./ContentPage.vue";
43
+
44
+ const focusHub = useFocusHub();
45
+ const name = "tab-content";
46
+
47
+ const ironmanSmall =
48
+ "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/ironman_small.png";
49
+ const spidermanSmall =
50
+ "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/spiderman_small.png";
51
+ const captainSmall =
52
+ "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/PosterOverflow/App/captain_small.png";
53
+
54
+ async function pageDataLoader(tabId) {
55
+ return {
56
+ title: "page " + tabId,
57
+ list: [
58
+ {
59
+ width: 360,
60
+ height: 290,
61
+ img: ironmanSmall,
62
+ },
63
+ {
64
+ width: 360,
65
+ height: 290,
66
+ img: spidermanSmall,
67
+ },
68
+ {
69
+ width: 360,
70
+ height: 290,
71
+ img: captainSmall,
72
+ },
73
+ {
74
+ width: 360,
75
+ height: 290,
76
+ img: ironmanSmall,
77
+ },
78
+ {
79
+ width: 360,
80
+ height: 290,
81
+ img: spidermanSmall,
82
+ },
83
+ {
84
+ width: 360,
85
+ height: 290,
86
+ img: captainSmall,
87
+ },
88
+ ],
89
+ };
90
+ }
91
+
92
+ function contentOnFocus() {
93
+ console.log("content on focus");
94
+ focusHub.setFocus("contentPage");
95
+ }
96
+
97
+ function contentOnBlur() {
98
+ console.log("content on blur");
99
+ }
100
+
101
+ onMounted(() => {
102
+ focusHub.setFocus(name);
103
+ });
104
+ </script>