@shijiu/jsview-vue 0.9.684 → 0.9.766
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/bin/jsview-engine-js-browser.min.js +1 -1
- package/dom/bin/jsview-forge-define.min.js +1 -1
- package/dom/jsv-engine-js-browser.js +6 -0
- package/dom/target_core_revision.js +4 -4
- package/loader/loader.js +4 -0
- package/package.json +1 -1
- package/patches/node_modules/@vue/cli-service/lib/config/base.js +1 -1
- package/samples/AnimPicture/App.vue +5 -5
- package/samples/Basic/components/div/DivLayout.vue +1 -1
- package/samples/Basic/components/img/ImageGroup.vue +2 -2
- package/samples/Basic/components/img/ImgLayout.vue +79 -15
- package/samples/Basic/components/text/TextDirection.vue +104 -0
- package/samples/Basic/components/text/TextEmoji.vue +1 -1
- package/samples/Basic/components/text/TextGroup1.vue +1 -1
- package/samples/Basic/components/text/TextGroup2.vue +11 -1
- package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/samples/Collision/App.vue +11 -11
- package/samples/DemoHomepage/App.vue +43 -8
- package/samples/DemoHomepage/router.js +13 -10
- package/samples/DemoHomepage/views/Homepage.vue +83 -96
- package/samples/FilterDemo/App.vue +1 -1
- package/samples/FlipCard/App.vue +2 -2
- package/samples/FlipCard/FlipCard.vue +3 -3
- package/samples/GridDemo/App.vue +3 -3
- package/samples/GridDemo/ButtonBlock.vue +2 -2
- package/samples/GridDemo/FocusItem.vue +2 -2
- package/samples/GridDemo/Item.vue +1 -1
- package/samples/HashHistory/App.vue +10 -3
- package/samples/HashHistory/components/Item.vue +1 -1
- package/samples/ImpactStop/App.vue +15 -11
- package/samples/Input/InputPanel.vue +1 -1
- package/samples/LongImage/Button.vue +1 -1
- package/samples/LongImage/ButtonItem.vue +1 -1
- package/samples/LongImage/LongImageScroll.vue +2 -2
- package/samples/LongText/App.vue +1 -1
- package/samples/LongText/Button.vue +1 -1
- package/samples/LongText/ButtonItem.vue +1 -1
- package/samples/LongText/LongTextScroll.vue +3 -3
- package/samples/Marquee/longText.js +2 -2
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
- package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +3 -4
- package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +2 -3
- package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +1 -1
- package/samples/MetroWidgetDemos/Item.vue +3 -19
- package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
- package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
- package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +3 -3
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
- package/samples/MetroWidgetDemos/PingPong/TabItem.vue +1 -1
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +3 -3
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +2 -2
- package/samples/MetroWidgetDemos/WidgetItem.vue +2 -3
- package/samples/NinePatchDemo/App.vue +2 -2
- package/samples/NinePatchDemo/Item.vue +2 -2
- package/samples/Preload/App.vue +1 -1
- package/samples/Preload/Item.vue +1 -1
- package/samples/QrcodeDemo/App.vue +1 -1
- package/samples/SoundPool/App.vue +3 -3
- package/samples/SpriteImage/App.vue +5 -0
- package/samples/TextBox/App.vue +2 -1
- package/samples/TextureAnimation/App2.vue +1 -1
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +33 -47
- package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
- package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
- package/samples/TransitPage/App.vue +1 -1
- package/samples/VideoDemo/App.vue +8 -8
- package/samples/VideoDemo/components/Button.vue +1 -1
- package/samples/VideoDemo/components/Controllor.vue +1 -1
- package/samples/VisibleSensorDemo/App.vue +3 -3
- package/scripts/jsview-run-android.js +5 -4
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +4 -4
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +65 -39
- package/utils/JsViewEngineWidget/TemplateParser.js +138 -146
- package/utils/JsViewEngineWidget/WidgetCommon.js +12 -3
- package/utils/JsViewPlugin/BrowserPluginLoader.js +4 -2
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +302 -0
- package/utils/JsViewPlugin/JsvAudio/CheckType.js +68 -0
- package/utils/JsViewPlugin/JsvAudio/Events.js +17 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +176 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +40 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBrowser.vue +46 -0
- package/utils/JsViewPlugin/JsvAudio/PluginLoader.js +140 -0
- package/utils/JsViewPlugin/JsvAudio/index.js +26 -0
- package/utils/JsViewPlugin/JsvAudio/version.js +24 -0
- package/utils/JsViewPlugin/JsvPlayer/index.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvHashHistory.js +34 -8
- package/utils/JsViewVueTools/JsvImpactTracer.js +2 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +46 -8
- package/utils/JsViewVueTools/JsvStyleClass.js +9 -0
- package/utils/{JsViewVueWidget/utils/text.js → JsViewVueTools/JsvTextTools.js} +3 -4
- package/utils/JsViewVueTools/TypeCheckAndSet.js +3 -3
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +5 -7
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +20 -22
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +4 -4
- package/utils/JsViewVueWidget/JsvGrid.vue +1 -9
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +1 -1
- package/utils/JsViewVueWidget/JsvMarquee.vue +22 -12
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -53
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +10 -5
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +3 -3
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
- package/utils/JsViewVueWidget/JsvTextBox.vue +11 -31
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +2 -2
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +5 -5
- package/utils/JsViewVueWidget/index.js +8 -8
- package/utils/JsViewVueWidget/utils/index.js +0 -8
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// import playerExMethods from "./JsvMediaBrowserInterface.js"
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
onRef: { type: Function, default: () => {} },
|
|
7
|
+
},
|
|
8
|
+
setup() {
|
|
9
|
+
return {
|
|
10
|
+
audioRef: null,
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
methods: {
|
|
14
|
+
onRefProxy(video_ref) {
|
|
15
|
+
this.audioRef = video_ref;
|
|
16
|
+
|
|
17
|
+
// 不在此直接回调 onRef,因为onRefProxy可能会因为 .src的设置导致重新触发一次调用(vue本身问题)
|
|
18
|
+
// 参照vue-core处理的 componentUpdateFn处理, onMounted 一次, src设置后会再次 onPatch 一次
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
mounted() {
|
|
22
|
+
if (this.audioRef && this.onRef) {
|
|
23
|
+
let video_ref = this.audioRef;
|
|
24
|
+
this.audioRef = null;
|
|
25
|
+
|
|
26
|
+
// 补充插件扩展出来的接口
|
|
27
|
+
// for (let method_name in playerExMethods) {
|
|
28
|
+
// video_ref[method_name] = playerExMethods[method_name].bind(video_ref);
|
|
29
|
+
// }
|
|
30
|
+
|
|
31
|
+
// 将修改好的video回调返回给使用者
|
|
32
|
+
this.onRef(video_ref);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
beforeUnmount() {
|
|
36
|
+
if (this.onRef) {
|
|
37
|
+
// video_ref为null,代表video标签卸载处理
|
|
38
|
+
this.onRef(null);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<audio :ref="onRefProxy" v-bind="$attrs" />
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-02-27 20:04:28
|
|
4
|
+
* @Description: file content
|
|
5
|
+
*/
|
|
6
|
+
import PluginInfo from './version';
|
|
7
|
+
|
|
8
|
+
class PluginLoader {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.onDoneListener = [];
|
|
11
|
+
this.pluginLoadListener = [];
|
|
12
|
+
this.pluginInfo = this.getPluginInfo();
|
|
13
|
+
/**
|
|
14
|
+
* 0:未加载;
|
|
15
|
+
* 1:开始加载;
|
|
16
|
+
* 2:加载旧插件;
|
|
17
|
+
* 3:加载新插件;
|
|
18
|
+
* 4:加载成功;
|
|
19
|
+
* 5:加载失败。
|
|
20
|
+
*/
|
|
21
|
+
this.status = 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getPluginInfo() {
|
|
25
|
+
let info = PluginInfo;
|
|
26
|
+
/** 获取下载链接 */
|
|
27
|
+
if (typeof window.jJsvRuntimeBridge !== 'undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined") {
|
|
28
|
+
let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
|
|
29
|
+
if (plugin_base_url) {
|
|
30
|
+
info.downloadUrl = (plugin_base_url[plugin_base_url.length - 1] === "/" ? plugin_base_url : (plugin_base_url + "/")) + info.packageName + "/JsvAudio-" + info.versionCodeMax + ".dat?md5=" + info.md5;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return info;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
registerOnDoneListener(listener) {
|
|
37
|
+
if (listener) {
|
|
38
|
+
this.onDoneListener.push(listener);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* listener回调处理中参数信息的说明:
|
|
44
|
+
* 插件加载状态回调。
|
|
45
|
+
* 回调函数的参数定义如下:
|
|
46
|
+
* 1:无法正常加载插件。
|
|
47
|
+
* 2:正在加载旧插件,此时插件加载过程很短,可以不用出现用户提示界面。
|
|
48
|
+
* 3:正在加载新插件,此时插件需要经历下载、解压等过程,用时较长,可以考虑给用户相关提示。
|
|
49
|
+
* 4:插件加载完成。
|
|
50
|
+
* 5:已加载不同版本的插件,此版本无法加载。
|
|
51
|
+
*
|
|
52
|
+
* 备注:不管插件加载处于什么状态,都可以正常使用播放器组件,播放器对象在插件未加载完成的情况下,会把相关状态保存,等完成加载后再自动下发。
|
|
53
|
+
*/
|
|
54
|
+
loadPlugin(listener) {
|
|
55
|
+
console.log("globalLoadJsvAudioPlugin");
|
|
56
|
+
let plugin_status = 0;
|
|
57
|
+
if (typeof window.jPluginManagerBridge === 'undefined' || !window.jPluginManagerBridge) {
|
|
58
|
+
plugin_status = 1;
|
|
59
|
+
} else if (this.status === 2) {
|
|
60
|
+
plugin_status = 2;
|
|
61
|
+
} else if (this.status === 3) {
|
|
62
|
+
plugin_status = 3;
|
|
63
|
+
} else if (this.status === 4) {
|
|
64
|
+
plugin_status = 4;
|
|
65
|
+
} else if (this.status === 5) {
|
|
66
|
+
plugin_status = 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (plugin_status !== 0) {
|
|
70
|
+
if (typeof listener !== "undefined" && listener) {
|
|
71
|
+
setTimeout(() => { listener(plugin_status) }, 0);
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (typeof listener !== "undefined" && listener) {
|
|
77
|
+
this.pluginLoadListener.push(listener);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (this.status > 0) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.status = 1;
|
|
84
|
+
|
|
85
|
+
window.jPluginManagerBridge.LoadPlugin(JSON.stringify(this.pluginInfo));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
onStatusChange(status) {
|
|
89
|
+
console.log("JsvAudioPluginStatus: " + status);
|
|
90
|
+
let ret = JSON.parse(status);
|
|
91
|
+
|
|
92
|
+
let plugin_status = 2;
|
|
93
|
+
if (ret && ret.first_load) {
|
|
94
|
+
this.status = 3;
|
|
95
|
+
plugin_status = 3;
|
|
96
|
+
} else {
|
|
97
|
+
this.status = 2;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
for (let i = 0; i < this.pluginLoadListener.length; i++) {
|
|
101
|
+
this.pluginLoadListener[i](plugin_status);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
onLoadDone(result) {
|
|
106
|
+
console.log("JsvAudioPluginLoadResult: " + result);
|
|
107
|
+
let ret_obj = JSON.parse(result)
|
|
108
|
+
let plugin_status = 1;
|
|
109
|
+
if (ret_obj && (ret_obj.status === 4 || ret_obj.status === 1)) {
|
|
110
|
+
this.status = 4;
|
|
111
|
+
plugin_status = 4;
|
|
112
|
+
} else if (ret_obj && ret_obj.status === -12) {
|
|
113
|
+
this.status = 5;
|
|
114
|
+
plugin_status = 5;
|
|
115
|
+
} else {
|
|
116
|
+
this.status = 5;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (this.status === 5) {
|
|
120
|
+
console.log("*************************JsvAudio plugin load failed, error code is " + ret_obj.status + "*************************");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
for (let i = 0; i < this.pluginLoadListener.length; i++) {
|
|
124
|
+
this.pluginLoadListener[i](plugin_status);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
for (let listener of this.onDoneListener) {
|
|
128
|
+
listener(plugin_status);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
registerGlobalListener() {
|
|
133
|
+
window.top.JsvAudioPluginStatus = this.onStatusChange.bind(this);
|
|
134
|
+
window.top.JsvAudioPluginLoadResult = this.onLoadDone.bind(this);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const sPluginLoader = new PluginLoader();
|
|
139
|
+
sPluginLoader.registerGlobalListener();
|
|
140
|
+
export default sPluginLoader;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-02-28 10:18:42
|
|
4
|
+
* @Description: file content
|
|
5
|
+
*/
|
|
6
|
+
import sPluginLoader from "./PluginLoader.js";
|
|
7
|
+
import JsvAudio from "./JsvAudio.vue"
|
|
8
|
+
|
|
9
|
+
let globalLoadJsvAudioPlugin;
|
|
10
|
+
let _JsvAudio;
|
|
11
|
+
if (window.JsvWidgetWrapperGroup?.BrowserJsvAudio) {
|
|
12
|
+
//browser
|
|
13
|
+
globalLoadJsvAudioPlugin = (listener) => {
|
|
14
|
+
setTimeout(listener, 0);
|
|
15
|
+
};
|
|
16
|
+
_JsvAudio = window.JsvWidgetWrapperGroup.BrowserJsvAudio.default;
|
|
17
|
+
} else {
|
|
18
|
+
//jsview
|
|
19
|
+
globalLoadJsvAudioPlugin = sPluginLoader.loadPlugin.bind(sPluginLoader);
|
|
20
|
+
_JsvAudio = JsvAudio;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
_JsvAudio as default,
|
|
25
|
+
globalLoadJsvAudioPlugin,
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-02-22 18:22:26
|
|
4
|
+
* @Description: file content
|
|
5
|
+
*/
|
|
6
|
+
let PluginInfo={
|
|
7
|
+
// downloadUrl:"http://192.168.0.63:8080/plugin/JsvAudio-164.zip", //插件下载地址
|
|
8
|
+
packageName:"com.qcode.jsvaudio",
|
|
9
|
+
name:"音频插件",
|
|
10
|
+
version:"1.0.1", //插件需要的版本号
|
|
11
|
+
versionCodeMin:1,
|
|
12
|
+
versionCodeMax:1,
|
|
13
|
+
bridgeName:"jsvAudioBridge", //插件bridge注册到jsview的名称
|
|
14
|
+
className:"com.qcode.jsvaudio.JsvAudio", //插件初始化类名称
|
|
15
|
+
initMethod:"createInstance", //插件初始化方法
|
|
16
|
+
listener:"top.JsvAudioPluginLoadResult", //插件加载结果回调
|
|
17
|
+
listener2: "top.JsvAudioPluginStatus",
|
|
18
|
+
// debug:true,
|
|
19
|
+
// md5:"baafc8ea737adcad5443f44cc0112498"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// 不要用export default,update-env脚本不能解析
|
|
23
|
+
// 导出字段要含有 pluginVersionInfo 信息,作为npm时版本参考
|
|
24
|
+
module.exports = PluginInfo;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
let PluginInfo={
|
|
2
|
-
// downloadUrl:"http://
|
|
2
|
+
// downloadUrl:"http://10.61.2.170:8080/plugin/JsvPlayer-194.zip", //插件下载地址
|
|
3
3
|
packageName:"com.qcode.jsvplayer",
|
|
4
4
|
name:"播放器插件",
|
|
5
|
-
version:"1.
|
|
6
|
-
versionCodeMin:
|
|
7
|
-
versionCodeMax:
|
|
5
|
+
version:"1.9.6", //插件需要的版本号
|
|
6
|
+
versionCodeMin:196,
|
|
7
|
+
versionCodeMax:196,
|
|
8
8
|
bridgeName:"jsvPlayerBridge", //插件bridge注册到jsview的名称
|
|
9
9
|
className:"com.qcode.jsvplayer.JsvPlayer", //插件初始化类名称
|
|
10
10
|
initMethod:"createInstance", //插件初始化方法
|
|
11
11
|
listener:"top.JsvPlayerPluginLoadResult", //插件加载结果回调
|
|
12
12
|
listener2: "top.JsvPlayerPluginStatus",
|
|
13
13
|
// debug:true,
|
|
14
|
-
md5:"
|
|
14
|
+
md5:"e671a5c28a8fece02115625430c6b56d"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// 不要用export default,update-env脚本不能解析
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createMemoryHistory, createWebHashHistory }
|
|
1
|
+
import { createMemoryHistory, createWebHashHistory } from "vue-router";
|
|
2
2
|
|
|
3
3
|
class JsvHashHistory {
|
|
4
4
|
constructor(base) {
|
|
5
|
-
if(window.jsvIsBrowserDebug) {
|
|
5
|
+
if (window.jsvIsBrowserDebug) {
|
|
6
6
|
this.#history = createWebHashHistory(base)
|
|
7
7
|
} else {
|
|
8
8
|
this.#history = this.#createMockHashHistory(base);
|
|
@@ -32,7 +32,7 @@ class JsvHashHistory {
|
|
|
32
32
|
replace(to, data) {
|
|
33
33
|
this.#history.replace(to, data);
|
|
34
34
|
this.#updateLocation(this.#history.location);
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
36
|
|
|
37
37
|
push(to, data) {
|
|
38
38
|
this.#history.push(to, data);
|
|
@@ -52,20 +52,23 @@ class JsvHashHistory {
|
|
|
52
52
|
// 抄 createWebHashHistory 作业
|
|
53
53
|
base = location.host ? base || location.pathname + location.search : '';
|
|
54
54
|
if (!base.includes('#'))
|
|
55
|
-
|
|
55
|
+
base += '#';
|
|
56
56
|
if (!base.endsWith('#/') && !base.endsWith('#')) {
|
|
57
|
-
|
|
57
|
+
console.warn(`A hash base must end with a "#":\n"${base}" should be "${base.replace(/#.*$/, '#')}".`);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
this.baseURL = window.location.origin + base;
|
|
61
61
|
|
|
62
62
|
const history = createMemoryHistory(base)
|
|
63
63
|
const initHash = this.#getInitHash();
|
|
64
|
-
if(initHash) {
|
|
64
|
+
if (initHash) {
|
|
65
65
|
// 已设置hash,替换到hash页面
|
|
66
66
|
history.replace({
|
|
67
67
|
path: initHash.substring(1),// 去除#
|
|
68
|
-
|
|
68
|
+
|
|
69
|
+
// 测试链接: http://192.168.2.179:8082/js/main.jsv.js?bcd=333&xyz=456#/feature/Basic?aa=1&bb=2
|
|
70
|
+
// App 中获取的 router.currentRoute.query的内容为 {aa:1, bb:2}
|
|
71
|
+
query: this.#splitSearch(window.location.hash)
|
|
69
72
|
});
|
|
70
73
|
} else {
|
|
71
74
|
// 未设置hash定位,追加hash根的显示
|
|
@@ -95,7 +98,7 @@ class JsvHashHistory {
|
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
#updateLocation(location) {
|
|
98
|
-
if(!window.jsvIsBrowserDebug) {
|
|
101
|
+
if (!window.jsvIsBrowserDebug) {
|
|
99
102
|
const url = new window.JsView.Dom.UrlRef(
|
|
100
103
|
location ? this.baseURL + location : this.baseURL,
|
|
101
104
|
true
|
|
@@ -104,6 +107,29 @@ class JsvHashHistory {
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
|
|
110
|
+
#splitSearch(hash) {
|
|
111
|
+
if (!hash || hash.length == 0) {
|
|
112
|
+
return {};
|
|
113
|
+
} else {
|
|
114
|
+
let hashSearchIndex = hash.indexOf('?');
|
|
115
|
+
if (hashSearchIndex >= 0) {
|
|
116
|
+
let arr = hash.substr(hashSearchIndex + 1).split('&');
|
|
117
|
+
let target = {};
|
|
118
|
+
for (let i = 0; i < arr.length; i++) {
|
|
119
|
+
let num = arr[i].indexOf("=");
|
|
120
|
+
if (num > 0) {
|
|
121
|
+
let name = arr[i].substring(0, num);
|
|
122
|
+
let value = arr[i].substr(num + 1);
|
|
123
|
+
target[name] = value;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return target;
|
|
127
|
+
} else {
|
|
128
|
+
return {};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
107
133
|
#history;
|
|
108
134
|
}
|
|
109
135
|
|
|
@@ -40,7 +40,7 @@ function createImpactCallback(on_contact, on_dis_contact) {
|
|
|
40
40
|
* Object 句柄,提供 Recycle() 函数用于停止碰撞检测,需要再componentWillUnmount进行调用(清理)
|
|
41
41
|
*/
|
|
42
42
|
function createImpactTracer(ele1, ele2, callback, auto_froze) {
|
|
43
|
-
return Forge.sImpactSensorManager.StartTrace(ele1.
|
|
43
|
+
return Forge.sImpactSensorManager.StartTrace(ele1.jsvGetProxyView(), ele2.jsvGetProxyView(), callback, auto_froze);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// 创建用于设置碰撞即停管理对象的参数
|
|
@@ -49,7 +49,7 @@ function _ConvertToViewsList(elements_array) {
|
|
|
49
49
|
const views_array = [];
|
|
50
50
|
if (elements_array) {
|
|
51
51
|
for (const ele of elements_array) {
|
|
52
|
-
views_array.push(ele.
|
|
52
|
+
views_array.push(ele.jsvGetProxyView());
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
return views_array;
|
|
@@ -96,10 +96,10 @@ function getAndroidId(){
|
|
|
96
96
|
*/
|
|
97
97
|
function openWindow(url, startup_image, startup_video, startup_duration, add_history){
|
|
98
98
|
let setting = {};
|
|
99
|
-
if(startup_image !== null && startup_image !== "")
|
|
99
|
+
if(typeof startup_image !== undefined && startup_image !== null && startup_image !== "")
|
|
100
100
|
setting.startupImage = startup_image;
|
|
101
101
|
|
|
102
|
-
if(startup_video !== null && startup_video !== ""){
|
|
102
|
+
if(typeof startup_video !== undefined && startup_video !== null && startup_video !== ""){
|
|
103
103
|
setting.startupVideo = startup_video;
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -148,27 +148,50 @@ function getInstalledApps(){
|
|
|
148
148
|
*/
|
|
149
149
|
function startNativeApp(package_name, activity, action, uri, flags, param){
|
|
150
150
|
var obj = {};
|
|
151
|
-
if(package_name !== null && package_name !== "")
|
|
151
|
+
if(typeof package_name != undefined && package_name !== null && package_name !== "")
|
|
152
152
|
obj.packageName = package_name;
|
|
153
153
|
|
|
154
|
-
if(activity !== null && activity !== "")
|
|
154
|
+
if(typeof activity != undefined && activity !== null && activity !== "")
|
|
155
155
|
obj.activity = activity;
|
|
156
156
|
|
|
157
|
-
if(action !== null && action !== "")
|
|
157
|
+
if(typeof action != undefined && action !== null && action !== "")
|
|
158
158
|
obj.action = action;
|
|
159
159
|
|
|
160
|
-
if(uri !== null && uri !== "")
|
|
160
|
+
if(typeof uri != undefined && uri !== null && uri !== "")
|
|
161
161
|
obj.uri = uri;
|
|
162
162
|
|
|
163
|
-
if(flags !== null && flags.length > 0)
|
|
163
|
+
if(typeof flags != undefined && flags !== null && flags.length > 0)
|
|
164
164
|
obj.flags = flags;
|
|
165
165
|
|
|
166
|
-
if(param !== null && param.length > 0)
|
|
166
|
+
if(typeof param != undefined && param !== null && param.length > 0)
|
|
167
167
|
obj.param = param;
|
|
168
168
|
|
|
169
169
|
direct_call("startNativeApp", JSON.stringify(obj));
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
function sendNativeBroadcast(package_name, broadcast, action, uri, flags, param){
|
|
173
|
+
|
|
174
|
+
var obj = {};
|
|
175
|
+
if(typeof package_name != undefined && package_name !== null && package_name !== "")
|
|
176
|
+
obj.packageName = package_name;
|
|
177
|
+
|
|
178
|
+
if(typeof broadcast != undefined && broadcast !== null && broadcast !== "")
|
|
179
|
+
obj.broadcast = broadcast;
|
|
180
|
+
|
|
181
|
+
if(typeof action != undefined && action !== null && action !== "")
|
|
182
|
+
obj.action = action;
|
|
183
|
+
|
|
184
|
+
if(typeof uri != undefined && uri !== null && uri !== "")
|
|
185
|
+
obj.uri = uri;
|
|
186
|
+
|
|
187
|
+
if(typeof flags != undefined && flags !== null && flags.length > 0)
|
|
188
|
+
obj.flags = flags;
|
|
189
|
+
|
|
190
|
+
if(typeof param != undefined && param !== null && param.length > 0)
|
|
191
|
+
obj.param = param;
|
|
192
|
+
direct_call("sendNativeBroadcast", JSON.stringify(obj));
|
|
193
|
+
}
|
|
194
|
+
|
|
172
195
|
/**
|
|
173
196
|
* 获取设备信息
|
|
174
197
|
* @returns {string} 终端设备信息,JSON数据结构
|
|
@@ -178,6 +201,14 @@ function getDeviceInfo() {
|
|
|
178
201
|
return direct_call("getDeviceInfo");
|
|
179
202
|
}
|
|
180
203
|
|
|
204
|
+
/**
|
|
205
|
+
* 获取自己的app信息
|
|
206
|
+
* @returns
|
|
207
|
+
*/
|
|
208
|
+
function getAppInfo(){
|
|
209
|
+
return direct_call("getAppInfo");
|
|
210
|
+
}
|
|
211
|
+
|
|
181
212
|
/**
|
|
182
213
|
* 页面加载成功后调用去除启动图
|
|
183
214
|
*
|
|
@@ -335,6 +366,10 @@ function popupGainFocus() {
|
|
|
335
366
|
direct_call("popupGainFocus");
|
|
336
367
|
}
|
|
337
368
|
|
|
369
|
+
function popupDiscardFocus(){
|
|
370
|
+
direct_call("popupGainFocus");
|
|
371
|
+
}
|
|
372
|
+
|
|
338
373
|
/**
|
|
339
374
|
* 页面预热接口,预热页面将会将以一个新的FrameLayout(内含JsView)的方式加载一个新的应用
|
|
340
375
|
* 但这个应用在warmLoadView之前,不会创建texture/surface的实际描画资源,也不会加载图片
|
|
@@ -398,7 +433,9 @@ const bridge = {
|
|
|
398
433
|
getSystemProperty,
|
|
399
434
|
getInstalledApps,
|
|
400
435
|
startNativeApp,
|
|
436
|
+
sendNativeBroadcast,
|
|
401
437
|
getDeviceInfo,
|
|
438
|
+
getAppInfo,
|
|
402
439
|
notifyPageLoadDone,
|
|
403
440
|
notifyPageLoaded,
|
|
404
441
|
hasFavouriteFunction,
|
|
@@ -410,6 +447,7 @@ const bridge = {
|
|
|
410
447
|
setPopupInitSize,
|
|
411
448
|
popupResizePosition,
|
|
412
449
|
popupGainFocus,
|
|
450
|
+
popupDiscardFocus,
|
|
413
451
|
warmUpView,
|
|
414
452
|
warmLoadView,
|
|
415
453
|
closeWarmedView
|
|
@@ -233,6 +233,7 @@ class JsvTextStyleClass extends JsvStyleClass {
|
|
|
233
233
|
this.jsvTextAttributes = {
|
|
234
234
|
jsv_text_line_align: "middle", // 文字行内垂直对齐方式
|
|
235
235
|
jsv_text_vertical_align: "top", // 文字区域内垂直对齐方式
|
|
236
|
+
jsv_text_ellipsis: "end", //文字省略部分
|
|
236
237
|
};
|
|
237
238
|
}
|
|
238
239
|
|
|
@@ -244,6 +245,10 @@ class JsvTextStyleClass extends JsvStyleClass {
|
|
|
244
245
|
this.jsvTextAttributes.jsv_text_line_align = new_align;
|
|
245
246
|
}
|
|
246
247
|
|
|
248
|
+
setEllipsis(new_ellipsis) {
|
|
249
|
+
this.jsvTextAttributes.jsv_text_ellipsis = new_ellipsis;
|
|
250
|
+
}
|
|
251
|
+
|
|
247
252
|
// 注意:此接口仅提供给JsViewReactWidget中的hoc调用,
|
|
248
253
|
getVerticalAlign() {
|
|
249
254
|
return this.jsvTextAttributes.jsv_text_vertical_align;
|
|
@@ -254,6 +259,10 @@ class JsvTextStyleClass extends JsvStyleClass {
|
|
|
254
259
|
return this.jsvTextAttributes.jsv_text_line_align;
|
|
255
260
|
}
|
|
256
261
|
|
|
262
|
+
getEllipsis() {
|
|
263
|
+
return this.jsvTextAttributes.jsv_text_ellipsis;
|
|
264
|
+
}
|
|
265
|
+
|
|
257
266
|
// Override
|
|
258
267
|
classType() {
|
|
259
268
|
return CONST_TYPE_TEXT;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-11-
|
|
3
|
+
* @Date: 2022-11-29 14:26:20
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-11-
|
|
5
|
+
* @LastEditTime: 2022-11-29 14:27:03
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
const getTextWidth = (text, style) => {
|
|
@@ -15,5 +15,4 @@ const getTextWidth = (text, style) => {
|
|
|
15
15
|
};
|
|
16
16
|
return window.PlatformUtils.GetTextWidth(textParams);
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
export { getTextWidth };
|
|
18
|
+
export { getTextWidth };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var number_convert_tmp = new Float32Array(1);
|
|
2
2
|
|
|
3
3
|
function numberCheckSet(number) {
|
|
4
|
-
number_convert_tmp = number; // 强制类型转换, 避免JSON化时类型出错,因为 '123' 123 都能通过Nan检测
|
|
5
|
-
if (!isNaN(number_convert_tmp)) {
|
|
6
|
-
return number_convert_tmp;
|
|
4
|
+
number_convert_tmp[0] = number; // 强制类型转换, 避免JSON化时类型出错,因为 '123' 123 都能通过Nan检测
|
|
5
|
+
if (!isNaN(number_convert_tmp[0])) {
|
|
6
|
+
return number_convert_tmp[0];
|
|
7
7
|
} else {
|
|
8
8
|
console.warn(`${number} is not type of number, default as 0`);
|
|
9
9
|
return 0;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-07-05 14:09:55
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-11-29 14:34:45
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -17,4 +17,5 @@ export * from "./JsvStyleClass.js";
|
|
|
17
17
|
export * from "./DebugContentShellJBridge.js";
|
|
18
18
|
export * from "./DebugTool.js";
|
|
19
19
|
export * from "./JsvImpactTracer.js";
|
|
20
|
+
export * from "./JsvTextTools.js";
|
|
20
21
|
export { default as DefaultKeyCodeMap } from "./DefaultKeyMap.js";
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-02-08 09:29:17
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-11-24 10:15:37
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import { ref } from "vue";
|
|
10
9
|
import { getKeyFramesGroup } from "jsview/utils/JsViewVueTools/JsvDynamicKeyFrames";
|
|
11
10
|
|
|
12
11
|
const DECORATE_BORDER_RADIUS = "BroderRaidus";
|
|
@@ -102,7 +101,7 @@ export default {
|
|
|
102
101
|
type: Object,
|
|
103
102
|
},
|
|
104
103
|
},
|
|
105
|
-
setup(
|
|
104
|
+
setup() {
|
|
106
105
|
let styleShell = getKeyFramesGroup();
|
|
107
106
|
return {
|
|
108
107
|
styleShell,
|
|
@@ -205,15 +204,14 @@ export default {
|
|
|
205
204
|
overflow: 'hidden',
|
|
206
205
|
};
|
|
207
206
|
}
|
|
208
|
-
}
|
|
209
|
-
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
210
209
|
left: this.left + "px",
|
|
211
210
|
top: this.top + "px",
|
|
212
211
|
width: this.width + "px",
|
|
213
212
|
height: this.height + "px",
|
|
214
213
|
overflow: 'hidden',
|
|
215
214
|
};
|
|
216
|
-
}
|
|
217
215
|
},
|
|
218
216
|
},
|
|
219
217
|
methods: {
|
|
@@ -250,7 +248,7 @@ export default {
|
|
|
250
248
|
|
|
251
249
|
this.animDiv.appendChild(imgDiv);
|
|
252
250
|
clipDiv.appendChild(this.animDiv);
|
|
253
|
-
this.$refs.root.
|
|
251
|
+
this.$refs.root.jsvGetProxyView(true).Element.appendChild(clipDiv);
|
|
254
252
|
|
|
255
253
|
this.watcherHandlerList.push(
|
|
256
254
|
this.$watch("left", (newValue) => {
|
|
@@ -33,32 +33,30 @@
|
|
|
33
33
|
* 功能:暂停动画,并将JsvActorMove保持在暂停的位置上
|
|
34
34
|
|
|
35
35
|
-->
|
|
36
|
-
<script>
|
|
36
|
+
<script setup>
|
|
37
37
|
import JsvActorMoveControl from "./JsvActorMoveControl";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
refDefine: Object,
|
|
45
|
-
},
|
|
46
|
-
mounted() {
|
|
47
|
-
this.control._SetView(this.$refs.element.jsvMainView);
|
|
48
|
-
if (this.refDefine) {
|
|
49
|
-
const type = typeof this.refDefine;
|
|
50
|
-
if (type === "object") {
|
|
51
|
-
this.refDefine.current = this.$refs.element;
|
|
52
|
-
} else if (type === "function") {
|
|
53
|
-
this.refDefine(this.$refs.element);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
38
|
+
import { shallowRef, onMounted } from "vue";
|
|
39
|
+
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
control: {
|
|
42
|
+
type: JsvActorMoveControl,
|
|
43
|
+
required: true,
|
|
56
44
|
},
|
|
57
|
-
};
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
let mainDivRef = shallowRef(null);
|
|
48
|
+
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
props.control._SetView(mainDivRef.value.jsvGetProxyView());
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
defineExpose({
|
|
54
|
+
mainDiv: mainDivRef,
|
|
55
|
+
});
|
|
58
56
|
</script>
|
|
59
57
|
|
|
60
58
|
<template>
|
|
61
|
-
<div ref="
|
|
59
|
+
<div ref="mainDivRef">
|
|
62
60
|
<slot></slot>
|
|
63
61
|
</div>
|
|
64
|
-
</template>
|
|
62
|
+
</template>
|