@shijiu/jsview-vue-samples 2.3.151-test.0 → 2.3.728-alpha.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.
- package/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/DemoForOperator/Blur/Blur.vue +1 -1
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +49 -23
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +1 -1
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +156 -20
- package/DemoForOperator/BookFlip/App.vue +1 -1
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/Firework1/App.vue +12 -1
- package/DemoForOperator/Firework1/Fireworks.vue +18 -0
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +1 -0
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +12 -7
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +13 -7
- package/DemoForOperator/LongChatBox/App.vue +13 -13
- package/DemoForOperator/LongChatBox/Bubble.vue +78 -66
- package/DemoForOperator/LongChatBox/LongChat.vue +67 -36
- package/DemoForOperator/LongChatBox/testData.js +7 -44
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/routeList.js +8 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +5 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +749 -165
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/DomRenderer/App.vue +133 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMove/App.vue +24 -279
- package/FreeMove/TestScene1.vue +260 -0
- package/FreeMove/TestScene3.vue +431 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +51 -22
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +111 -46
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +14 -1
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +216 -0
- package/Markdown/data.js +633 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/EpgFlowListType/App.vue +206 -0
- package/MetroWidgetDemos/EpgFlowListType/components/ContentCard.vue +105 -0
- package/MetroWidgetDemos/EpgFlowListType/components/FloorSection.vue +131 -0
- package/MetroWidgetDemos/EpgFlowListType/components/LeftTabItem.vue +41 -0
- package/MetroWidgetDemos/EpgFlowListType/data.js +78 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/RenderAccelerate/Item.vue +67 -0
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/{TripleWidget → SpatialNav}/Item.vue +1 -8
- package/MetroWidgetDemos/{TripleWidget/WidgetItem.vue → SpatialNav/SimpleFloor.vue} +14 -45
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +23 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +216 -12
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/ScrollBoxTest/App.vue +52 -28
- package/ScrollBoxTest/ClipBar.vue +64 -2
- package/ScrollBoxTest/NinePatchBar.vue +64 -2
- package/ScrollBoxTest/SizeDivBar.vue +64 -2
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TextureAnimation/App3.vue +11 -1
- package/TouchWidget/App.vue +90 -5
- package/TouchWidget/WidgetItem.vue +1 -0
- package/TransitPage/App.vue +2 -0
- package/assets/logo.png +0 -0
- package/package.json +1 -1
- package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +0 -179
- package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +0 -310
- package/DemoForOperator/BookFlip/BookFlip/flip.glsl +0 -135
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -741
- package/DemoForOperator/LongChatBox/TextManager.ts +0 -147
- package/DemoForOperator/LongChatBox/VirtualList.vue +0 -298
- package/DemoForOperator/LongChatBox/utile.js +0 -331
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -87
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -99
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/TextureAnimation/utils/FrameCanvasStore.ts +0 -68
- package/TextureAnimation/utils/RotateFrame.vue +0 -146
- package/TextureAnimation/utils/circleHaloMask.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /package/{AnimPicture/assets → assets}/quan.webp +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
MetroWidget,
|
|
4
|
+
VERTICAL,
|
|
5
|
+
useFocusHub,
|
|
6
|
+
EdgeDirection,
|
|
7
|
+
METRO_WIDGET_CONST,
|
|
8
|
+
SpatialNavProvider,
|
|
9
|
+
SeamlessSlide,
|
|
10
|
+
} from "jsview";
|
|
11
|
+
import { onMounted, shallowRef } from "vue";
|
|
12
|
+
import LeftTabItem from "./components/LeftTabItem.vue";
|
|
13
|
+
import FloorSection from "./components/FloorSection.vue";
|
|
14
|
+
import { leftTabs, floorList } from "./data";
|
|
15
|
+
|
|
16
|
+
const focusHub = useFocusHub();
|
|
17
|
+
|
|
18
|
+
const leftWidgetRef = shallowRef();
|
|
19
|
+
const rightWidgetRef = shallowRef();
|
|
20
|
+
|
|
21
|
+
let curFloorId = 0;
|
|
22
|
+
const LEFT_ITEM_HEIGHT = 72;
|
|
23
|
+
const LEFT_ITEM_GAP = 14;
|
|
24
|
+
const LEFT_WIDGET_HEIGHT = 620;
|
|
25
|
+
|
|
26
|
+
const leftContentHeight =
|
|
27
|
+
leftTabs.length * LEFT_ITEM_HEIGHT +
|
|
28
|
+
Math.max(0, leftTabs.length - 1) * LEFT_ITEM_GAP;
|
|
29
|
+
const leftVerticalPadding = Math.max(
|
|
30
|
+
0,
|
|
31
|
+
Math.floor((LEFT_WIDGET_HEIGHT - leftContentHeight) / 2)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const leftPadding = {
|
|
35
|
+
top: leftVerticalPadding,
|
|
36
|
+
bottom: leftVerticalPadding,
|
|
37
|
+
left: 0,
|
|
38
|
+
right: 0,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// 将焦点自动对齐区间压缩到可视区 0.4~0.6,减少贴边感
|
|
42
|
+
const leftSlideSetting = new SeamlessSlide({
|
|
43
|
+
headRange: 0.4,
|
|
44
|
+
tailRange: 0.4,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const leftProvideData = () => {
|
|
48
|
+
return leftTabs.map((item) => {
|
|
49
|
+
return {
|
|
50
|
+
...item,
|
|
51
|
+
width: 220,
|
|
52
|
+
height: 72,
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const leftMeasures = (item) => {
|
|
58
|
+
return {
|
|
59
|
+
width: item.width,
|
|
60
|
+
height: item.height,
|
|
61
|
+
marginBottom: 14,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const rightProvideData = () => {
|
|
66
|
+
return floorList.map((floor) => {
|
|
67
|
+
const itemCount = floor.contentList.length;
|
|
68
|
+
const columnCount = Math.max(
|
|
69
|
+
1,
|
|
70
|
+
Math.floor((RIGHT_CONTENT_WIDTH + RIGHT_CONTENT_GAP_X) / (RIGHT_CONTENT_ITEM_WIDTH + RIGHT_CONTENT_GAP_X))
|
|
71
|
+
);
|
|
72
|
+
const rowCount = Math.max(1, Math.ceil(itemCount / columnCount));
|
|
73
|
+
// 与 contentMeasures 的 marginBottom 保持一致,末行也预留间距,避免子楼层出现内部可滚动空间
|
|
74
|
+
const contentHeight = rowCount * (RIGHT_CONTENT_ITEM_HEIGHT + RIGHT_CONTENT_GAP_Y);
|
|
75
|
+
const floorHeight = RIGHT_CONTENT_TOP + contentHeight + RIGHT_FLOOR_BOTTOM_SAFE_GAP;
|
|
76
|
+
return {
|
|
77
|
+
...floor,
|
|
78
|
+
contentHeight,
|
|
79
|
+
floorHeight,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const RIGHT_FLOOR_GAP = 18;
|
|
85
|
+
const RIGHT_CONTENT_WIDTH = 900;
|
|
86
|
+
const RIGHT_CONTENT_TOP = 62;
|
|
87
|
+
const RIGHT_CONTENT_ITEM_WIDTH = 220;
|
|
88
|
+
const RIGHT_CONTENT_ITEM_HEIGHT = 64;
|
|
89
|
+
const RIGHT_CONTENT_GAP_X = 12;
|
|
90
|
+
const RIGHT_CONTENT_GAP_Y = 12;
|
|
91
|
+
const RIGHT_FLOOR_BOTTOM_SAFE_GAP = 14;
|
|
92
|
+
const rightVisiblePadding = 20;
|
|
93
|
+
const rightPadding = {
|
|
94
|
+
top: rightVisiblePadding,
|
|
95
|
+
bottom: rightVisiblePadding,
|
|
96
|
+
left: 0,
|
|
97
|
+
right: 0,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// 右侧纵向楼层自动对齐时尽量将焦点落在可视区中间(0.4~0.6)
|
|
101
|
+
const rightSlideSetting = new SeamlessSlide({
|
|
102
|
+
headRange: 0.4,
|
|
103
|
+
tailRange: 0.4,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const rightMeasures = (item) => {
|
|
107
|
+
return {
|
|
108
|
+
width: 940,
|
|
109
|
+
height: item.floorHeight ?? 214,
|
|
110
|
+
marginBottom: RIGHT_FLOOR_GAP,
|
|
111
|
+
itemSlide: METRO_WIDGET_CONST.ITEM_SLIDE.ACT_FOCUS_RECT_EVENT,
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const syncLeftTab = (id) => {
|
|
116
|
+
curFloorId = id;
|
|
117
|
+
if (leftWidgetRef.value) {
|
|
118
|
+
leftWidgetRef.value.setFocusId(id);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const leftOnFocusChange = (id) => {
|
|
123
|
+
curFloorId = id;
|
|
124
|
+
if (rightWidgetRef.value) {
|
|
125
|
+
rightWidgetRef.value.setFocusId(id, true, true);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const leftOnEdge = (edgeInfo) => {
|
|
130
|
+
if (edgeInfo.direction === EdgeDirection.right) {
|
|
131
|
+
if (rightWidgetRef.value) {
|
|
132
|
+
rightWidgetRef.value.setFocusId(curFloorId);
|
|
133
|
+
}
|
|
134
|
+
focusHub.setFocus(`epg-floor-content-${curFloorId}`);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const rightOnSpatialEdge = (edgeInfo) => {
|
|
139
|
+
if (edgeInfo.direction === EdgeDirection.left) {
|
|
140
|
+
if (leftWidgetRef.value) {
|
|
141
|
+
leftWidgetRef.value.setFocusId(curFloorId, true);
|
|
142
|
+
}
|
|
143
|
+
focusHub.setFocus("epg-left-widget");
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
onMounted(() => {
|
|
148
|
+
focusHub.setFocus("epg-left-widget");
|
|
149
|
+
});
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<template>
|
|
153
|
+
<div
|
|
154
|
+
:style="{
|
|
155
|
+
width: 1280,
|
|
156
|
+
height: 720,
|
|
157
|
+
backgroundColor: '#081529',
|
|
158
|
+
}"
|
|
159
|
+
></div>
|
|
160
|
+
|
|
161
|
+
<metro-widget
|
|
162
|
+
ref="leftWidgetRef"
|
|
163
|
+
name="epg-left-widget"
|
|
164
|
+
:left="40"
|
|
165
|
+
:top="58"
|
|
166
|
+
:width="240"
|
|
167
|
+
:height="620"
|
|
168
|
+
:direction="VERTICAL"
|
|
169
|
+
:padding="leftPadding"
|
|
170
|
+
:slideSetting="leftSlideSetting"
|
|
171
|
+
:provideData="leftProvideData"
|
|
172
|
+
:measures="leftMeasures"
|
|
173
|
+
:onEdge="leftOnEdge"
|
|
174
|
+
:onFocusChange="leftOnFocusChange"
|
|
175
|
+
>
|
|
176
|
+
<template #renderItem="{ data, onAction }">
|
|
177
|
+
<left-tab-item :data="data" :onAction="onAction" />
|
|
178
|
+
</template>
|
|
179
|
+
</metro-widget>
|
|
180
|
+
|
|
181
|
+
<SpatialNavProvider :onEdge="rightOnSpatialEdge" yDefaultMoveType="layerFirst">
|
|
182
|
+
<metro-widget
|
|
183
|
+
ref="rightWidgetRef"
|
|
184
|
+
name="epg-right-widget"
|
|
185
|
+
:left="300"
|
|
186
|
+
:top="40"
|
|
187
|
+
:width="960"
|
|
188
|
+
:height="650"
|
|
189
|
+
:direction="VERTICAL"
|
|
190
|
+
:padding="rightPadding"
|
|
191
|
+
:slideSetting="rightSlideSetting"
|
|
192
|
+
:provideData="rightProvideData"
|
|
193
|
+
:measures="rightMeasures"
|
|
194
|
+
:keepTraceRange="1.5"
|
|
195
|
+
:sendFocusRectEvent="true"
|
|
196
|
+
>
|
|
197
|
+
<template #renderItem="{ data, onAction }">
|
|
198
|
+
<floor-section
|
|
199
|
+
:data="data"
|
|
200
|
+
:onAction="onAction"
|
|
201
|
+
:onFloorFocus="syncLeftTab"
|
|
202
|
+
/>
|
|
203
|
+
</template>
|
|
204
|
+
</metro-widget>
|
|
205
|
+
</SpatialNavProvider>
|
|
206
|
+
</template>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, onBeforeUnmount } from "vue";
|
|
3
|
+
import { JsvNinePatch, JsvTextureBuilder, JsvTextureStoreApi } from "jsview";
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
data: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
onAction: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
onFocus: {
|
|
15
|
+
type: Function,
|
|
16
|
+
required: false,
|
|
17
|
+
default: undefined,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const focused = ref(false);
|
|
22
|
+
const focusTextureInfo = ref(null);
|
|
23
|
+
const focusTextureUrl = ref("");
|
|
24
|
+
|
|
25
|
+
const ensureFocusTexture = () => {
|
|
26
|
+
if (focusTextureInfo.value) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const info = JsvTextureBuilder.buildCircleNinePatchTexture({
|
|
30
|
+
cornerRadius: 5,
|
|
31
|
+
circleLineWidth: 2,
|
|
32
|
+
circleColor: "rgba(242,250,255,1)",
|
|
33
|
+
});
|
|
34
|
+
focusTextureInfo.value = info;
|
|
35
|
+
focusTextureUrl.value = `jsvtexturestore://${info.texAccessName}`;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const releaseFocusTexture = () => {
|
|
39
|
+
if (!focusTextureInfo.value) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
JsvTextureStoreApi.deleteTexture(focusTextureInfo.value.texAccessName);
|
|
43
|
+
focusTextureInfo.value = null;
|
|
44
|
+
focusTextureUrl.value = "";
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
props.onAction.register("onFocus", () => {
|
|
48
|
+
ensureFocusTexture();
|
|
49
|
+
focused.value = true;
|
|
50
|
+
if (props.onFocus) {
|
|
51
|
+
props.onFocus();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
props.onAction.register("onBlur", () => {
|
|
56
|
+
focused.value = false;
|
|
57
|
+
releaseFocusTexture();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
onBeforeUnmount(() => {
|
|
61
|
+
releaseFocusTexture();
|
|
62
|
+
});
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<div
|
|
67
|
+
:style="{
|
|
68
|
+
width: data.width,
|
|
69
|
+
height: data.height,
|
|
70
|
+
backgroundColor: focused ? '#63D8FF' : '#1F314D',
|
|
71
|
+
borderRadius: 5,
|
|
72
|
+
}"
|
|
73
|
+
>
|
|
74
|
+
<jsv-nine-patch
|
|
75
|
+
v-if="focused && focusTextureInfo"
|
|
76
|
+
:style="{
|
|
77
|
+
left: 0,
|
|
78
|
+
top: 0,
|
|
79
|
+
width: data.width,
|
|
80
|
+
height: data.height,
|
|
81
|
+
}"
|
|
82
|
+
:imageUrl="focusTextureUrl"
|
|
83
|
+
:imageWidth="focusTextureInfo.ImageWidth"
|
|
84
|
+
:centerWidth="focusTextureInfo.CenterWidth"
|
|
85
|
+
:borderOutset="focusTextureInfo.BorderOutset"
|
|
86
|
+
:imageDspWidth="focusTextureInfo.ImageDspWidth"
|
|
87
|
+
:waitForInit="true"
|
|
88
|
+
/>
|
|
89
|
+
<div
|
|
90
|
+
:style="{
|
|
91
|
+
left: 12,
|
|
92
|
+
top: 4,
|
|
93
|
+
width: data.width - 24,
|
|
94
|
+
height: data.height - 8,
|
|
95
|
+
color: focused ? '#09213F' : '#EAF3FF',
|
|
96
|
+
fontSize: 24,
|
|
97
|
+
lineHeight: 28,
|
|
98
|
+
whiteSpace: 'normal',
|
|
99
|
+
wordBreak: 'break-all',
|
|
100
|
+
}"
|
|
101
|
+
>
|
|
102
|
+
{{ data.title }}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
MetroWidget,
|
|
5
|
+
VERTICAL,
|
|
6
|
+
ONEDGE_TYPE,
|
|
7
|
+
SeamlessSlide,
|
|
8
|
+
useFocusHub,
|
|
9
|
+
METRO_WIDGET_CONST,
|
|
10
|
+
} from "jsview";
|
|
11
|
+
import ContentCard from "./ContentCard.vue";
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
data: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
onAction: {
|
|
19
|
+
type: Object,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
onFloorFocus: {
|
|
23
|
+
type: Function,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const focusHub = useFocusHub();
|
|
28
|
+
|
|
29
|
+
const contentWidgetName = computed(() => {
|
|
30
|
+
return `epg-floor-content-${props.data.id}`;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const floorHeight = computed(() => {
|
|
34
|
+
return props.data.floorHeight ?? 214;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const contentWidgetHeight = computed(() => {
|
|
38
|
+
return props.data.contentHeight ?? 138;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const provideContentData = () => {
|
|
42
|
+
return props.data.contentList.map((title, index) => {
|
|
43
|
+
return {
|
|
44
|
+
id: `${props.data.id}-${index}`,
|
|
45
|
+
title,
|
|
46
|
+
width: 220,
|
|
47
|
+
height: 64,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const contentMeasures = (item) => {
|
|
53
|
+
return {
|
|
54
|
+
width: item.width,
|
|
55
|
+
height: item.height,
|
|
56
|
+
marginRight: 12,
|
|
57
|
+
marginBottom: 12,
|
|
58
|
+
bindSpatialNav: true,
|
|
59
|
+
itemSlide: METRO_WIDGET_CONST.ITEM_SLIDE.DISABLE,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// 楼层内横向内容自动对齐时尽量把焦点控制在 0.4~0.6 区间
|
|
64
|
+
const contentSlideSetting = new SeamlessSlide({
|
|
65
|
+
headRange: 0.4,
|
|
66
|
+
tailRange: 0.4,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// 焦点框是九宫格描边,会向 item 外扩(borderOutset);
|
|
70
|
+
// 子 MetroWidget 默认会 clip,可视区边缘(尤其左/上)容易被裁切,
|
|
71
|
+
// 这里通过 padding 预留安全边距,保证圆角焦点框完整显示。
|
|
72
|
+
const contentPadding = {
|
|
73
|
+
top: 6,
|
|
74
|
+
bottom: 0,
|
|
75
|
+
left: 6,
|
|
76
|
+
right: 0,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
props.onAction.register("onFocus", () => {
|
|
80
|
+
props.onFloorFocus(props.data.id);
|
|
81
|
+
focusHub.setFocus(contentWidgetName.value);
|
|
82
|
+
});
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<template>
|
|
86
|
+
<div
|
|
87
|
+
:style="{
|
|
88
|
+
width: 940,
|
|
89
|
+
height: floorHeight,
|
|
90
|
+
backgroundColor: '#122540',
|
|
91
|
+
borderRadius: 12,
|
|
92
|
+
}"
|
|
93
|
+
>
|
|
94
|
+
<div
|
|
95
|
+
:style="{
|
|
96
|
+
left: 20,
|
|
97
|
+
top: 14,
|
|
98
|
+
width: 880,
|
|
99
|
+
height: 36,
|
|
100
|
+
lineHeight: '36px',
|
|
101
|
+
color: '#F2F8FF',
|
|
102
|
+
fontSize: 30,
|
|
103
|
+
}"
|
|
104
|
+
>
|
|
105
|
+
{{ data.title }}
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<metro-widget
|
|
109
|
+
:name="contentWidgetName"
|
|
110
|
+
:left="20"
|
|
111
|
+
:top="62"
|
|
112
|
+
:width="900"
|
|
113
|
+
:height="contentWidgetHeight"
|
|
114
|
+
:direction="VERTICAL"
|
|
115
|
+
:padding="contentPadding"
|
|
116
|
+
:slideSetting="contentSlideSetting"
|
|
117
|
+
:provideData="provideContentData"
|
|
118
|
+
:measures="contentMeasures"
|
|
119
|
+
:onEdge="ONEDGE_TYPE.SPATIAL_NAV"
|
|
120
|
+
:sendFocusRectEvent="true"
|
|
121
|
+
>
|
|
122
|
+
<template #renderItem="{ data, onAction }">
|
|
123
|
+
<content-card
|
|
124
|
+
:data="data"
|
|
125
|
+
:onAction="onAction"
|
|
126
|
+
:onFocus="() => props.onFloorFocus(props.data.id)"
|
|
127
|
+
/>
|
|
128
|
+
</template>
|
|
129
|
+
</metro-widget>
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
data: {
|
|
6
|
+
type: Object,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
onAction: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const focused = ref(false);
|
|
16
|
+
|
|
17
|
+
props.onAction.register("onFocus", () => {
|
|
18
|
+
focused.value = true;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
props.onAction.register("onBlur", () => {
|
|
22
|
+
focused.value = false;
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div
|
|
28
|
+
:style="{
|
|
29
|
+
width: data.width,
|
|
30
|
+
height: data.height,
|
|
31
|
+
lineHeight: data.height + 'px',
|
|
32
|
+
textAlign: 'center',
|
|
33
|
+
fontSize: 30,
|
|
34
|
+
color: focused ? '#0D1E39' : '#FFFFFF',
|
|
35
|
+
backgroundColor: focused ? '#7AE3FF' : '#2E4B72',
|
|
36
|
+
borderRadius: 10,
|
|
37
|
+
}"
|
|
38
|
+
>
|
|
39
|
+
{{ data.title }}
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const leftTabs = [
|
|
2
|
+
{ id: 0, title: "推荐" },
|
|
3
|
+
{ id: 1, title: "电影" },
|
|
4
|
+
{ id: 2, title: "电视剧" },
|
|
5
|
+
{ id: 3, title: "综艺" },
|
|
6
|
+
{ id: 4, title: "少儿" },
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export const floorList = [
|
|
10
|
+
{
|
|
11
|
+
id: 0,
|
|
12
|
+
title: "推荐楼层",
|
|
13
|
+
contentList: [
|
|
14
|
+
"推荐内容 01",
|
|
15
|
+
"推荐内容 02",
|
|
16
|
+
"推荐内容 03",
|
|
17
|
+
"推荐内容 04",
|
|
18
|
+
"推荐内容 05",
|
|
19
|
+
"推荐内容 06",
|
|
20
|
+
"推荐内容 07",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 1,
|
|
25
|
+
title: "电影楼层",
|
|
26
|
+
contentList: [
|
|
27
|
+
"电影内容 01",
|
|
28
|
+
"电影内容 02",
|
|
29
|
+
"电影内容 03",
|
|
30
|
+
"电影内容 04",
|
|
31
|
+
"电影内容 05",
|
|
32
|
+
"电影内容 06",
|
|
33
|
+
"电影内容 07",
|
|
34
|
+
"电影内容 08",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 2,
|
|
39
|
+
title: "电视剧楼层",
|
|
40
|
+
contentList: [
|
|
41
|
+
"剧集内容 01",
|
|
42
|
+
"剧集内容 02",
|
|
43
|
+
"剧集内容 03",
|
|
44
|
+
"剧集内容 04",
|
|
45
|
+
"剧集内容 05",
|
|
46
|
+
"剧集内容 06",
|
|
47
|
+
"剧集内容 07",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 3,
|
|
52
|
+
title: "综艺楼层",
|
|
53
|
+
contentList: [
|
|
54
|
+
"综艺内容 01",
|
|
55
|
+
"综艺内容 02",
|
|
56
|
+
"综艺内容 03",
|
|
57
|
+
"综艺内容 04",
|
|
58
|
+
"综艺内容 05",
|
|
59
|
+
"综艺内容 06",
|
|
60
|
+
"综艺内容 07",
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 4,
|
|
65
|
+
title: "少儿楼层",
|
|
66
|
+
contentList: [
|
|
67
|
+
"少儿内容 01",
|
|
68
|
+
"少儿内容 02",
|
|
69
|
+
"少儿内容 03",
|
|
70
|
+
"少儿内容 04",
|
|
71
|
+
"少儿内容 05",
|
|
72
|
+
"少儿内容 06",
|
|
73
|
+
"少儿内容 07",
|
|
74
|
+
"少儿内容 08",
|
|
75
|
+
"少儿内容 09",
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
];
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<!-- 通用item -->
|
|
2
|
+
<script setup>
|
|
3
|
+
import { JsvMarquee } from 'jsview'
|
|
4
|
+
import { shallowRef, inject } from 'vue'
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
data: Object,
|
|
7
|
+
name: String,
|
|
8
|
+
onAction: Object,
|
|
9
|
+
query: Object,
|
|
10
|
+
onClick: Function,
|
|
11
|
+
onFocus: Function,
|
|
12
|
+
onBlur: Function,
|
|
13
|
+
onItemEdge: Function,
|
|
14
|
+
})
|
|
15
|
+
const focused = shallowRef(false)
|
|
16
|
+
const gazed = shallowRef(false)
|
|
17
|
+
const parentWidget = inject('parentWidget', {})
|
|
18
|
+
const divRef = shallowRef(null)
|
|
19
|
+
// item样式
|
|
20
|
+
const itemStyle = {
|
|
21
|
+
...props.data.itemStyle,
|
|
22
|
+
}
|
|
23
|
+
// 图片样式
|
|
24
|
+
const imgStyle = {
|
|
25
|
+
...props.data.imgStyle,
|
|
26
|
+
}
|
|
27
|
+
// 图标样式
|
|
28
|
+
const iconStyle = {
|
|
29
|
+
...props.data.iconStyle,
|
|
30
|
+
}
|
|
31
|
+
// 文本样式
|
|
32
|
+
const textStyle = {
|
|
33
|
+
...props.data.textStyle,
|
|
34
|
+
width: props.data.textStyle.padding
|
|
35
|
+
? props.data.textStyle.width - (props.data.textStyle.padding.left || 0) - (props.data.textStyle.padding.right || 0)
|
|
36
|
+
: props.data.textStyle.width,
|
|
37
|
+
height: props.data.textStyle.padding
|
|
38
|
+
? props.data.textStyle.height - (props.data.textStyle.padding.top || 0) - (props.data.textStyle.padding.bottom || 0)
|
|
39
|
+
: props.data.textStyle.height,
|
|
40
|
+
left: (props.data.textStyle.left || 0) + (props.data.textStyle.padding?.left || 0),
|
|
41
|
+
top: (props.data.textStyle.top || 0) + (props.data.textStyle.padding?.top || 0),
|
|
42
|
+
}
|
|
43
|
+
// 焦点样式
|
|
44
|
+
const focusStyle = {
|
|
45
|
+
...itemStyle,
|
|
46
|
+
...props.data.focusStyle,
|
|
47
|
+
}
|
|
48
|
+
// 焦点图片样式
|
|
49
|
+
const focusImgStyle = {
|
|
50
|
+
...imgStyle,
|
|
51
|
+
...props.data.focusImgStyle,
|
|
52
|
+
}
|
|
53
|
+
// 焦点图标样式
|
|
54
|
+
const focusIconStyle = {
|
|
55
|
+
...iconStyle,
|
|
56
|
+
...props.data.focusIconStyle,
|
|
57
|
+
}
|
|
58
|
+
// 焦点文本样式
|
|
59
|
+
const focusTextStyle = {
|
|
60
|
+
...textStyle,
|
|
61
|
+
...props.data.focusTextStyle
|
|
62
|
+
}
|
|
63
|
+
// 失焦样式
|
|
64
|
+
const blurStyle = {
|
|
65
|
+
...itemStyle,
|
|
66
|
+
...props.data.blurStyle,
|
|
67
|
+
}
|
|
68
|
+
// 失焦图片样式
|
|
69
|
+
const blurImgStyle = {
|
|
70
|
+
...imgStyle,
|
|
71
|
+
...props.data.blurImgStyle,
|
|
72
|
+
}
|
|
73
|
+
// 失焦图标样式
|
|
74
|
+
const blurIconStyle = {
|
|
75
|
+
...iconStyle,
|
|
76
|
+
...props.data.blurIconStyle,
|
|
77
|
+
}
|
|
78
|
+
// 失焦文本样式
|
|
79
|
+
const blurTextStyle = {
|
|
80
|
+
...textStyle,
|
|
81
|
+
...props.data.blurTextStyle,
|
|
82
|
+
}
|
|
83
|
+
//在回调中更改自身状态
|
|
84
|
+
const onFocus = () => {
|
|
85
|
+
if (parentWidget.value) {
|
|
86
|
+
parentWidget.value.slideToDiv(divRef.value, true)
|
|
87
|
+
}
|
|
88
|
+
focused.value = true
|
|
89
|
+
if (props.onFocus) {
|
|
90
|
+
props.onFocus(props.data, props.query)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const onBlur = () => {
|
|
94
|
+
focused.value = false
|
|
95
|
+
if (props.onBlur) {
|
|
96
|
+
props.onBlur(props.data, props.query)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const onClick = () => {
|
|
100
|
+
if (props.onClick) {
|
|
101
|
+
props.onClick(props.data, props.query)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// 无论widget是否获焦 item获焦
|
|
105
|
+
const onGaze = () => {
|
|
106
|
+
gazed.value = true
|
|
107
|
+
}
|
|
108
|
+
// 无论widget是否获焦 item失焦
|
|
109
|
+
const onIgnore = () => {
|
|
110
|
+
gazed.value = false
|
|
111
|
+
}
|
|
112
|
+
// 注册回调
|
|
113
|
+
props.onAction.register('onFocus', onFocus)
|
|
114
|
+
props.onAction.register('onBlur', onBlur)
|
|
115
|
+
props.onAction.register('onClick', onClick)
|
|
116
|
+
props.onAction.register('onGaze', onGaze)
|
|
117
|
+
props.onAction.register('onIgnore', onIgnore)
|
|
118
|
+
</script>
|
|
119
|
+
<template>
|
|
120
|
+
<div ref="divRef" :style="focused ? focusStyle : gazed ? blurStyle : itemStyle">
|
|
121
|
+
<div v-if="imgStyle" :style="focused ? focusImgStyle : gazed ? blurImgStyle : imgStyle"></div>
|
|
122
|
+
<div v-if="iconStyle" :style="iconStyle"></div>
|
|
123
|
+
<!-- 正常显示文字 -->
|
|
124
|
+
<div v-if="data.data.textVisible">
|
|
125
|
+
<jsv-marquee v-if="focused" :style="focusTextStyle" :text="data.data.name"></jsv-marquee>
|
|
126
|
+
<div v-else :style="gazed ? blurTextStyle : textStyle">{{ data.data?.name }}</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</template>
|
|
130
|
+
<style scoped></style>
|