@shijiu/jsview-vue 0.9.502 → 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 +16 -5
- 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 +32 -33
- 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/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-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 +1555 -1656
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.js +136 -0
- package/utils/JsViewEngineWidget/MetroWidget/ToolFunctions.js +18 -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 +264 -54
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +5 -1
- 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 +8 -4
- package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
- package/utils/JsViewVueWidget/JsvGrid.vue +139 -41
- 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 +1 -1
- 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,16 +2,15 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-04-10 21:20:39
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-07-08 14:12:05
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import JsvTouchContainer from "jsview/utils/JsViewVueWidget/JsvTouchContainer.vue";
|
|
10
9
|
import MetroWidgetHorizontal from "./MetroWidgetHorizontal.vue";
|
|
11
10
|
import MetroWidgetVertical from "./MetroWidgetVertical.vue";
|
|
12
11
|
import TouchContainerHorizontal from "./TouchContainerHorizontal.vue";
|
|
13
12
|
import TouchContainerVertical from "./TouchContainerVertical.vue";
|
|
14
|
-
import { jJsvRuntimeBridge } from "jsview
|
|
13
|
+
import { jJsvRuntimeBridge, JsvTouchContainer } from "jsview";
|
|
15
14
|
|
|
16
15
|
export default {
|
|
17
16
|
components: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import { getPositionRelativeToView } from "jsview
|
|
9
|
+
import { getPositionRelativeToView } from "jsview";
|
|
10
10
|
function randomColor() {
|
|
11
11
|
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
12
12
|
return (
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
setup() {
|
|
30
30
|
return {
|
|
31
31
|
randomColor,
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
},
|
|
34
34
|
computed: {
|
|
35
35
|
style() {
|
|
@@ -44,7 +44,7 @@ export default {
|
|
|
44
44
|
methods: {
|
|
45
45
|
onFocus() {
|
|
46
46
|
this.focused = true;
|
|
47
|
-
console.log("cchtest item onfocus", this.data)
|
|
47
|
+
console.log("cchtest item onfocus", this.data);
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
onBlur() {
|
|
@@ -53,7 +53,7 @@ export default {
|
|
|
53
53
|
|
|
54
54
|
onClick() {
|
|
55
55
|
console.log(`item ${this.query.id} clicked`);
|
|
56
|
-
}
|
|
56
|
+
},
|
|
57
57
|
},
|
|
58
58
|
created() {
|
|
59
59
|
// console.log("cchtest item created", this.data.content)
|
|
@@ -69,7 +69,7 @@ export default {
|
|
|
69
69
|
},
|
|
70
70
|
updated() {
|
|
71
71
|
// console.log("cchtest item update", this.data.content)
|
|
72
|
-
}
|
|
72
|
+
},
|
|
73
73
|
};
|
|
74
74
|
</script>
|
|
75
75
|
|
|
@@ -77,18 +77,20 @@ export default {
|
|
|
77
77
|
<div ref="element" :class="focused ? 'focus' : 'blur'" :style="style">
|
|
78
78
|
{{ data.content }}
|
|
79
79
|
</div>
|
|
80
|
-
<div
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
<div
|
|
81
|
+
:style="{
|
|
82
|
+
left: data.width / 2,
|
|
83
|
+
top: data.height / 2,
|
|
84
|
+
width: 10,
|
|
85
|
+
height: 10,
|
|
86
|
+
backgroundColor: focused ? '#000000' : '#FF0000',
|
|
87
|
+
}"
|
|
88
|
+
/>
|
|
87
89
|
</template>
|
|
88
90
|
|
|
89
91
|
<style scoped>
|
|
90
92
|
.focus {
|
|
91
|
-
transform: scale3d(1
|
|
93
|
+
transform: scale3d(1, 1, 1);
|
|
92
94
|
transition: transform 0.25s linear;
|
|
93
95
|
font-size: 30px;
|
|
94
96
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
WholePageSlide,
|
|
6
6
|
SeamlessSlide,
|
|
7
7
|
FixPositionSlide,
|
|
8
|
-
} from "jsview
|
|
8
|
+
} from "jsview";
|
|
9
9
|
|
|
10
10
|
import Item from "./Item.vue";
|
|
11
11
|
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
53
|
<div class="rootSize">
|
|
54
|
-
<div :style="{ width: 1280, height: 720, left: 50
|
|
54
|
+
<div :style="{ width: 1280, height: 720, left: 50 }">
|
|
55
55
|
<div
|
|
56
56
|
:style="{
|
|
57
57
|
top: 0,
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-04-10 21:21:02
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-07-08 14:40:19
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
JsvTouchContainer,
|
|
10
11
|
DIRECTION_VERTICAL,
|
|
11
12
|
DIRECTION_HORIZONTAL,
|
|
12
13
|
DIRECTION_DISABLE,
|
|
13
|
-
} from "jsview
|
|
14
|
+
} from "jsview";
|
|
14
15
|
import { touchContainerH, measures } from "./data.js";
|
|
15
16
|
function randomColor() {
|
|
16
17
|
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
JsvTouchContainer,
|
|
10
11
|
DIRECTION_VERTICAL,
|
|
11
12
|
DIRECTION_HORIZONTAL,
|
|
12
13
|
DIRECTION_DISABLE,
|
|
13
|
-
} from "jsview
|
|
14
|
+
} from "jsview";
|
|
14
15
|
import { touchContainerV, measures } from "./data.js";
|
|
15
16
|
function randomColor() {
|
|
16
17
|
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
@@ -1,41 +1,29 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
<script setup>
|
|
2
|
+
import DemoApp from "../DemoHomepage/App.vue";
|
|
3
|
+
import ActivityApp from "../MetroWidgetDemos/PerformanceTest/App.vue"; // TODO
|
|
4
|
+
import { jJsvRuntimeBridge } from "jsview";
|
|
5
|
+
import { ref, onMounted } from "vue";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
super(props);
|
|
15
|
-
this.showMode = TransitPage.getShowMode()
|
|
16
|
-
}
|
|
17
|
-
mounted() {
|
|
18
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
7
|
+
const getShowMode = () => {
|
|
8
|
+
let showMode = 0;
|
|
9
|
+
// showMode信息可被URL中的?后缀信息替换
|
|
10
|
+
if (window.location.search.indexOf("showMode=0") >= 0) {
|
|
11
|
+
showMode = 0;
|
|
12
|
+
} else if (window.location.search.indexOf("showMode=1") >= 0) {
|
|
13
|
+
showMode = 1;
|
|
19
14
|
}
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// showMode信息可被URL中的?后缀信息替换
|
|
24
|
-
if (window.location.search.indexOf("showMode=0") >= 0) {
|
|
25
|
-
showMode = 0;
|
|
26
|
-
} else if (window.location.search.indexOf("showMode=1") >= 0) {
|
|
27
|
-
showMode = 1;
|
|
28
|
-
}
|
|
16
|
+
return showMode;
|
|
17
|
+
};
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
TransitPage.Router = TransitPage.getShowMode() == 0 ? DemoApp.Router : ActivityApp.Router;
|
|
19
|
+
const showMode = ref(getShowMode());
|
|
34
20
|
|
|
35
|
-
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
23
|
+
});
|
|
36
24
|
</script>
|
|
37
25
|
|
|
38
26
|
<template>
|
|
39
|
-
<DemoApp v-if="showMode === 0" />
|
|
40
|
-
<ActivityApp v-else-if="showMode === 1"/>
|
|
27
|
+
<DemoApp v-if="showMode === 0" />
|
|
28
|
+
<ActivityApp v-else-if="showMode === 1" />
|
|
41
29
|
</template>
|
|
@@ -1,93 +1,78 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { provide, reactive, ref, watch } from
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
1
|
+
<script setup>
|
|
2
|
+
import { provide, reactive, ref, watch } from "vue";
|
|
4
3
|
import Controllor from "./components/Controllor";
|
|
5
4
|
import VideoFrame from "./components/VideoFrame";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const Caption = {
|
|
7
|
+
offscreenVideo:
|
|
8
|
+
"名称:OffscreenVideo(自动播放)\n" +
|
|
9
|
+
"功能描述:\n" +
|
|
10
|
+
"1.离屏视频播放、支持前进/后退控制\n" +
|
|
11
|
+
"2.支持圆角设置\n" +
|
|
12
|
+
"3.支持平移、缩放、旋转等动画\n" +
|
|
13
|
+
"4.支持ObjectFit调整\n",
|
|
14
|
+
normalVideo:
|
|
15
|
+
"名称:Video\n" +
|
|
16
|
+
"功能描述:\n" +
|
|
17
|
+
"1.视频播放、支持前进/后退控制\n" +
|
|
18
|
+
"2.支持ObjectFit调整\n",
|
|
19
|
+
};
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
watch(this.useTexture, () => {
|
|
35
|
-
this.caption = (this.useTexture ? App.Caption.offscreenVideo : App.Caption.normalVideo);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
App.Caption = {
|
|
40
|
-
offscreenVideo: "名称:OffscreenVideo(自动播放)\n"
|
|
41
|
-
+ "功能描述:\n"
|
|
42
|
-
+ "1.离屏视频播放、支持前进/后退控制\n"
|
|
43
|
-
+ "2.支持圆角设置\n"
|
|
44
|
-
+ "3.支持平移、缩放、旋转等动画\n"
|
|
45
|
-
+ "4.支持ObjectFit调整\n",
|
|
46
|
-
normalVideo: "名称:Video\n"
|
|
47
|
-
+ "功能描述:\n"
|
|
48
|
-
+ "1.视频播放、支持前进/后退控制\n"
|
|
49
|
-
+ "2.支持ObjectFit调整\n",
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default App;
|
|
21
|
+
let caption = ref(null);
|
|
22
|
+
let useTexture = ref(null);
|
|
23
|
+
let videoTime = reactive({
|
|
24
|
+
currentTime: 0,
|
|
25
|
+
duration: 0,
|
|
26
|
+
});
|
|
27
|
+
let objectFitTitle = ref(null);
|
|
28
|
+
let playStatus = ref("");
|
|
29
|
+
provide("useTexture", useTexture);
|
|
30
|
+
provide("objectFit", ref(null));
|
|
31
|
+
provide("videoRect", ref({}));
|
|
32
|
+
provide("playVideo", ref(null));
|
|
33
|
+
provide("seekVideo", ref(null));
|
|
34
|
+
provide("enableAnimation", ref(null));
|
|
35
|
+
provide("videoTime", videoTime);
|
|
36
|
+
provide("objectFitTitle", objectFitTitle);
|
|
37
|
+
provide("playStatus", playStatus);
|
|
38
|
+
watch(useTexture, () => {
|
|
39
|
+
caption.value = useTexture.value ? Caption.offscreenVideo : Caption.normalVideo;
|
|
40
|
+
});
|
|
53
41
|
</script>
|
|
54
42
|
|
|
55
43
|
<template>
|
|
56
|
-
<div
|
|
44
|
+
<div
|
|
57
45
|
:style="{
|
|
58
|
-
top: 0,
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
top: 0,
|
|
47
|
+
left: 0,
|
|
48
|
+
width: 1280,
|
|
49
|
+
height: 720,
|
|
50
|
+
backgroundColor: 'rgb(222,211,140)',
|
|
61
51
|
}"
|
|
62
|
-
>
|
|
63
|
-
<!-- :key="useTexture" => 当useTexture属性变化时,重建VideoFrame -->
|
|
64
|
-
<VideoFrame
|
|
65
|
-
:key="useTexture"
|
|
66
|
-
/>
|
|
67
|
-
|
|
68
|
-
<!-- :key="useTexture" => JsView bug,当useTexture属性变化时,为了保证显示在VideoFrame前面 -->
|
|
69
|
-
<div
|
|
70
|
-
class="caption"
|
|
71
|
-
:key="useTexture"
|
|
72
52
|
>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<div class="text objectFit">
|
|
80
|
-
{{ objectFitTitle }}
|
|
81
|
-
</div>
|
|
82
|
-
<div class="text current">
|
|
83
|
-
{{ Math.ceil(videoTime.currentTime) }}
|
|
53
|
+
<!-- :key="useTexture" => 当useTexture属性变化时,重建VideoFrame -->
|
|
54
|
+
<VideoFrame :key="useTexture" />
|
|
55
|
+
|
|
56
|
+
<!-- :key="useTexture" => JsView bug,当useTexture属性变化时,为了保证显示在VideoFrame前面 -->
|
|
57
|
+
<div class="caption" :key="useTexture">
|
|
58
|
+
{{ caption }}
|
|
84
59
|
</div>
|
|
85
|
-
<div
|
|
86
|
-
|
|
60
|
+
<div>
|
|
61
|
+
<div class="text status">
|
|
62
|
+
{{ "播放状态: " + playStatus }}
|
|
63
|
+
</div>
|
|
64
|
+
<div class="text objectFit">
|
|
65
|
+
{{ objectFitTitle }}
|
|
66
|
+
</div>
|
|
67
|
+
<div class="text current">
|
|
68
|
+
{{ Math.ceil(videoTime.currentTime) }}
|
|
69
|
+
</div>
|
|
70
|
+
<div class="text duration">
|
|
71
|
+
{{ "/" + Math.ceil(videoTime.duration) }}
|
|
72
|
+
</div>
|
|
87
73
|
</div>
|
|
74
|
+
<Controllor class="controllor" />
|
|
88
75
|
</div>
|
|
89
|
-
<Controllor class="controllor"/>
|
|
90
|
-
</div>
|
|
91
76
|
</template>
|
|
92
77
|
|
|
93
78
|
<style scoped>
|
|
@@ -95,16 +80,16 @@ export default App;
|
|
|
95
80
|
text-align: left;
|
|
96
81
|
font-size: 24px;
|
|
97
82
|
line-height: 30px;
|
|
98
|
-
color: #
|
|
83
|
+
color: #ffffff;
|
|
99
84
|
left: 10;
|
|
100
85
|
top: 10;
|
|
101
86
|
width: 400;
|
|
102
87
|
height: 180;
|
|
103
|
-
background-color: rgba(27,38,151,0.8);
|
|
88
|
+
background-color: rgba(27, 38, 151, 0.8);
|
|
104
89
|
}
|
|
105
90
|
|
|
106
91
|
.text {
|
|
107
|
-
color: #
|
|
92
|
+
color: #ff0000;
|
|
108
93
|
font-size: 24px;
|
|
109
94
|
top: 550;
|
|
110
95
|
width: 60;
|
|
@@ -133,5 +118,4 @@ export default App;
|
|
|
133
118
|
left: 40;
|
|
134
119
|
top: 600;
|
|
135
120
|
}
|
|
136
|
-
|
|
137
121
|
</style>
|
|
@@ -1,63 +1,52 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.hasFocused = false;
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
style: Object,
|
|
5
|
+
autoFocus: Boolean,
|
|
6
|
+
name: String,
|
|
7
|
+
onClick: Function,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const hasFocused = ref(false);
|
|
11
|
+
|
|
12
|
+
const onFocus = () => {
|
|
13
|
+
hasFocused.value = true;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const onBlur = () => {
|
|
17
|
+
hasFocused.value = false;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const onKeyDown = (ev) => {
|
|
21
|
+
if (ev.keyCode === 13) {
|
|
22
|
+
// Enter
|
|
23
|
+
props.onClick?.();
|
|
24
|
+
return true;
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if(ev.keyCode === 13) { // Enter
|
|
30
|
-
this.onClick?.();
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
getAction() {
|
|
37
|
-
return {
|
|
38
|
-
onFocus: this.onFocus,
|
|
39
|
-
onBlur: this.onBlur,
|
|
40
|
-
onKeyDown: this.onKeyDown
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default Button;
|
|
26
|
+
return false;
|
|
27
|
+
};
|
|
46
28
|
</script>
|
|
47
29
|
|
|
48
30
|
<template>
|
|
49
|
-
<jsv-focus-block
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
31
|
+
<jsv-focus-block
|
|
32
|
+
:name="name"
|
|
33
|
+
:autoFocus="autoFocus ? '' : undefined"
|
|
34
|
+
:onAction="{
|
|
35
|
+
onFocus: onFocus,
|
|
36
|
+
onBlur: onBlur,
|
|
37
|
+
onKeyDown: onKeyDown,
|
|
38
|
+
}"
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
class="item"
|
|
53
42
|
:style="{
|
|
54
43
|
...style,
|
|
55
44
|
backgroundColor: hasFocused ? '#FFFF00' : '#A8A8A8',
|
|
56
45
|
}"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</jsv-focus-block>
|
|
46
|
+
>
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</div>
|
|
49
|
+
</jsv-focus-block>
|
|
61
50
|
</template>
|
|
62
51
|
|
|
63
52
|
<style scoped>
|