@shijiu/jsview-vue-samples 2.3.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.
- package/DashPath/App.vue +17 -16
- package/DashPath/AppForOperator.vue +2 -4
- package/DemoForOperator/AnimPic/AnimPic.vue +24 -2
- package/DemoForOperator/Banger/Banger/Banger.vue +73 -9
- package/DemoForOperator/Blur/Blur.vue +146 -0
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +158 -0
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +113 -0
- package/DemoForOperator/BookFlip/App.vue +115 -0
- package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +179 -0
- package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +310 -0
- package/DemoForOperator/BookFlip/BookFlip/flip.glsl +135 -0
- package/DemoForOperator/BookFlip/BookPage.vue +82 -0
- package/DemoForOperator/Bounce/Bounce.vue +33 -1
- package/DemoForOperator/ChunLian/Couplets.vue +44 -1
- package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
- package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
- package/DemoForOperator/DominantColor/App.vue +187 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +0 -3
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +76 -2
- package/DemoForOperator/Firework1/App.vue +1 -1
- package/DemoForOperator/Firework1/Fireworks.vue +50 -11
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +29 -1
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +27 -2
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +42 -1
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +12 -0
- package/DemoForOperator/FrameShadow/App.vue +193 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
- package/DemoForOperator/FullscreenIn/App.vue +1 -1
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +18 -3
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +60 -18
- package/DemoForOperator/GrayFilter/GrayFilter.vue +21 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +46 -4
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +34 -2
- package/DemoForOperator/LongChatBox/App.vue +36 -0
- package/DemoForOperator/LongChatBox/Bubble.vue +104 -0
- package/DemoForOperator/LongChatBox/LongChat.vue +173 -0
- package/DemoForOperator/LongChatBox/TextManager.ts +147 -0
- package/DemoForOperator/LongChatBox/VirtualList.vue +298 -0
- package/DemoForOperator/LongChatBox/testData.js +51 -0
- package/DemoForOperator/LongChatBox/utile.js +331 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +33 -1
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +23 -2
- package/DemoForOperator/PosterAnim/PosterAnim.js +21 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +16 -0
- package/DemoForOperator/Resize/App.vue +157 -0
- package/DemoForOperator/Resize/Resize/Item.vue +234 -0
- package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
- package/DemoForOperator/Ripple/Ripple.vue +16 -1
- package/DemoForOperator/ScreenShootScale/App.vue +96 -0
- package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
- package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
- package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
- package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
- package/DemoForOperator/SmoothSwiper/App.vue +50 -0
- package/DemoForOperator/Sound/Bounce/App.vue +56 -0
- package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
- package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
- package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
- package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
- package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
- package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
- package/DemoForOperator/Sound/Rain/App.vue +11 -0
- package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
- package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
- package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
- package/DemoForOperator/Sound/Sound/index.js +4 -0
- package/DemoForOperator/Sound/Sound/useSound.js +112 -0
- package/DemoForOperator/Sprite/Sprite.vue +62 -5
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +52 -2
- package/DemoForOperator/Swiper/App.vue +101 -0
- package/DemoForOperator/Swiper/Item.vue +56 -0
- package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +39 -1
- package/DemoForOperator/TabContentVertical/App.vue +104 -0
- package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
- package/DemoForOperator/TabContentVertical/Item.vue +94 -0
- package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
- package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
- package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
- package/DemoForOperator/TabContentVertical/testData.js +76 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +26 -0
- package/DemoForOperator/routeList.js +118 -1
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/router.js +75 -1
- package/GiftRain/components/SpriteTranslate.vue +68 -48
- package/HashHistory/App.vue +2 -2
- package/HashHistory/router.js +1 -1
- package/MetroWidgetDemos/TripleWidget/App.vue +7 -1
- package/MetroWidgetDemos/TripleWidget/Item.vue +16 -2
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +7 -1
- package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +8 -2
- package/MetroWidgetDemos/routeList.js +17 -0
- package/PosterPacker/App.vue +2 -2
- package/ViewOpacity/App.vue +19 -0
- package/package.json +1 -1
- package/DashPath/DashPath.vue +0 -118
- package/DemoForOperator/ScalePoster/App.vue +0 -4
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shallowRef, onMounted, onBeforeUnmount } from "vue";
|
|
3
|
+
import { JsvTextureStoreApi, JsvPreload, buildPreloadInfo } from "jsview";
|
|
4
|
+
|
|
5
|
+
const Image1 =
|
|
6
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CustomShader/App/panda.jpeg";
|
|
7
|
+
const Image2 =
|
|
8
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/CustomShader/App/owl.jpeg";
|
|
9
|
+
|
|
10
|
+
const vToCapture = shallowRef(null);
|
|
11
|
+
const colorList1 = shallowRef([]);
|
|
12
|
+
const colorList2 = shallowRef([]);
|
|
13
|
+
const isPreloadDone = shallowRef(false);
|
|
14
|
+
|
|
15
|
+
let cancelHandel1 = null;
|
|
16
|
+
let cancelHandel2 = null;
|
|
17
|
+
|
|
18
|
+
const preloadList = [buildPreloadInfo(Image1)];
|
|
19
|
+
|
|
20
|
+
function handlePreloadDone() {
|
|
21
|
+
console.log("图片预加载完成");
|
|
22
|
+
isPreloadDone.value = true;
|
|
23
|
+
catpure();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function catpure() {
|
|
27
|
+
try {
|
|
28
|
+
cancelHandel1 = JsvTextureStoreApi.capture2Texture(
|
|
29
|
+
vToCapture.value,
|
|
30
|
+
(textureName, autoRecycle, w, h) => {
|
|
31
|
+
console.log("ccht captureBlurTexture", textureName, autoRecycle, w, h);
|
|
32
|
+
if (textureName) {
|
|
33
|
+
cancelHandel1 = JsvTextureStoreApi.getDominantColor(
|
|
34
|
+
`jsvtexturestore://${textureName}`,
|
|
35
|
+
(info) => {
|
|
36
|
+
console.log("ccht getDominantColor", info);
|
|
37
|
+
if (info.dominantColors) {
|
|
38
|
+
colorList1.value = info.dominantColors.map((color) => {
|
|
39
|
+
return "#" + color;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
true
|
|
47
|
+
);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("captureTexture error", error, new Error().stack);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
cancelHandel2 = JsvTextureStoreApi.getDominantColor(Image2, (info) => {
|
|
55
|
+
console.log("ccht getDominantColor2", info);
|
|
56
|
+
if (info.dominantColors) {
|
|
57
|
+
colorList2.value = info.dominantColors.map((color) => {
|
|
58
|
+
return "#" + color;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
onBeforeUnmount(() => {
|
|
65
|
+
cancelHandel1?.();
|
|
66
|
+
cancelHandel2?.();
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<div
|
|
72
|
+
:style="{
|
|
73
|
+
left: 0,
|
|
74
|
+
top: 0,
|
|
75
|
+
width: 1280,
|
|
76
|
+
height: 720,
|
|
77
|
+
backgroundColor: '#FFFFFF',
|
|
78
|
+
}"
|
|
79
|
+
></div>
|
|
80
|
+
<jsv-preload
|
|
81
|
+
:preloadList="preloadList"
|
|
82
|
+
:onPreloadDone="handlePreloadDone"
|
|
83
|
+
></jsv-preload>
|
|
84
|
+
<div
|
|
85
|
+
ref="vToCapture"
|
|
86
|
+
:style="{
|
|
87
|
+
left: 0,
|
|
88
|
+
top: 50,
|
|
89
|
+
width: 640, // 截屏区域的宽
|
|
90
|
+
height: 360, // 截屏区域的高
|
|
91
|
+
}"
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
:style="{
|
|
95
|
+
width: 640,
|
|
96
|
+
height: 360,
|
|
97
|
+
backgroundImage: `url(${Image1})`,
|
|
98
|
+
}"
|
|
99
|
+
/>
|
|
100
|
+
<div
|
|
101
|
+
:style="{
|
|
102
|
+
width: 300,
|
|
103
|
+
height: 300,
|
|
104
|
+
backgroundColor: '#007788',
|
|
105
|
+
}"
|
|
106
|
+
></div>
|
|
107
|
+
</div>
|
|
108
|
+
<div
|
|
109
|
+
:style="{
|
|
110
|
+
left: 50,
|
|
111
|
+
top: 420,
|
|
112
|
+
}"
|
|
113
|
+
v-if="colorList1.length > 0"
|
|
114
|
+
>
|
|
115
|
+
<div
|
|
116
|
+
v-for="(color, index) in colorList1"
|
|
117
|
+
:style="{
|
|
118
|
+
left: 60 * index,
|
|
119
|
+
width: 50,
|
|
120
|
+
height: 50,
|
|
121
|
+
backgroundColor: color,
|
|
122
|
+
}"
|
|
123
|
+
></div>
|
|
124
|
+
<div
|
|
125
|
+
:style="{
|
|
126
|
+
top: 50,
|
|
127
|
+
width: 480,
|
|
128
|
+
height: 40,
|
|
129
|
+
fontSize: 20,
|
|
130
|
+
textAlign: 'center',
|
|
131
|
+
lineHeight: '40px',
|
|
132
|
+
}"
|
|
133
|
+
>
|
|
134
|
+
截图取主色调
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div
|
|
139
|
+
:style="{
|
|
140
|
+
left: 640,
|
|
141
|
+
top: 50,
|
|
142
|
+
width: 640,
|
|
143
|
+
height: 360,
|
|
144
|
+
backgroundImage: `url(${Image2})`,
|
|
145
|
+
}"
|
|
146
|
+
/>
|
|
147
|
+
<div
|
|
148
|
+
:style="{
|
|
149
|
+
top: 420,
|
|
150
|
+
left: 690,
|
|
151
|
+
}"
|
|
152
|
+
v-if="colorList2.length > 0"
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
v-for="(color, index) in colorList2"
|
|
156
|
+
:style="{
|
|
157
|
+
left: 60 * index,
|
|
158
|
+
width: 50,
|
|
159
|
+
height: 50,
|
|
160
|
+
backgroundColor: color,
|
|
161
|
+
}"
|
|
162
|
+
></div>
|
|
163
|
+
<div
|
|
164
|
+
:style="{
|
|
165
|
+
top: 50,
|
|
166
|
+
width: 480,
|
|
167
|
+
height: 40,
|
|
168
|
+
fontSize: 20,
|
|
169
|
+
textAlign: 'center',
|
|
170
|
+
lineHeight: '40px',
|
|
171
|
+
}"
|
|
172
|
+
>
|
|
173
|
+
图片取主色调
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</template>
|
|
177
|
+
|
|
178
|
+
<style>
|
|
179
|
+
@keyframes rotate {
|
|
180
|
+
0% {
|
|
181
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
182
|
+
}
|
|
183
|
+
100% {
|
|
184
|
+
transform: rotate3d(0, 0, 1, 360deg);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
</style>
|
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
* @Description: file content
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
|
+
/**
|
|
8
|
+
* @slot listItem - 渲染单个列表项
|
|
9
|
+
* @property {Object} data - 项数据
|
|
10
|
+
* @property {Function} onAction - 动作处理函数
|
|
11
|
+
* @property {Object} query - 查询参数
|
|
12
|
+
*
|
|
13
|
+
* @slot groupItem - 渲染分页组项
|
|
14
|
+
* @property {Object} item - 分页组项数据
|
|
15
|
+
* @property {number} index - 分页组项索引
|
|
16
|
+
*/
|
|
7
17
|
let TOKEN = 0;
|
|
8
18
|
</script>
|
|
9
19
|
<script setup>
|
|
@@ -19,34 +29,95 @@ import Controller from "./Controller.vue";
|
|
|
19
29
|
import { onMounted, ref } from "vue";
|
|
20
30
|
|
|
21
31
|
const props = defineProps({
|
|
32
|
+
/**
|
|
33
|
+
* 组件名称标识
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @required
|
|
36
|
+
*/
|
|
22
37
|
name: {
|
|
23
38
|
type: String,
|
|
39
|
+
required: true,
|
|
24
40
|
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 列表布局配置
|
|
44
|
+
* @type {Object}
|
|
45
|
+
* @required
|
|
46
|
+
* @property {number} left - 列表左侧位置
|
|
47
|
+
* @property {number} top - 列表顶部位置
|
|
48
|
+
* @property {number} width - 列表宽度
|
|
49
|
+
* @property {number} height - 列表高度
|
|
50
|
+
*/
|
|
25
51
|
listLayout: {
|
|
26
52
|
type: Object,
|
|
27
53
|
required: true,
|
|
28
54
|
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 分页器布局配置
|
|
58
|
+
* @type {Object}
|
|
59
|
+
* @required
|
|
60
|
+
* @property {number} left - 分页器左侧位置
|
|
61
|
+
* @property {number} top - 分页器顶部位置
|
|
62
|
+
* @property {number} width - 分页器宽度
|
|
63
|
+
* @property {number} height - 分页器高度
|
|
64
|
+
*/
|
|
29
65
|
groupLayout: {
|
|
30
66
|
type: Object,
|
|
31
67
|
required: true,
|
|
32
68
|
},
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 每页显示项数
|
|
72
|
+
* @type {number}
|
|
73
|
+
* @default 10
|
|
74
|
+
*/
|
|
33
75
|
numPerPage: {
|
|
34
76
|
type: Number,
|
|
35
77
|
default: 10,
|
|
36
78
|
},
|
|
37
|
-
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 列表项测量函数
|
|
82
|
+
* @type {Function}
|
|
83
|
+
* @required
|
|
84
|
+
* @param {number} index - 当前项索引
|
|
85
|
+
* @returns {Object} 包含尺寸和数据的对象
|
|
86
|
+
* @returns {number} return.width - 项宽度
|
|
87
|
+
* @returns {number} return.height - 项高度
|
|
88
|
+
* @returns {number} [return.marginRight] - 右侧间距
|
|
89
|
+
* @returns {Object} return.data - 项数据
|
|
90
|
+
*/
|
|
38
91
|
listMeasures: {
|
|
39
92
|
type: Function,
|
|
40
93
|
},
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 分页组测量函数
|
|
97
|
+
* @type {Function}
|
|
98
|
+
* @required
|
|
99
|
+
*/
|
|
41
100
|
groupMeasures: {
|
|
42
101
|
type: Function,
|
|
43
102
|
},
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 总项数
|
|
106
|
+
* @type {number}
|
|
107
|
+
* @required
|
|
108
|
+
*/
|
|
44
109
|
totalNumber: {
|
|
45
110
|
type: Number,
|
|
46
111
|
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 列表内边距配置
|
|
115
|
+
* @type {Object}
|
|
116
|
+
* @optional
|
|
117
|
+
*/
|
|
47
118
|
listPadding: {
|
|
48
119
|
type: Object,
|
|
49
|
-
}
|
|
120
|
+
}
|
|
50
121
|
});
|
|
51
122
|
|
|
52
123
|
const controller = ref(null);
|
|
@@ -118,6 +189,9 @@ const onFocus = () => {
|
|
|
118
189
|
|
|
119
190
|
onMounted(() => {});
|
|
120
191
|
|
|
192
|
+
/**
|
|
193
|
+
* 处理组件获取焦点时的操作
|
|
194
|
+
*/
|
|
121
195
|
function componentOnFocus() {
|
|
122
196
|
focusHub.setFocus(curFocusName);
|
|
123
197
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import Fireworks from "./Fireworks.vue";
|
|
8
8
|
|
|
9
9
|
const config = {
|
|
10
|
-
group1_1: "https://
|
|
10
|
+
group1_1: "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/firework1/group1_1.png",
|
|
11
11
|
group1_2: "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/firework1/group1_2.png",
|
|
12
12
|
group2_1: "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/firework1/group2_1.png",
|
|
13
13
|
group2_2: "https://oss.image.qcast.cn/JsViewVideo/ImageTestSample/JsViewFrameworkDemo/firework1/group2_2.png",
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* 【模块 export 内容】
|
|
3
|
-
* Fireworks:放烟花组件
|
|
4
|
-
* props说明:
|
|
5
|
-
* left {Number} 烟花Left位置
|
|
6
|
-
* top {Number} 烟花Top位置
|
|
7
|
-
*
|
|
8
|
-
-->
|
|
1
|
+
|
|
9
2
|
<template>
|
|
10
3
|
<JsvPreload
|
|
11
4
|
:preloadList="preload_info"
|
|
@@ -154,10 +147,56 @@ import {
|
|
|
154
147
|
} from "jsview";
|
|
155
148
|
import { _formatInfo } from "./SpriteDeal";
|
|
156
149
|
import { shallowRef, onMounted, onBeforeUnmount, watch } from "vue";
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 组件属性定义
|
|
153
|
+
*/
|
|
157
154
|
const props = defineProps({
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
/**
|
|
156
|
+
* 烟花中心顶部位置
|
|
157
|
+
* @type {Number}
|
|
158
|
+
* @required
|
|
159
|
+
* @default undefined
|
|
160
|
+
* @unit px
|
|
161
|
+
*/
|
|
162
|
+
top: {
|
|
163
|
+
type: Number,
|
|
164
|
+
require: true
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 烟花中心左侧位置
|
|
169
|
+
* @type {Number}
|
|
170
|
+
* @required
|
|
171
|
+
* @default undefined
|
|
172
|
+
* @unit px
|
|
173
|
+
*/
|
|
174
|
+
left: {
|
|
175
|
+
type: Number,
|
|
176
|
+
require: true
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* 资源路径配置对象
|
|
181
|
+
* @type {Object}
|
|
182
|
+
* @required
|
|
183
|
+
* @property {String} group1_1 粒子效果组1-1图片路径
|
|
184
|
+
* @property {String} group1_2 粒子效果组1-2图片路径
|
|
185
|
+
* @property {String} group2_1 粒子效果组2-1图片路径
|
|
186
|
+
* @property {String} group2_2 粒子效果组2-2图片路径
|
|
187
|
+
* @property {String} group3_1 粒子效果组3-1图片路径
|
|
188
|
+
* @property {String} group3_2 粒子效果组3-2图片路径
|
|
189
|
+
* @property {String} group4_1 粒子效果组4-1图片路径
|
|
190
|
+
* @property {String} group4_2 粒子效果组4-2图片路径
|
|
191
|
+
* @property {String} group5_1 粒子效果组5-1图片路径
|
|
192
|
+
* @property {String} group5_2 粒子效果组5-2图片路径
|
|
193
|
+
* @property {String} ammo 弹药轨迹图片路径
|
|
194
|
+
* @property {String} fireworkSpriteSrc 烟花精灵图路径
|
|
195
|
+
*/
|
|
196
|
+
srcConfig: {
|
|
197
|
+
type: Object,
|
|
198
|
+
require: true
|
|
199
|
+
}
|
|
161
200
|
});
|
|
162
201
|
|
|
163
202
|
//火花图片素材
|
|
@@ -63,18 +63,39 @@ import {
|
|
|
63
63
|
} from "jsview";
|
|
64
64
|
|
|
65
65
|
const props = defineProps({
|
|
66
|
+
/**
|
|
67
|
+
* 布局配置对象(必填)
|
|
68
|
+
* @type {Object}
|
|
69
|
+
* @property {number} left - 组件左侧位置(单位:px)
|
|
70
|
+
* @property {number} top - 组件顶部位置(单位:px)
|
|
71
|
+
* @property {number} width - 组件宽度(单位:px)
|
|
72
|
+
* @property {number} height - 组件高度(单位:px)
|
|
73
|
+
*/
|
|
66
74
|
layout: {
|
|
67
75
|
type: Object,
|
|
68
76
|
required: true,
|
|
69
77
|
},
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 翻页动画持续时间(单位:秒)
|
|
81
|
+
* @type {number}
|
|
82
|
+
* @default 1
|
|
83
|
+
*/
|
|
70
84
|
duration: {
|
|
71
85
|
type: Number,
|
|
72
86
|
default: 1,
|
|
73
87
|
},
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 初始显示状态
|
|
91
|
+
* @type {boolean}
|
|
92
|
+
* @default true
|
|
93
|
+
* @description true表示初始显示内容,false表示初始隐藏内容
|
|
94
|
+
*/
|
|
74
95
|
initShow: {
|
|
75
96
|
type: Boolean,
|
|
76
97
|
default: true,
|
|
77
|
-
}
|
|
98
|
+
}
|
|
78
99
|
});
|
|
79
100
|
|
|
80
101
|
const showOrigin = shallowRef(props.initShow);
|
|
@@ -137,6 +158,13 @@ function capture() {
|
|
|
137
158
|
}
|
|
138
159
|
|
|
139
160
|
defineExpose({
|
|
161
|
+
/**
|
|
162
|
+
* 切换显示/隐藏状态
|
|
163
|
+
* @method
|
|
164
|
+
* @description 触发翻页动画切换:
|
|
165
|
+
* - 当前显示时调用会执行翻出动画
|
|
166
|
+
* - 当前隐藏时调用会执行翻入动画
|
|
167
|
+
*/
|
|
140
168
|
switch() {
|
|
141
169
|
if (state == 0) {
|
|
142
170
|
state = 1;
|
|
@@ -6,32 +6,57 @@
|
|
|
6
6
|
:centerWidth="2"
|
|
7
7
|
:imageDspWidth="sampleImageWidth"
|
|
8
8
|
:borderOutset="borderWidth"
|
|
9
|
-
animation="
|
|
9
|
+
:animation="anim"
|
|
10
10
|
/>
|
|
11
11
|
</template>
|
|
12
12
|
<script setup>
|
|
13
13
|
import { JsvNinePatch, JsvTextureStoreApi } from "jsview";
|
|
14
|
-
import { onBeforeUnmount } from "vue";
|
|
14
|
+
import { onBeforeUnmount, computed } from "vue";
|
|
15
15
|
|
|
16
16
|
const props = defineProps({
|
|
17
|
+
/**
|
|
18
|
+
* 焦点框颜色
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
17
21
|
color: {
|
|
18
22
|
type: String,
|
|
19
23
|
},
|
|
24
|
+
/**
|
|
25
|
+
* 布局样式对象
|
|
26
|
+
* @type {Object}
|
|
27
|
+
*/
|
|
20
28
|
layout: {
|
|
21
29
|
type: Object,
|
|
22
30
|
},
|
|
31
|
+
/**
|
|
32
|
+
* 边框宽度
|
|
33
|
+
* @type {number}
|
|
34
|
+
*/
|
|
23
35
|
borderWidth: {
|
|
24
36
|
type: Number,
|
|
25
37
|
},
|
|
38
|
+
/**
|
|
39
|
+
* 呼吸动画周期时长(单位:秒)
|
|
40
|
+
* @type {number}
|
|
41
|
+
*/
|
|
26
42
|
duration: {
|
|
27
43
|
type: Number
|
|
28
44
|
},
|
|
45
|
+
/**
|
|
46
|
+
* 圆角半径
|
|
47
|
+
* @type {number}
|
|
48
|
+
* @default 10
|
|
49
|
+
*/
|
|
29
50
|
borderRadius: {
|
|
30
51
|
type: Number,
|
|
31
52
|
default: 10,
|
|
32
53
|
}
|
|
33
54
|
});
|
|
34
55
|
|
|
56
|
+
const anim = computed(() => {
|
|
57
|
+
return props.duration ? `breath ${props.duration}s infinite` : 'breath 2s infinite';
|
|
58
|
+
});
|
|
59
|
+
|
|
35
60
|
let canvasRef;
|
|
36
61
|
let circleRadius = props.borderRadius;
|
|
37
62
|
let sampleImageWidth = circleRadius * 2 + props.borderWidth + 2;
|
|
@@ -15,30 +15,71 @@
|
|
|
15
15
|
|
|
16
16
|
<script setup>
|
|
17
17
|
import RotateFrame from "./utils/RotateFrame.vue";
|
|
18
|
+
|
|
18
19
|
const props = defineProps({
|
|
20
|
+
/**
|
|
21
|
+
* 聚焦框使用的图片资源路径
|
|
22
|
+
* @type {String}
|
|
23
|
+
* @required
|
|
24
|
+
*/
|
|
19
25
|
src: {
|
|
20
26
|
type: String,
|
|
21
27
|
required: true,
|
|
22
28
|
},
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 布局位置和尺寸配置
|
|
32
|
+
* @type {Object}
|
|
33
|
+
* @property {number} left - 左侧定位(单位:像素)
|
|
34
|
+
* @property {number} top - 顶部定位(单位:像素)
|
|
35
|
+
* @property {number} width - 容器宽度(单位:像素)
|
|
36
|
+
* @property {number} height - 容器高度(单位:像素)
|
|
37
|
+
*/
|
|
23
38
|
layout: {
|
|
24
39
|
type: Object,
|
|
25
40
|
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 边框线宽(单位:像素)
|
|
44
|
+
* @type {Number}
|
|
45
|
+
* @default 6
|
|
46
|
+
*/
|
|
26
47
|
borderWidth: {
|
|
27
48
|
type: Number,
|
|
28
49
|
default: 6,
|
|
29
50
|
},
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 边框圆角半径(单位:像素)
|
|
54
|
+
* @type {Number}
|
|
55
|
+
*/
|
|
30
56
|
borderRadius: {
|
|
31
57
|
type: Number,
|
|
32
58
|
},
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 边框旋转一周所需时间(单位:秒)
|
|
62
|
+
* @type {Number}
|
|
63
|
+
*/
|
|
33
64
|
circleTime: {
|
|
34
|
-
//秒
|
|
35
65
|
type: Number,
|
|
36
66
|
},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 是否显示光晕效果
|
|
70
|
+
* @type {Boolean}
|
|
71
|
+
*/
|
|
37
72
|
withHalo: {
|
|
38
73
|
type: Boolean,
|
|
39
74
|
},
|
|
40
75
|
});
|
|
41
76
|
|
|
77
|
+
/**
|
|
78
|
+
* 纹理坐标最大视图尺寸配置
|
|
79
|
+
* @type {Object}
|
|
80
|
+
* @property {number} width - 最大视图宽度
|
|
81
|
+
* @property {number} height - 最大视图高度
|
|
82
|
+
*/
|
|
42
83
|
const texCoord = {
|
|
43
84
|
width: 500,
|
|
44
85
|
height: 500,
|
|
@@ -12,17 +12,25 @@
|
|
|
12
12
|
import { JsvNinePatch, JsvTextureStoreApi } from "jsview";
|
|
13
13
|
import { onBeforeUnmount } from "vue";
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* 定义组件属性
|
|
17
|
+
* @type {Props}
|
|
18
|
+
*/
|
|
15
19
|
const props = defineProps({
|
|
20
|
+
/** @type {String} 边框颜色 */
|
|
16
21
|
color: {
|
|
17
22
|
type: String,
|
|
18
23
|
},
|
|
24
|
+
/** @type {Object} 布局样式配置 */
|
|
19
25
|
layout: {
|
|
20
26
|
type: Object
|
|
21
27
|
},
|
|
28
|
+
/** @type {Number} 边框宽度(默认3像素) */
|
|
22
29
|
borderWidth: {
|
|
23
30
|
type: Number,
|
|
24
31
|
default: 3,
|
|
25
32
|
},
|
|
33
|
+
/** @type {Number} 圆角半径(默认0像素) */
|
|
26
34
|
borderRadius: {
|
|
27
35
|
type: Number,
|
|
28
36
|
default: 0
|
|
@@ -47,6 +55,10 @@ canvasRef.drawColor("rgba(0,0,0,0)"); // 画布绘制半透明底色
|
|
|
47
55
|
customPath.stroke(circleLineWidth, props.color); // 以给定线宽绘制圆环
|
|
48
56
|
const sourceId = canvasRef.commit(); // texture和div的textureStore绑定
|
|
49
57
|
|
|
58
|
+
/**
|
|
59
|
+
* 组件卸载前的清理操作
|
|
60
|
+
* @listens onBeforeUnmount
|
|
61
|
+
*/
|
|
50
62
|
onBeforeUnmount(() => {
|
|
51
63
|
JsvTextureStoreApi.deleteTexture(sourceId);
|
|
52
64
|
});
|