@shijiu/jsview-vue-samples 2.1.25 → 2.1.200
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/Basic/components/div/DivBackground.vue +53 -24
- package/BreakRender/App.vue +69 -0
- package/BreakRender/Item.vue +77 -0
- package/BreakRender/assets/imageList.json +237 -0
- package/BreakRender/data.js +18 -0
- package/ClassDynamicSwitching/App.vue +83 -0
- package/ClassDynamicSwitching/components/ClassItem.vue +257 -0
- package/ClassDynamicSwitching/components/ClassShow.vue +78 -0
- package/ClassDynamicSwitching/components/StyleItem.vue +165 -0
- package/ClassDynamicSwitching/components/StyleShow.vue +68 -0
- package/DemoHomepage/router.js +67 -13
- package/DemoHomepage/views/Homepage.vue +13 -2
- package/DynamicClass/App.vue +115 -0
- package/DynamicClass/components/FloorItem.vue +55 -0
- package/DynamicClass/components/FloorList.vue +210 -0
- package/DynamicClass/style1.json +163 -0
- package/DynamicClass/style2.json +164 -0
- package/FilterDemo/App.vue +1 -1
- package/FocusMoveStyle/App.vue +10 -2
- package/FreeMove/App.vue +291 -0
- package/GetBoundingClientRect/App.vue +177 -0
- package/GiftRain/App.vue +3 -3
- package/JsvLine/App.vue +116 -0
- package/JsvLine/bgimage.jpg +0 -0
- package/JsvPreDownloader/App.vue +17 -10
- package/LatexDemo/App.vue +66 -0
- package/LatexFormula/App.vue +65 -0
- package/Marquee/App.vue +711 -183
- package/MetroWidgetDemos/PingPong/App.vue +0 -9
- package/MetroWidgetDemos/PingPong/AppPage.vue +2 -1
- package/MetroWidgetDemos/PingPong/WidgetItem.vue +0 -5
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +3 -1
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +5 -0
- package/MetroWidgetDemos/itemSizeUpdate/App.vue +11 -4
- package/MetroWidgetDemos/itemSizeUpdate/backward/Backward.vue +6 -4
- package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +2 -25
- package/MetroWidgetDemos/itemSizeUpdate/center/Center.vue +6 -6
- package/MetroWidgetDemos/itemSizeUpdate/center/Item.vue +38 -49
- package/MetroWidgetDemos/itemSizeUpdate/stretch/App.vue +122 -0
- package/MetroWidgetDemos/itemSizeUpdate/stretch/Item.vue +105 -0
- package/MindMap/App.vue +61 -0
- package/MindMap/Item.vue +40 -0
- package/MindMap/data.js +86 -0
- package/Preload/App.vue +25 -18
- package/Preload/Item.vue +1 -1
- package/Preload/data.js +12 -12
- package/Preload/images/bg_btn.png +0 -0
- package/Preload/images/bg_btn_focus.png +0 -0
- package/Preload/images/btn_cancle.png +0 -0
- package/Preload/images/btn_ok.png +0 -0
- package/Preload/images/tease.png +0 -0
- package/Preload/images/tease_lock.png +0 -0
- package/SecTorTest/App.vue +106 -0
- package/TextureStoreTest/App.vue +168 -0
- package/VisibleSensorDemo/App.vue +38 -18
- package/package.json +1 -1
- package/Preload/images/rank.png +0 -0
- package/Preload/images/rank_focus.png +0 -0
- package/Preload/images/rule.png +0 -0
- package/Preload/images/rule_focus.png +0 -0
- package/Preload/images/start.png +0 -0
- package/Preload/images/start_focus.png +0 -0
package/MindMap/Item.vue
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
data: Object,
|
|
6
|
+
onAction: Object,
|
|
7
|
+
handler: Object,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const focused = ref(false);
|
|
11
|
+
|
|
12
|
+
// 注册回调
|
|
13
|
+
const onFocus = () => {
|
|
14
|
+
console.log("item onfocus", props.data.id)
|
|
15
|
+
focused.value = true;
|
|
16
|
+
};
|
|
17
|
+
const onBlur = () => {
|
|
18
|
+
console.log("item onblur", props.data.id)
|
|
19
|
+
focused.value = false;
|
|
20
|
+
};
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
console.log("item onclick ", props.data);
|
|
23
|
+
};
|
|
24
|
+
props.onAction.register("onFocus", onFocus);
|
|
25
|
+
props.onAction.register("onBlur", onBlur);
|
|
26
|
+
props.onAction.register("onClick", onClick);
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div
|
|
31
|
+
:style="{
|
|
32
|
+
width: data.width,
|
|
33
|
+
height: data.height,
|
|
34
|
+
fontSize: 30,
|
|
35
|
+
backgroundColor: focused ? '#aa0000aa' : '#007788aa',
|
|
36
|
+
}"
|
|
37
|
+
>
|
|
38
|
+
{{ data.id }}
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
package/MindMap/data.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
let id = 0;
|
|
2
|
+
const n = (left, top) => {
|
|
3
|
+
return {
|
|
4
|
+
left,
|
|
5
|
+
top,
|
|
6
|
+
width: 50,
|
|
7
|
+
height: 50,
|
|
8
|
+
id: id++,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export const data = {
|
|
12
|
+
...n(400, 500),
|
|
13
|
+
moveType: "star",
|
|
14
|
+
children: [
|
|
15
|
+
{
|
|
16
|
+
...n(300, 500),
|
|
17
|
+
children: [
|
|
18
|
+
{
|
|
19
|
+
...n(200, 400)
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
...n(200, 600),
|
|
23
|
+
children: [
|
|
24
|
+
{
|
|
25
|
+
...n(100, 600,)
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
...n(400, 400),
|
|
33
|
+
children: [
|
|
34
|
+
{
|
|
35
|
+
...n(400, 300),
|
|
36
|
+
children: [
|
|
37
|
+
{
|
|
38
|
+
...n(300, 200),
|
|
39
|
+
children: {
|
|
40
|
+
...n(300, 100)
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
...n(400, 200)
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
...n(500, 200)
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
...n(500, 500),
|
|
55
|
+
children: [
|
|
56
|
+
{
|
|
57
|
+
...n(600, 400),
|
|
58
|
+
children: [
|
|
59
|
+
{
|
|
60
|
+
...n(700, 400)
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
...n(600, 500)
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
...n(600, 600)
|
|
69
|
+
},
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
...n(400, 600),
|
|
74
|
+
children: [
|
|
75
|
+
{
|
|
76
|
+
...n(400, 700),
|
|
77
|
+
children: [
|
|
78
|
+
{
|
|
79
|
+
...n(400, 800)
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
]
|
|
86
|
+
}
|
package/Preload/App.vue
CHANGED
|
@@ -11,14 +11,14 @@ import awesome from "./images/awesomeface.png";
|
|
|
11
11
|
import cat from "./images/cat.jpg";
|
|
12
12
|
import { data } from "./data.js";
|
|
13
13
|
import Item from "./Item.vue";
|
|
14
|
-
import { ref } from "vue";
|
|
14
|
+
import { ref,reactive } from "vue";
|
|
15
15
|
import { useRouter } from "vue-router";
|
|
16
16
|
|
|
17
17
|
const name = "/preload";
|
|
18
18
|
const focusHub = useFocusHub();
|
|
19
19
|
const text = ref("");
|
|
20
20
|
let preloadInfo = ref([]);
|
|
21
|
-
let downloadInfo =
|
|
21
|
+
let downloadInfo = reactive([]);
|
|
22
22
|
|
|
23
23
|
const router = useRouter();
|
|
24
24
|
|
|
@@ -37,9 +37,10 @@ const _onDownloadDone = (urls, extra) => {
|
|
|
37
37
|
|
|
38
38
|
const _measures = () => {
|
|
39
39
|
return {
|
|
40
|
-
width:
|
|
40
|
+
width: 240,
|
|
41
41
|
height: 90,
|
|
42
42
|
focusable: true,
|
|
43
|
+
marginRight: 20
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
|
|
@@ -54,22 +55,16 @@ const _onFocus = () => {
|
|
|
54
55
|
focusHub.setFocus(name);
|
|
55
56
|
};
|
|
56
57
|
|
|
57
|
-
setTimeout(() => {
|
|
58
|
+
setTimeout(() => {
|
|
58
59
|
console.log("change data")
|
|
59
|
-
const preload = []
|
|
60
60
|
for (const item of data) {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
preloadInfo.value.push(buildPreloadInfo(item.url));
|
|
62
|
+
preloadInfo.value.push(buildPreloadInfo(item.focusUrl));
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
buildDownloadInfo(awesome, null, true),
|
|
69
|
-
buildDownloadInfo(cat, null, true),
|
|
70
|
-
buildDownloadInfo(null), // 测试URL为null的加载
|
|
71
|
-
];
|
|
72
|
-
downloadInfo.value = download;
|
|
64
|
+
preloadInfo.value.push(null,null,buildPreloadInfo(null)); // 测试item为null的加载
|
|
65
|
+
downloadInfo.push(buildDownloadInfo(awesome, null, true),buildDownloadInfo(cat, null, true))
|
|
66
|
+
//测试null
|
|
67
|
+
downloadInfo.push(buildDownloadInfo(null),buildDownloadInfo(null),buildDownloadInfo(cat, null, true),null,null,null)
|
|
73
68
|
}, 1000);
|
|
74
69
|
</script>
|
|
75
70
|
|
|
@@ -101,10 +96,22 @@ setTimeout(() => {
|
|
|
101
96
|
>
|
|
102
97
|
预加载后,图片(按钮焦点切换)切换不闪屏
|
|
103
98
|
</div>
|
|
104
|
-
<div
|
|
99
|
+
<div
|
|
100
|
+
:style="{
|
|
101
|
+
textAlign: 'center',
|
|
102
|
+
fontSize: 30,
|
|
103
|
+
lineHeight: 50,
|
|
104
|
+
left: 100,
|
|
105
|
+
top: 120,
|
|
106
|
+
width: 1280 - 200,
|
|
107
|
+
height: 50,
|
|
108
|
+
}">
|
|
109
|
+
按左右键移动
|
|
110
|
+
</div>
|
|
111
|
+
<div :style="{ top: 200, left: 260 }">
|
|
105
112
|
<metro-widget
|
|
106
113
|
:name="name"
|
|
107
|
-
:width="
|
|
114
|
+
:width="760"
|
|
108
115
|
:height="90"
|
|
109
116
|
:direction="HORIZONTAL"
|
|
110
117
|
:data="data"
|
package/Preload/Item.vue
CHANGED
package/Preload/data.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import redBtn from "./images/bg_btn.png";
|
|
2
|
+
import redBtnF from "./images/bg_btn_focus.png";
|
|
3
|
+
import blueBtn from "./images/btn_cancle.png";
|
|
4
|
+
import blueBtnF from "./images/btn_ok.png";
|
|
5
|
+
import greenBtn from "./images/tease_lock.png";
|
|
6
|
+
import greenBtnF from "./images/tease.png";
|
|
7
7
|
|
|
8
8
|
const data = [
|
|
9
9
|
{
|
|
10
|
-
url:
|
|
11
|
-
focusUrl:
|
|
10
|
+
url: redBtn,
|
|
11
|
+
focusUrl: redBtnF,
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
url:
|
|
15
|
-
focusUrl:
|
|
14
|
+
url: blueBtn,
|
|
15
|
+
focusUrl: blueBtnF
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
url:
|
|
19
|
-
focusUrl:
|
|
18
|
+
url: greenBtn,
|
|
19
|
+
focusUrl: greenBtnF,
|
|
20
20
|
},
|
|
21
21
|
];
|
|
22
22
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<jsv-focus-block autoFocus :onAction="actionDefines">
|
|
3
|
+
<div class="bgStyle">
|
|
4
|
+
<JsvPieChart
|
|
5
|
+
:centerPosition="center"
|
|
6
|
+
:radius="360"
|
|
7
|
+
:data="data"
|
|
8
|
+
></JsvPieChart>
|
|
9
|
+
<!-- 文字说明 -->
|
|
10
|
+
<div class="text">
|
|
11
|
+
{{
|
|
12
|
+
"图为圆心在(400,400)位置,半径为360的饼图。"
|
|
13
|
+
}}
|
|
14
|
+
</div>
|
|
15
|
+
<!-- 操作说明 -->
|
|
16
|
+
<div class="text1">
|
|
17
|
+
{{ "按上方向键随机板块增加百分比,按下方向键随机减小板块百分比" }}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</jsv-focus-block>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import { reactive } from "vue";
|
|
25
|
+
import { JsvPieChart } from "jsview";
|
|
26
|
+
const center = {
|
|
27
|
+
x: 400,
|
|
28
|
+
y: 400,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
let data = reactive([
|
|
32
|
+
{
|
|
33
|
+
percent: 23.33,
|
|
34
|
+
color: "#0000FF",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
percent: 24.67,
|
|
38
|
+
color: "#FFFF00",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
percent: 15,
|
|
42
|
+
color: "#FF12FF",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
percent: 13,
|
|
46
|
+
color: "#FF1213",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
percent: 24,
|
|
50
|
+
color: "#6EFFE1",
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
// 生成随机整数
|
|
55
|
+
const randomNumber = () => {
|
|
56
|
+
const randomInt = Math.floor(Math.random() * 4) + 1;
|
|
57
|
+
return randomInt;
|
|
58
|
+
};
|
|
59
|
+
const onKeyDown = (ev) => {
|
|
60
|
+
if (ev.keyCode === 38) {
|
|
61
|
+
let total = 0;
|
|
62
|
+
for (let i = 0; i < data.length - 1; i++) {
|
|
63
|
+
data[i].percent += randomNumber();
|
|
64
|
+
total += data[i].percent;
|
|
65
|
+
}
|
|
66
|
+
data[4].percent = 100 - total;
|
|
67
|
+
} else if (ev.keyCode === 40) {
|
|
68
|
+
// 随机减;
|
|
69
|
+
let total = 0;
|
|
70
|
+
for (let i = 0; i < data.length - 1; i++) {
|
|
71
|
+
data[i].percent -= randomNumber();
|
|
72
|
+
total += data[i].percent;
|
|
73
|
+
}
|
|
74
|
+
data[4].percent = 100 - total;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
let actionDefines = {
|
|
78
|
+
onKeyDown,
|
|
79
|
+
};
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="css" scoped>
|
|
83
|
+
.bgStyle {
|
|
84
|
+
width: 1280;
|
|
85
|
+
height: 720;
|
|
86
|
+
background-color: #007788;
|
|
87
|
+
}
|
|
88
|
+
.text {
|
|
89
|
+
width: 280;
|
|
90
|
+
height: 60;
|
|
91
|
+
left: 700;
|
|
92
|
+
top: 300;
|
|
93
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
94
|
+
font-size: 24;
|
|
95
|
+
line-height: 28;
|
|
96
|
+
}
|
|
97
|
+
.text1 {
|
|
98
|
+
width: 500;
|
|
99
|
+
height: 60;
|
|
100
|
+
left: 700;
|
|
101
|
+
top: 440;
|
|
102
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
103
|
+
font-size: 24;
|
|
104
|
+
line-height: 28;
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bgStyle">
|
|
3
|
+
<!-- 半圆 -->
|
|
4
|
+
<div
|
|
5
|
+
class="logo-bg"
|
|
6
|
+
:style="{
|
|
7
|
+
left: 200,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<img :src="`jsvtexturestore://${sourceId}`" class="logo-size" :style="{
|
|
11
|
+
left:50,
|
|
12
|
+
top:50
|
|
13
|
+
}" />
|
|
14
|
+
</div>
|
|
15
|
+
<!-- 圆框点九 -->
|
|
16
|
+
<div
|
|
17
|
+
class="logo-bg"
|
|
18
|
+
:style="{
|
|
19
|
+
left: 700,
|
|
20
|
+
top: 0,
|
|
21
|
+
}"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
class="logo-size"
|
|
25
|
+
:style="{
|
|
26
|
+
borderRadius: 60,
|
|
27
|
+
left: 50,
|
|
28
|
+
backgroundColor: '#FF1213',
|
|
29
|
+
top: 50,
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<JsvNinePatch
|
|
33
|
+
:style="{
|
|
34
|
+
left: 0,
|
|
35
|
+
top: 0,
|
|
36
|
+
width: 200,
|
|
37
|
+
height: 200,
|
|
38
|
+
}"
|
|
39
|
+
:imageUrl="`jsvtexturestore://${sourceId2}`"
|
|
40
|
+
:imageWidth="136"
|
|
41
|
+
:centerWidth="1"
|
|
42
|
+
:imageDspWidth="136"
|
|
43
|
+
:borderOutset="8"
|
|
44
|
+
:animTime="0"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<!-- 方框点九 -->
|
|
49
|
+
<div class="logo-bg" :style="{ left: 200, top: 360 }">
|
|
50
|
+
<div
|
|
51
|
+
class="logo-size"
|
|
52
|
+
:style="{
|
|
53
|
+
left: 50,
|
|
54
|
+
backgroundColor: '#FF1213',
|
|
55
|
+
top: 50,
|
|
56
|
+
}"
|
|
57
|
+
>
|
|
58
|
+
<JsvNinePatch
|
|
59
|
+
:style="{
|
|
60
|
+
left: 0,
|
|
61
|
+
top: 0,
|
|
62
|
+
width: 200,
|
|
63
|
+
height: 200,
|
|
64
|
+
}"
|
|
65
|
+
:imageUrl="`jsvtexturestore://${sourceId3}`"
|
|
66
|
+
:imageWidth="136"
|
|
67
|
+
:centerWidth="1"
|
|
68
|
+
:imageDspWidth="136"
|
|
69
|
+
:borderOutset="6"
|
|
70
|
+
:animTime="0"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<!-- 文字说明 -->
|
|
75
|
+
<div class="text" :style="{top:320,left:200}">{{ '半圆' }}</div>
|
|
76
|
+
<div class="text" :style="{top:320,left:700}">{{ '圆角NinePatch' }}</div>
|
|
77
|
+
<div class="text" :style="{top:680,left:200}">{{ '直角NinePatch' }}</div>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script setup>
|
|
82
|
+
import JsvNinePatch from "@shijiu/jsview-vue/utils/JsViewVueWidget/JsvNinePatch.vue";
|
|
83
|
+
import { shallowRef, onBeforeUnmount } from "vue";
|
|
84
|
+
import { JsvTextureStoreApi } from "jsview";
|
|
85
|
+
let canvasRef;
|
|
86
|
+
let canvasRef2;
|
|
87
|
+
let canvasRef3;
|
|
88
|
+
let sourceId = shallowRef("");
|
|
89
|
+
let sourceId2 = shallowRef("");
|
|
90
|
+
let sourceId3 = shallowRef("");
|
|
91
|
+
let bitmap = {
|
|
92
|
+
width: 150,
|
|
93
|
+
height: 150,
|
|
94
|
+
};
|
|
95
|
+
let bitmap2 = {
|
|
96
|
+
width: 136,
|
|
97
|
+
height: 136,
|
|
98
|
+
};
|
|
99
|
+
let bitmap3 = {
|
|
100
|
+
width: 136,
|
|
101
|
+
height: 136,
|
|
102
|
+
};
|
|
103
|
+
canvasRef = JsvTextureStoreApi.canvasTexture(bitmap.width, bitmap.height);
|
|
104
|
+
canvasRef2 = JsvTextureStoreApi.canvasTexture(bitmap2.width, bitmap2.height);
|
|
105
|
+
canvasRef3 = JsvTextureStoreApi.canvasTexture(bitmap3.width, bitmap3.height);
|
|
106
|
+
//第一个图
|
|
107
|
+
let centerX = bitmap.width / 2;
|
|
108
|
+
let centerY = bitmap.height / 2;
|
|
109
|
+
let radius = 50;
|
|
110
|
+
|
|
111
|
+
let startAngle = 0; // 起始角度
|
|
112
|
+
let sweepAngle = 180; // 扫描角度
|
|
113
|
+
let customPath = canvasRef.customPath();
|
|
114
|
+
customPath.arcTo(
|
|
115
|
+
centerX - radius,
|
|
116
|
+
centerY - radius,
|
|
117
|
+
centerX + radius,
|
|
118
|
+
centerY + radius,
|
|
119
|
+
startAngle,
|
|
120
|
+
sweepAngle
|
|
121
|
+
);
|
|
122
|
+
// 闭合路径,绘制实心扇形
|
|
123
|
+
customPath.close();
|
|
124
|
+
customPath.fill("#FF0000");
|
|
125
|
+
|
|
126
|
+
sourceId.value = canvasRef.commit();
|
|
127
|
+
|
|
128
|
+
//第二个图
|
|
129
|
+
let radius2 = 60;
|
|
130
|
+
let customPath2 = canvasRef2.circlePath(68, 68, radius2);
|
|
131
|
+
customPath2.stroke(6, "#87CEEB");
|
|
132
|
+
sourceId2.value = canvasRef2.commit();
|
|
133
|
+
//第三个图
|
|
134
|
+
let customPath3 = canvasRef3.rectPath(3, 3, 133, 133);
|
|
135
|
+
customPath3.stroke(6, "#87CEEB");
|
|
136
|
+
sourceId3.value = canvasRef3.commit();
|
|
137
|
+
|
|
138
|
+
onBeforeUnmount(() => {
|
|
139
|
+
JsvTextureStoreApi.deleteTexture(sourceId.value);
|
|
140
|
+
JsvTextureStoreApi.deleteTexture(sourceId2.value);
|
|
141
|
+
JsvTextureStoreApi.deleteTexture(sourceId3.value);
|
|
142
|
+
});
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<style lang="css" scoped>
|
|
146
|
+
.bgStyle {
|
|
147
|
+
width: 1280;
|
|
148
|
+
height: 720;
|
|
149
|
+
background-color: #007788;
|
|
150
|
+
}
|
|
151
|
+
.logo-size {
|
|
152
|
+
width: 200;
|
|
153
|
+
height: 200;
|
|
154
|
+
}
|
|
155
|
+
.logo-bg {
|
|
156
|
+
width: 300;
|
|
157
|
+
height: 300;
|
|
158
|
+
background-color: #007f00;
|
|
159
|
+
}
|
|
160
|
+
.text{
|
|
161
|
+
width:300;
|
|
162
|
+
height:30;
|
|
163
|
+
font-size: 28;
|
|
164
|
+
line-height: 30;
|
|
165
|
+
color: #FFFFFF;
|
|
166
|
+
text-align: center;
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { watch, reactive, onMounted,
|
|
2
|
+
import { watch, reactive, onMounted, onUnmounted, shallowRef } from "vue";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import { jJsvRuntimeBridge, JsvVisibleSensor } from "jsview";
|
|
5
5
|
|
|
@@ -10,31 +10,46 @@ const VISIBLE_RANGE = 0.25;
|
|
|
10
10
|
|
|
11
11
|
const router = useRouter();
|
|
12
12
|
|
|
13
|
-
const containerRef =
|
|
14
|
-
let case_config =
|
|
13
|
+
const containerRef = shallowRef(null);
|
|
14
|
+
let case_config = shallowRef(null);
|
|
15
15
|
let status_text = reactive({
|
|
16
16
|
oldH: "false",
|
|
17
17
|
newH: "false",
|
|
18
18
|
oldV: "false",
|
|
19
19
|
newV: "false",
|
|
20
20
|
});
|
|
21
|
+
let testCaseType = shallowRef(0);
|
|
22
|
+
let testBlinkType = shallowRef(false);
|
|
23
|
+
let altVisible = shallowRef("visible");
|
|
24
|
+
let altVisibleTimer = -1;
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
// window.LudlTestCase = testCaseType;
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
case_config.value = getTestCase(testCaseType.value);
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
watch(test_case_type, () => {
|
|
29
|
-
case_config.value = getTestCase(test_case_type.value);
|
|
30
|
+
watch(testCaseType, () => {
|
|
31
|
+
case_config.value = getTestCase(testCaseType.value);
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
onMounted(() => {
|
|
35
|
+
altVisibleTimer = setInterval(() => {
|
|
36
|
+
if (testBlinkType.value) {
|
|
37
|
+
altVisible.value = altVisible.value == "visible" ? "hidden" : "visible";
|
|
38
|
+
}
|
|
39
|
+
}, 500);
|
|
40
|
+
|
|
33
41
|
jJsvRuntimeBridge.notifyPageLoaded();
|
|
34
42
|
});
|
|
35
43
|
|
|
44
|
+
onUnmounted(() => {
|
|
45
|
+
if (altVisibleTimer != -1) {
|
|
46
|
+
clearInterval(altVisible);
|
|
47
|
+
altVisibleTimer = -1;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
36
51
|
// const onAnimDone = () => {
|
|
37
|
-
//
|
|
52
|
+
// testCaseType.value = (testCaseType.value + 1) % 2;
|
|
38
53
|
// };
|
|
39
54
|
|
|
40
55
|
// 内部接口
|
|
@@ -52,7 +67,11 @@ const onKeyDown = (ev) => {
|
|
|
52
67
|
return true;
|
|
53
68
|
}
|
|
54
69
|
if (ev.keyCode == 13) {
|
|
55
|
-
|
|
70
|
+
testCaseType.value = (testCaseType.value + 1) % 2;
|
|
71
|
+
}
|
|
72
|
+
if (ev.keyCode == 38) {
|
|
73
|
+
testBlinkType.value = testBlinkType.value ? false : true;
|
|
74
|
+
altVisible.value = "visible";
|
|
56
75
|
}
|
|
57
76
|
return false;
|
|
58
77
|
};
|
|
@@ -68,7 +87,7 @@ function getTestCase(test_index) {
|
|
|
68
87
|
switch (test_index) {
|
|
69
88
|
case 0: {
|
|
70
89
|
// 上到下
|
|
71
|
-
test_config.animation = "visibleSensor_upDown
|
|
90
|
+
test_config.animation = "visibleSensor_upDown 12s infinite linear";
|
|
72
91
|
test_config.text = "从上到下";
|
|
73
92
|
test_config.horizon = 1.0;
|
|
74
93
|
test_config.vertical = VISIBLE_RANGE;
|
|
@@ -76,7 +95,7 @@ function getTestCase(test_index) {
|
|
|
76
95
|
}
|
|
77
96
|
case 1: {
|
|
78
97
|
// 左到右
|
|
79
|
-
test_config.animation = "visibleSensor_leftRight
|
|
98
|
+
test_config.animation = "visibleSensor_leftRight 12s infinite linear";
|
|
80
99
|
test_config.text = "从左到右";
|
|
81
100
|
test_config.horizon = VISIBLE_RANGE;
|
|
82
101
|
test_config.vertical = 1.0;
|
|
@@ -103,7 +122,7 @@ function getTestCase(test_index) {
|
|
|
103
122
|
}"
|
|
104
123
|
>
|
|
105
124
|
{{
|
|
106
|
-
`按OK
|
|
125
|
+
`按OK键切换方向, 按UP键切换显隐测试
|
|
107
126
|
new horizon: ${status_text.newH}
|
|
108
127
|
new vertical: ${status_text.newV}
|
|
109
128
|
-------
|
|
@@ -128,7 +147,7 @@ old vertical: ${status_text.oldV}`
|
|
|
128
147
|
width: 200,
|
|
129
148
|
height: 200,
|
|
130
149
|
backgroundColor: '#00AAAA',
|
|
131
|
-
zIndex:
|
|
150
|
+
zIndex: testCaseType == 0 ? -22 : 0,
|
|
132
151
|
}"
|
|
133
152
|
/>
|
|
134
153
|
|
|
@@ -139,7 +158,7 @@ old vertical: ${status_text.oldV}`
|
|
|
139
158
|
width: 140,
|
|
140
159
|
height: 240,
|
|
141
160
|
backgroundColor: '#0000AA',
|
|
142
|
-
zIndex:
|
|
161
|
+
zIndex: testCaseType == 0 ? -33 : 0,
|
|
143
162
|
}"
|
|
144
163
|
/>
|
|
145
164
|
|
|
@@ -147,6 +166,7 @@ old vertical: ${status_text.oldV}`
|
|
|
147
166
|
:style="{
|
|
148
167
|
left: 0,
|
|
149
168
|
top: 0,
|
|
169
|
+
visibility: altVisible,
|
|
150
170
|
animation: case_config.animation,
|
|
151
171
|
}"
|
|
152
172
|
>
|
|
@@ -159,7 +179,7 @@ old vertical: ${status_text.oldV}`
|
|
|
159
179
|
:container="containerRef"
|
|
160
180
|
:callback="onBeVisible"
|
|
161
181
|
>
|
|
162
|
-
<div v-if="
|
|
182
|
+
<div v-if="testCaseType == 0">
|
|
163
183
|
<div
|
|
164
184
|
:style="{
|
|
165
185
|
width: BOX_WIDTH,
|
|
@@ -231,4 +251,4 @@ old vertical: ${status_text.oldV}`
|
|
|
231
251
|
transform: translate3d(330, 75, 0);
|
|
232
252
|
}
|
|
233
253
|
}
|
|
234
|
-
</style>
|
|
254
|
+
</style>
|
package/package.json
CHANGED
package/Preload/images/rank.png
DELETED
|
Binary file
|
|
Binary file
|
package/Preload/images/rule.png
DELETED
|
Binary file
|