@shijiu/jsview-vue 0.9.490 → 0.9.590
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
- package/dom/bin/jsview-dom.min.js +1 -1
- package/dom/target_core_revision.js +4 -3
- package/index.js +10 -0
- package/package.json +8 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +20 -6
- package/samples/AnimPicture/App.vue +89 -106
- package/samples/Basic/App.vue +65 -68
- package/samples/Basic/components/ContentBlock.vue +31 -36
- package/samples/Basic/components/anim/AnimGroup.vue +61 -75
- package/samples/Basic/components/anim/AnimKeyframeBasic.vue +54 -43
- package/samples/Basic/components/anim/AnimKeyframeComposite.vue +25 -31
- package/samples/Basic/components/anim/AnimTransition.vue +142 -105
- package/samples/Basic/components/div/DivBackground.vue +38 -16
- package/samples/Basic/components/div/DivClip.vue +143 -78
- package/samples/Basic/components/div/DivCssScoped.vue +10 -10
- package/samples/Basic/components/div/DivCssVar.vue +40 -42
- package/samples/Basic/components/div/DivGroup1.vue +45 -39
- package/samples/Basic/components/div/DivGroup2.vue +56 -45
- package/samples/Basic/components/div/DivLayout.vue +34 -5
- package/samples/Basic/components/div/DivRadius.vue +51 -42
- package/samples/Basic/components/div/DivTransform.vue +21 -16
- package/samples/Basic/components/panel/Panel1.vue +46 -44
- package/samples/Basic/components/panel/Panel2.vue +22 -26
- package/samples/Basic/components/panel/TitleBar.vue +12 -12
- package/samples/Basic/components/text/TextAlign.vue +54 -44
- package/samples/Basic/components/text/TextEmoji.vue +16 -20
- package/samples/Basic/components/text/TextFontStyle.vue +77 -53
- package/samples/Basic/components/text/TextGroup1.vue +46 -38
- package/samples/Basic/components/text/TextGroup2.vue +25 -28
- package/samples/Basic/components/text/TextOverflow.vue +76 -57
- package/samples/BasicFocusControl/App.vue +22 -43
- package/samples/BasicFocusControl/components/BaseBlock.vue +42 -43
- package/samples/BasicFocusControl/components/MainArea.vue +55 -70
- package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +11 -15
- package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +21 -24
- package/samples/BasicFocusControl/components/SideBar.vue +32 -47
- package/samples/BasicFocusControl/components/SideBarBlock.vue +20 -23
- package/samples/ColorSpace/App.vue +15 -24
- package/samples/DemoHomepage/App.vue +7 -11
- package/samples/DemoHomepage/components/BodyFrame.vue +19 -9
- package/samples/DemoHomepage/components/TabFrame.vue +7 -8
- package/samples/DemoHomepage/router.js +33 -34
- package/samples/DemoHomepage/views/Homepage.vue +24 -8
- package/samples/FilterDemo/AnimatePic.vue +58 -0
- package/samples/FilterDemo/App.vue +99 -61
- package/samples/FilterDemo/VideoLayer.vue +62 -0
- package/samples/FlipCard/App.vue +32 -41
- package/samples/FlipCard/FlipCard.vue +48 -54
- package/samples/GridDemo/App.vue +109 -77
- package/samples/GridDemo/ButtonBlock.vue +50 -49
- package/samples/GridDemo/FocusItem.vue +19 -38
- package/samples/GridDemo/Item.vue +46 -54
- package/samples/HashHistory/App.vue +63 -79
- package/samples/HashHistory/components/HorizontalButtonList.vue +72 -95
- package/samples/HashHistory/components/Item.vue +42 -56
- package/samples/HashHistory/router.js +23 -12
- package/samples/HashHistory/views/MainPage.vue +35 -46
- package/samples/HashHistory/views/SubPage.vue +34 -47
- package/samples/Input/App.vue +2 -3
- package/samples/Input/FullKeyboard.vue +2 -6
- package/samples/Input/InputPanel.vue +2 -3
- package/samples/Input/KeyboardItem.vue +1 -1
- package/samples/LongImage/App.vue +11 -27
- package/samples/LongImage/Button.vue +50 -145
- package/samples/LongImage/ButtonItem.vue +44 -0
- package/samples/LongImage/LongImageScroll.vue +71 -106
- package/samples/LongImage/Scroll.vue +7 -9
- package/samples/LongText/App.vue +13 -28
- package/samples/LongText/Button.vue +43 -145
- package/samples/LongText/ButtonItem.vue +44 -0
- package/samples/LongText/LongTextScroll.vue +68 -101
- package/samples/LongText/Scroll.vue +7 -9
- package/samples/Marquee/App.vue +34 -37
- package/samples/MaskClip/App.vue +17 -30
- package/samples/MetroWidgetDemos/Advanced/App.vue +211 -0
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- package/samples/MetroWidgetDemos/Item.vue +67 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/App.vue +80 -104
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/Item.vue +7 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/bg.jpg +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_content.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_left.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_mid.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_right.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/focus_border.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/holder_logo.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/jrbm.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_left.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_mid.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_right.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/loading.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/logo.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/mcjx.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tao.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tmall.png +0 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/border.png +0 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/ContentItem.vue +60 -86
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/MyTab.vue +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/data.js +45 -0
- package/samples/MetroWidgetDemos/PingPong/App.vue +135 -0
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +58 -0
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +69 -0
- package/samples/MetroWidgetDemos/PingPong/Item.vue +92 -0
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/samples/MetroWidgetDemos/Simple/App.vue +194 -0
- package/samples/MetroWidgetDemos/WidgetItem.vue +89 -0
- package/samples/MetroWidgetDemos/data.js +204 -0
- package/samples/NinePatchDemo/App.vue +114 -115
- package/samples/NinePatchDemo/Item.vue +7 -8
- package/samples/NinePatchDemo/assets/border.png +0 -0
- package/samples/Preload/App.vue +61 -63
- package/samples/Preload/Item.vue +21 -29
- package/samples/QrcodeDemo/App.vue +24 -29
- package/samples/SoundPool/App.vue +77 -106
- package/samples/SprayView/App.vue +10 -8
- package/samples/SpriteImage/App.vue +1 -2
- package/samples/TextBox/App.vue +86 -101
- package/samples/TextBox/RenderCenter.vue +1 -1
- package/samples/TextBox/RenderLeft.vue +1 -1
- package/samples/TextBox/RenderOneLine.vue +1 -1
- package/samples/TextBox/RenderRight.vue +1 -1
- package/samples/TextShadowDemo/App.vue +1 -2
- package/samples/TextureAnimation/App.vue +16 -13
- package/samples/TextureSize/App.vue +15 -25
- package/samples/ThrowMoveDemo/AccelerateDemo.vue +2 -4
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +2 -3
- package/samples/ThrowMoveDemo/TargetDemo.vue +3 -4
- package/samples/ThrowMoveDemo/UDParabolicDemo.vue +2 -3
- package/samples/TouchSample/App.vue +2 -3
- package/samples/TouchSample/Item.vue +15 -13
- package/samples/TouchSample/MetroWidgetHorizontal.vue +2 -2
- package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
- package/samples/TouchSample/TouchContainerHorizontal.vue +4 -3
- package/samples/TouchSample/TouchContainerVertical.vue +3 -2
- package/samples/TransitPage/App.vue +20 -32
- package/samples/VideoDemo/App.vue +65 -81
- package/samples/VideoDemo/components/Button.vue +41 -52
- package/samples/VideoDemo/components/Controllor.vue +171 -169
- package/samples/VideoDemo/components/VideoFrame.vue +87 -99
- package/samples/VisibleSensorDemo/App.vue +167 -0
- package/scripts/jsview-jsmap-serve.js +42 -0
- package/scripts/jsview-post-build.js +6 -1
- package/scripts/jsview-post-install.js +1 -1
- package/tsconfig.json +3 -0
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +204 -193
- package/utils/JsViewEngineWidget/JsvFocusManager.js +30 -17
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1557 -1656
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.js +136 -0
- package/utils/JsViewEngineWidget/MetroWidget/ToolFunctions.js +18 -0
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +2 -0
- package/utils/JsViewEngineWidget/TemplateParser.js +111 -1
- package/utils/JsViewEngineWidget/WidgetCommon.js +8 -2
- package/utils/JsViewEngineWidget/index.js +4 -4
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +284 -57
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +5 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +25 -12
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvRefTaker.js +35 -0
- package/utils/JsViewVueTools/index.js +19 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +25 -10
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +1 -1
- package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
- package/utils/JsViewVueWidget/JsvGrid.vue +140 -42
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -1
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +8 -17
- package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -1
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +37 -7
- package/utils/JsViewVueWidget/JsvPosterImage.vue +34 -13
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -12
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +13 -4
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -10
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -3
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +25 -21
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +7 -8
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +141 -0
- package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +9 -0
- package/utils/JsViewVueWidget/index.js +42 -0
- package/samples/AdvanceMetroWidget/App.vue +0 -123
- package/samples/AdvanceMetroWidget/Frame.vue +0 -102
- package/samples/AdvanceMetroWidget/Item.vue +0 -63
- package/samples/AdvanceMetroWidget/data.js +0 -137
- package/samples/ClassNameDemo/App.vue +0 -119
- package/samples/ClassNameDemo/components/ContentItem.vue +0 -253
- package/samples/ClassNameDemo/components/LoadingView.vue +0 -43
- package/samples/ClassNameDemo/components/TitleView.vue +0 -24
- package/samples/ClassNameDemo/data.js +0 -24
- package/samples/FlowMultiWidget/App.vue +0 -91
- package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
- package/samples/FlowMultiWidget/components/Block.vue +0 -107
- package/samples/FlowMultiWidget/components/FlowPage.vue +0 -60
- package/samples/FlowMultiWidget/components/Item.vue +0 -103
- package/samples/FlowMultiWidget/components/MenuItem.vue +0 -72
- package/samples/FlowMultiWidget/components/MyMenu.vue +0 -90
- package/samples/FlowMultiWidget/data.js +0 -446
- package/samples/HashHistory/views/BasePage.vue +0 -19
- package/samples/HashHistory/views/SubPageFirst.vue +0 -10
- package/samples/HashHistory/views/SubPageSecond.vue +0 -10
- package/samples/SimpleWidgetDemo/assets/bg.jpg +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_content.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_left.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_mid.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_right.png +0 -0
- package/samples/SimpleWidgetDemo/assets/focus_border.png +0 -0
- package/samples/SimpleWidgetDemo/assets/holder_logo.png +0 -0
- package/samples/SimpleWidgetDemo/assets/jrbm.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_left.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_mid.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_right.png +0 -0
- package/samples/SimpleWidgetDemo/assets/loading.png +0 -0
- package/samples/SimpleWidgetDemo/assets/logo.png +0 -0
- package/samples/SimpleWidgetDemo/assets/mcjx.png +0 -0
- package/samples/SimpleWidgetDemo/assets/tao.png +0 -0
- package/samples/SimpleWidgetDemo/assets/tmall.png +0 -0
- package/samples/SimpleWidgetDemo/data.js +0 -124
- package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +0 -63
- package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +0 -51
- package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +0 -213
- package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +0 -154
|
@@ -2,121 +2,92 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-01-25 09:56:46
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-07-08 18:09:10
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
|
-
<script>
|
|
8
|
+
<script setup>
|
|
9
9
|
import coin from "./coin.mp3";
|
|
10
10
|
import lose from "./lose.mp3";
|
|
11
|
-
import
|
|
12
|
-
import { JsvSoundPool } from "jsview
|
|
13
|
-
import {
|
|
11
|
+
import bgmusic from "./bgmusic.mp3";
|
|
12
|
+
import { JsvSoundPool, jJsvRuntimeBridge } from "jsview";
|
|
13
|
+
import { onMounted, onBeforeUnmount, ref } from "vue";
|
|
14
|
+
import { useRouter } from "vue-router";
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
1,
|
|
32
|
-
(state, audioController) => {
|
|
33
|
-
console.log("cchtest load succeed", audioController);
|
|
34
|
-
if (state === 0) {
|
|
35
|
-
this.coinController1 = audioController;
|
|
36
|
-
}
|
|
16
|
+
const router = useRouter();
|
|
17
|
+
const soundPool = new JsvSoundPool(10);
|
|
18
|
+
let coinController1 = null;
|
|
19
|
+
let coinController2 = null;
|
|
20
|
+
let loseController1 = null;
|
|
21
|
+
let loseController2 = null;
|
|
22
|
+
let bgm = ref(null);
|
|
23
|
+
const _onKeyDown = (ev) => {
|
|
24
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
25
|
+
router.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
switch (ev.keyCode) {
|
|
29
|
+
case 37:
|
|
30
|
+
if (loseController1) {
|
|
31
|
+
loseController1.play();
|
|
37
32
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
1,
|
|
43
|
-
(state, audioController) => {
|
|
44
|
-
if (state === 0) {
|
|
45
|
-
this.coinController2 = audioController;
|
|
46
|
-
this.coinController2.setLoop(0);
|
|
47
|
-
}
|
|
33
|
+
break;
|
|
34
|
+
case 38:
|
|
35
|
+
if (coinController1) {
|
|
36
|
+
coinController1.play();
|
|
48
37
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
null,
|
|
54
|
-
1,
|
|
55
|
-
(state, audioController) => {
|
|
56
|
-
if (state === 0) {
|
|
57
|
-
this.loseController1 = audioController;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
this.soundPool.request(
|
|
62
|
-
`url(${lose})`,
|
|
63
|
-
null,
|
|
64
|
-
1,
|
|
65
|
-
(state, audioController) => {
|
|
66
|
-
if (state === 0) {
|
|
67
|
-
this.loseController2 = audioController;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
},
|
|
72
|
-
methods: {
|
|
73
|
-
_onKeyDown(ev) {
|
|
74
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
75
|
-
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
76
|
-
return true;
|
|
38
|
+
break;
|
|
39
|
+
case 39:
|
|
40
|
+
if (loseController2) {
|
|
41
|
+
loseController2.play();
|
|
77
42
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
break;
|
|
84
|
-
case 38:
|
|
85
|
-
if (this.coinController1) {
|
|
86
|
-
this.coinController1.play();
|
|
87
|
-
}
|
|
88
|
-
break;
|
|
89
|
-
case 39:
|
|
90
|
-
if (this.loseController2) {
|
|
91
|
-
this.loseController2.play();
|
|
92
|
-
}
|
|
93
|
-
break;
|
|
94
|
-
case 40:
|
|
95
|
-
if (this.coinController2) {
|
|
96
|
-
this.coinController2.play();
|
|
97
|
-
}
|
|
98
|
-
break;
|
|
99
|
-
case 13:
|
|
100
|
-
this.$refs.bgm?.play();
|
|
101
|
-
break;
|
|
43
|
+
break;
|
|
44
|
+
case 40:
|
|
45
|
+
if (coinController2) {
|
|
46
|
+
coinController2.play();
|
|
102
47
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
beforeUnmount() {
|
|
111
|
-
this.coinController1 = null;
|
|
112
|
-
this.coinController2 = null;
|
|
113
|
-
this.loseController1 = null;
|
|
114
|
-
this.loseController2 = null;
|
|
115
|
-
this.soundPool.destroy();
|
|
116
|
-
this.$refs.bgm?.pause();
|
|
117
|
-
this.$refs.bgm?.unload();
|
|
118
|
-
},
|
|
48
|
+
break;
|
|
49
|
+
case 13:
|
|
50
|
+
bgm.value?.play();
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
119
54
|
};
|
|
55
|
+
soundPool.request(`url(${coin})`, null, 1, (state, audioController) => {
|
|
56
|
+
console.log("cchtest load succeed", audioController);
|
|
57
|
+
if (state === 0) {
|
|
58
|
+
coinController1 = audioController;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
soundPool.request(`url(${coin})`, null, 1, (state, audioController) => {
|
|
62
|
+
if (state === 0) {
|
|
63
|
+
coinController2 = audioController;
|
|
64
|
+
coinController2.setLoop(0);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
soundPool.request(`url(${lose})`, null, 1, (state, audioController) => {
|
|
69
|
+
if (state === 0) {
|
|
70
|
+
loseController1 = audioController;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
soundPool.request(`url(${lose})`, null, 1, (state, audioController) => {
|
|
74
|
+
if (state === 0) {
|
|
75
|
+
loseController2 = audioController;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
81
|
+
});
|
|
82
|
+
onBeforeUnmount(() => {
|
|
83
|
+
coinController1 = null;
|
|
84
|
+
coinController2 = null;
|
|
85
|
+
loseController1 = null;
|
|
86
|
+
loseController2 = null;
|
|
87
|
+
soundPool.destroy();
|
|
88
|
+
bgm.value?.pause();
|
|
89
|
+
bgm.value?.unload();
|
|
90
|
+
});
|
|
120
91
|
</script>
|
|
121
92
|
|
|
122
93
|
<template>
|
|
@@ -157,7 +128,7 @@ export default {
|
|
|
157
128
|
`[确定]: 播放背景音乐\n[左]: 播放失败音乐1\n[右]: 播放失败音乐2\n[上]: 播放硬币音乐1\n[下]: 播放硬币音乐2`
|
|
158
129
|
}}
|
|
159
130
|
</div>
|
|
160
|
-
<audiotrack ref="bgm" :src="
|
|
131
|
+
<audiotrack ref="bgm" :src="bgmusic" loop="loop" />
|
|
161
132
|
</div>
|
|
162
133
|
</jsv-focus-block>
|
|
163
134
|
</template>
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-10-13 11:19:26
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2022-07-08 17:09:58
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import JsvSpray from "jsview
|
|
9
|
+
import { JsvSpray } from "jsview";
|
|
10
10
|
import snow from "./assets/snow.png";
|
|
11
11
|
const sprayOk = {
|
|
12
12
|
type: 0,
|
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
}
|
|
115
115
|
return true;
|
|
116
116
|
},
|
|
117
|
-
}
|
|
117
|
+
},
|
|
118
118
|
};
|
|
119
119
|
</script>
|
|
120
120
|
|
|
@@ -158,11 +158,13 @@ export default {
|
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
|
160
160
|
<div :style="{ top: 20, left: 400 }">
|
|
161
|
-
<div
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
<div
|
|
162
|
+
:style="{
|
|
163
|
+
width: 40,
|
|
164
|
+
height: 40,
|
|
165
|
+
animation: 'cycle 3s linear infinite',
|
|
166
|
+
}"
|
|
167
|
+
>
|
|
166
168
|
<jsv-spray :pointRes="`url(${snow})`" :sprayStyle="sprayCycle" />
|
|
167
169
|
</div>
|
|
168
170
|
<div
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
-->
|
|
27
27
|
|
|
28
28
|
<script>
|
|
29
|
-
import JsvSpriteAnim from "
|
|
30
|
-
import { SpriteController } from "../../utils/JsViewVueWidget/JsvSpriteAnim/SpriteController";
|
|
29
|
+
import { SpriteController, JsvSpriteAnim } from "jsview";
|
|
31
30
|
import spriteImage from "./images/egg_break.png";
|
|
32
31
|
import config_json from "./images/egg_break.json";
|
|
33
32
|
export default {
|
package/samples/TextBox/App.vue
CHANGED
|
@@ -22,120 +22,105 @@
|
|
|
22
22
|
* 2. 变更文字内容,将触发控件重绘,但不会重新解析styles
|
|
23
23
|
-->
|
|
24
24
|
|
|
25
|
-
<script
|
|
26
|
-
import { Options, Vue } from "vue-class-component";
|
|
25
|
+
<script setup>
|
|
27
26
|
import RenderLeft from "./RenderLeft.vue";
|
|
28
27
|
import RenderRight from "./RenderRight.vue";
|
|
29
28
|
import RenderCenter from "./RenderCenter.vue";
|
|
30
29
|
import RenderOneLine from "./RenderOneLine.vue";
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} from "jsview/utils/JsViewVueTools/JsvStyleClass.js";
|
|
30
|
+
import { JsvTextStyleClass, JsvStyleClass } from "jsview";
|
|
31
|
+
import { ref } from "vue";
|
|
32
|
+
import { useRouter } from "vue-router";
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
RenderOneLine,
|
|
42
|
-
},
|
|
43
|
-
})
|
|
44
|
-
export default class App extends Vue {
|
|
45
|
-
constructor(props: any) {
|
|
46
|
-
super(props);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
private offsetX: any = 0;
|
|
50
|
-
private offsetY: any = 0;
|
|
51
|
-
private onLineText = "abcdefghigk";
|
|
52
|
-
private text: any = `静夜思 --唐李白
|
|
34
|
+
const router = useRouter();
|
|
35
|
+
let offsetX = ref(0);
|
|
36
|
+
let offsetY = ref(0);
|
|
37
|
+
const onLineText = "abcdefghigk";
|
|
38
|
+
const text = `静夜思 --唐李白
|
|
53
39
|
床前明月光,疑是地上霜;
|
|
54
40
|
举头望明月,低头思故乡。`;
|
|
55
|
-
|
|
41
|
+
const text_latex = `静夜思 --唐李白
|
|
56
42
|
床前\\textcolor{#FF0000}{明月光},疑是地上霜;
|
|
57
43
|
举头\\textcolor{#0000FF}{望明月},低头思故乡。`;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
44
|
+
const sLayoutSet = new JsvStyleClass({
|
|
45
|
+
width: 400,
|
|
46
|
+
height: 300,
|
|
47
|
+
backgroundColor: "rgba(255,255,0,0.5)",
|
|
48
|
+
});
|
|
49
|
+
const sFontSetLeft40Top = new JsvTextStyleClass({
|
|
50
|
+
fontSize: "30px", // 测试 30 和 '30px' 两种写法的兼容性
|
|
51
|
+
textAlign: "left",
|
|
52
|
+
lineHeight: "40px",
|
|
53
|
+
});
|
|
54
|
+
const sFontSetLeft40Center = new JsvTextStyleClass({
|
|
55
|
+
fontSize: "30px", // 测试 30 和 '30px' 两种写法的兼容性
|
|
56
|
+
textAlign: "left",
|
|
57
|
+
lineHeight: "40px",
|
|
58
|
+
});
|
|
59
|
+
const sFontSetLeft40Bottom = new JsvTextStyleClass({
|
|
60
|
+
fontSize: "30px",
|
|
61
|
+
textAlign: "left",
|
|
62
|
+
lineHeight: "40px",
|
|
63
|
+
});
|
|
64
|
+
const sFontSetLeft80 = new JsvTextStyleClass({
|
|
65
|
+
fontSize: "30px",
|
|
66
|
+
textAlign: "left",
|
|
67
|
+
lineHeight: "80px",
|
|
68
|
+
});
|
|
69
|
+
const sFontSetCenter40 = new JsvTextStyleClass({
|
|
70
|
+
fontSize: "30px",
|
|
71
|
+
textAlign: "center",
|
|
72
|
+
lineHeight: "40px",
|
|
73
|
+
});
|
|
74
|
+
const sFontSetCenter80 = new JsvTextStyleClass({
|
|
75
|
+
fontSize: "30px",
|
|
76
|
+
textAlign: "center",
|
|
77
|
+
lineHeight: "80px",
|
|
78
|
+
});
|
|
79
|
+
const sFontSetRight40 = new JsvTextStyleClass({
|
|
80
|
+
fontSize: "30px",
|
|
81
|
+
textAlign: "right",
|
|
82
|
+
lineHeight: "80px",
|
|
83
|
+
});
|
|
84
|
+
const sFontSetRight80 = new JsvTextStyleClass({
|
|
85
|
+
fontSize: "30px",
|
|
86
|
+
textAlign: "right",
|
|
87
|
+
lineHeight: "80px",
|
|
88
|
+
});
|
|
89
|
+
const sStyleToken = "v1.0";
|
|
90
|
+
const rootRef = ref(null);
|
|
91
|
+
const moveCount = ref(0);
|
|
106
92
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
switch (ev.keyCode) {
|
|
113
|
-
case 37:
|
|
114
|
-
this.offsetX += 30;
|
|
115
|
-
this.moveCount++;
|
|
116
|
-
break;
|
|
117
|
-
case 39:
|
|
118
|
-
this.offsetX -= 30;
|
|
119
|
-
this.moveCount++;
|
|
120
|
-
break;
|
|
121
|
-
case 38:
|
|
122
|
-
this.offsetY += 30;
|
|
123
|
-
this.moveCount++;
|
|
124
|
-
break;
|
|
125
|
-
case 40:
|
|
126
|
-
this.offsetY -= 30;
|
|
127
|
-
this.moveCount++;
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
93
|
+
const onKeyDown = (ev) => {
|
|
94
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
95
|
+
router.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
130
96
|
return true;
|
|
131
97
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
98
|
+
switch (ev.keyCode) {
|
|
99
|
+
case 37:
|
|
100
|
+
offsetX.value += 30;
|
|
101
|
+
moveCount.value++;
|
|
102
|
+
break;
|
|
103
|
+
case 39:
|
|
104
|
+
offsetX.value -= 30;
|
|
105
|
+
moveCount.value++;
|
|
106
|
+
break;
|
|
107
|
+
case 38:
|
|
108
|
+
offsetY.value += 30;
|
|
109
|
+
moveCount.value++;
|
|
110
|
+
break;
|
|
111
|
+
case 40:
|
|
112
|
+
offsetY.value -= 30;
|
|
113
|
+
moveCount.value++;
|
|
114
|
+
break;
|
|
137
115
|
}
|
|
138
|
-
|
|
116
|
+
return true;
|
|
117
|
+
};
|
|
118
|
+
const onFocus = () => {
|
|
119
|
+
console.log("TextBox getFocus");
|
|
120
|
+
};
|
|
121
|
+
const onBlur = () => {
|
|
122
|
+
console.log("TextBox loseFocus");
|
|
123
|
+
};
|
|
139
124
|
</script>
|
|
140
125
|
|
|
141
126
|
<template>
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* 当TextData数据中有blur为0(不显示阴影)时,为了测试会报“StyleFormatCheck.js?058c:447 textShadow: blur shadow above 0(now=2 2 0 #00FF00)”错误
|
|
3
3
|
-->
|
|
4
4
|
<script>
|
|
5
|
-
import JsvTextBox from "jsview
|
|
6
|
-
import { JsvTextStyleClass } from "jsview/utils/JsViewVueTools/JsvStyleClass";
|
|
5
|
+
import { JsvTextStyleClass, JsvTextBox } from "jsview";
|
|
7
6
|
|
|
8
7
|
export default {
|
|
9
8
|
components: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
jJsvRuntimeBridge,
|
|
4
|
+
getKeyFramesGroup,
|
|
5
|
+
JsvTextureAnim,
|
|
6
|
+
} from "jsview";
|
|
6
7
|
import img from "./assets/php2.png";
|
|
7
8
|
import swipLight from "./assets/swipLight.png";
|
|
8
9
|
|
|
@@ -319,15 +320,17 @@ export default {
|
|
|
319
320
|
</div>
|
|
320
321
|
|
|
321
322
|
<!-- 说明文字 -->
|
|
322
|
-
<div
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
323
|
+
<div
|
|
324
|
+
:style="{
|
|
325
|
+
left: 100,
|
|
326
|
+
top: 620,
|
|
327
|
+
width: 1920,
|
|
328
|
+
height: 200,
|
|
329
|
+
fontSize: 30,
|
|
330
|
+
color: '#000000',
|
|
331
|
+
}"
|
|
332
|
+
>
|
|
333
|
+
{{ "1. 注意圆角\n2. 红色半透明的view为标准, 图片的动画需要与其一致" }}
|
|
331
334
|
</div>
|
|
332
335
|
</jsv-focus-block>
|
|
333
336
|
</template>
|
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Vue } from "vue-class-component";
|
|
1
|
+
<script setup>
|
|
3
2
|
import jpegDemo from "./jpegDemo.jpeg";
|
|
4
3
|
import pngDemo from "./pngDemo.png";
|
|
5
4
|
import pngNoAlphaDemo from "./pngNoAlphaDemo.png";
|
|
6
5
|
import bmpDemo from "./bmpDemo.bmp";
|
|
6
|
+
import { useRouter } from "vue-router";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
constructor(props) {
|
|
10
|
-
super(props);
|
|
8
|
+
const router = useRouter();
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
20
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
21
|
-
if (window.JsView) {
|
|
22
|
-
window.JsView.setGlobalConfig({
|
|
23
|
-
texCache: -1,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
this.$router?.go(-1); // 有router时,回退
|
|
28
|
-
return true;
|
|
10
|
+
const onKeyDown = (ev) => {
|
|
11
|
+
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
12
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
13
|
+
if (window.JsView) {
|
|
14
|
+
window.JsView.setGlobalConfig({
|
|
15
|
+
texCache: -1,
|
|
16
|
+
});
|
|
29
17
|
}
|
|
30
|
-
|
|
18
|
+
|
|
19
|
+
router.go(-1); // 有router时,回退
|
|
20
|
+
return true;
|
|
31
21
|
}
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
34
24
|
</script>
|
|
35
25
|
<template>
|
|
36
26
|
<jsv-focus-block autoFocus :onKeyDown="onKeyDown">
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-10-20 18:27:25
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2022-07-08 14:11:05
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
10
|
-
JsvActorMoveControl,
|
|
11
|
-
} from "jsview/utils/JsViewVueWidget/JsvActorMove";
|
|
9
|
+
import { JsvActorMoveControl, JsvActorMove } from "jsview";
|
|
12
10
|
export default {
|
|
13
11
|
components: {
|
|
14
12
|
JsvActorMove,
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
} from "jsview/utils/JsViewVueWidget/JsvActorMove";
|
|
9
|
+
import { JsvActorMoveControl, JsvActorMove } from "jsview";
|
|
10
|
+
|
|
12
11
|
export default {
|
|
13
12
|
components: {
|
|
14
13
|
JsvActorMove,
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-10-20 18:27:25
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2022-07-08 14:11:39
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
} from "jsview/utils/JsViewVueWidget/JsvActorMove";
|
|
9
|
+
import { JsvActorMoveControl, JsvActorMove } from "jsview";
|
|
10
|
+
|
|
12
11
|
export default {
|
|
13
12
|
components: {
|
|
14
13
|
JsvActorMove,
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
} from "jsview/utils/JsViewVueWidget/JsvActorMove";
|
|
9
|
+
import { JsvActorMoveControl, JsvActorMove } from "jsview";
|
|
10
|
+
|
|
12
11
|
export default {
|
|
13
12
|
components: {
|
|
14
13
|
JsvActorMove,
|