@shijiu/jsview-vue 0.9.590 → 0.9.602
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 -4
- package/package.json +1 -1
- package/samples/Basic/components/div/DivLayout.vue +34 -5
- package/samples/MetroWidgetDemos/Advanced/App.vue +7 -171
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +70 -0
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +77 -0
- package/samples/MetroWidgetDemos/Advanced/Widgets.vue +71 -0
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
- package/samples/MetroWidgetDemos/Simple/App.vue +5 -154
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +11 -5
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +3 -4
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +6 -1
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +6 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-07-11 13:31:36
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-18 10:07:01
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script setup>
|
|
9
|
+
import { MetroWidget, WholePageSlide, HORIZONTAL, EdgeDirection } from "jsview";
|
|
10
|
+
import { ref } from "vue";
|
|
11
|
+
import { useFocusHub } from "jsview";
|
|
12
|
+
import { simpleData } from "../data";
|
|
13
|
+
import Item from "../Item.vue";
|
|
14
|
+
|
|
15
|
+
const foucsHub = useFocusHub();
|
|
16
|
+
const mwRef = ref(null);
|
|
17
|
+
|
|
18
|
+
const wholePageSlide = new WholePageSlide();
|
|
19
|
+
let innerData = simpleData.concat();
|
|
20
|
+
let dataPool = [];
|
|
21
|
+
|
|
22
|
+
const provideData = () => {
|
|
23
|
+
return innerData;
|
|
24
|
+
};
|
|
25
|
+
const measures = (item) => {
|
|
26
|
+
return {
|
|
27
|
+
width: item.width,
|
|
28
|
+
height: item.height,
|
|
29
|
+
marginRight: item.marginRight,
|
|
30
|
+
marginBottom: item.marginBottom,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const onEdge = (edgeInfo) => {
|
|
34
|
+
// MetroWidget焦点到达边缘后的回调
|
|
35
|
+
if (edgeInfo.direction == EdgeDirection.top) {
|
|
36
|
+
buttonFocus.value = true;
|
|
37
|
+
foucsHub.setFocus("button");
|
|
38
|
+
} else if (edgeInfo.direction == EdgeDirection.right) {
|
|
39
|
+
foucsHub.setFocus("mwAbs");
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const buttonFocus = ref(true);
|
|
44
|
+
const buttonOnKeyDown = (ev) => {
|
|
45
|
+
switch (ev.keyCode) {
|
|
46
|
+
case 40:
|
|
47
|
+
buttonFocus.value = false;
|
|
48
|
+
foucsHub.setFocus("mw");
|
|
49
|
+
return true;
|
|
50
|
+
case 13:
|
|
51
|
+
if (innerData.length == simpleData.length) {
|
|
52
|
+
innerData = [];
|
|
53
|
+
dataPool = simpleData.concat();
|
|
54
|
+
} else {
|
|
55
|
+
innerData.push(dataPool.shift());
|
|
56
|
+
}
|
|
57
|
+
mwRef.value?.refreshData(true);
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<jsv-focus-block
|
|
66
|
+
name="button"
|
|
67
|
+
:onAction="{
|
|
68
|
+
onKeyDown: buttonOnKeyDown,
|
|
69
|
+
}"
|
|
70
|
+
>
|
|
71
|
+
<div
|
|
72
|
+
:style="{
|
|
73
|
+
left: 100,
|
|
74
|
+
top: 50,
|
|
75
|
+
width: 500,
|
|
76
|
+
height: 100,
|
|
77
|
+
color: '#FFFFFF',
|
|
78
|
+
fontSize: 30,
|
|
79
|
+
backgroundColor: buttonFocus ? '#AA0000' : '#444444',
|
|
80
|
+
}"
|
|
81
|
+
>
|
|
82
|
+
{{ `自适应布局\n获焦时按确认查看时item排布的方式` }}
|
|
83
|
+
</div>
|
|
84
|
+
</jsv-focus-block>
|
|
85
|
+
|
|
86
|
+
<!-- item的排布区域为600*300, 但由于获焦时需要放大, 因此需要往外扩展padding, 合起来宽高为700*400 -->
|
|
87
|
+
<metro-widget
|
|
88
|
+
name="mw"
|
|
89
|
+
ref="mwRef"
|
|
90
|
+
:top="150"
|
|
91
|
+
:left="50"
|
|
92
|
+
:provideData="provideData"
|
|
93
|
+
:width="500"
|
|
94
|
+
:height="400"
|
|
95
|
+
:padding="{
|
|
96
|
+
left: 50,
|
|
97
|
+
top: 50,
|
|
98
|
+
right: 50,
|
|
99
|
+
bottom: 50,
|
|
100
|
+
}"
|
|
101
|
+
:direction="HORIZONTAL"
|
|
102
|
+
:measures="measures"
|
|
103
|
+
:slideSetting="wholePageSlide"
|
|
104
|
+
:onEdge="onEdge"
|
|
105
|
+
>
|
|
106
|
+
<!-- data为每个item的数据, query提供获取MetroWidget内部状态的一些接口, onAction提供item注册自身回调的接口 -->
|
|
107
|
+
<template #renderItem="{ data, query, onAction }">
|
|
108
|
+
<item :data="data" :query="query" :onAction="onAction" />
|
|
109
|
+
</template>
|
|
110
|
+
</metro-widget>
|
|
111
|
+
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-09-22 16:08:58
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-08-09 11:10:07
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -1349,8 +1349,11 @@ const _calculateVisibleStart = (target_item, direction) => {
|
|
|
1349
1349
|
|
|
1350
1350
|
if ((props.slideSetting.BoundaryProtect & SlideSetting.START_PROTECT) > 0) {
|
|
1351
1351
|
let boundary = 0;
|
|
1352
|
-
|
|
1353
|
-
|
|
1352
|
+
//首个元素是占位符时, 在保证获焦区域完全展示的前提下要保证首个不可获焦元素的完全展示
|
|
1353
|
+
if (
|
|
1354
|
+
!templateParser.GetItem(0).focusable &&
|
|
1355
|
+
target_item[pos_key] + target_item[size_key] <= visibleInfo.range
|
|
1356
|
+
) {
|
|
1354
1357
|
boundary = templateParser.GetItem(0)[size_key];
|
|
1355
1358
|
}
|
|
1356
1359
|
new_visible_start = new_visible_start < boundary ? 0 : new_visible_start;
|
|
@@ -1361,8 +1364,11 @@ const _calculateVisibleStart = (target_item, direction) => {
|
|
|
1361
1364
|
last_item[pos_key] + last_item[size_key] - visibleInfo.range;
|
|
1362
1365
|
last_visible_start = last_visible_start < 0 ? 0 : last_visible_start;
|
|
1363
1366
|
let boundary = last_visible_start;
|
|
1364
|
-
if (
|
|
1365
|
-
|
|
1367
|
+
if (
|
|
1368
|
+
!last_item.focusable &&
|
|
1369
|
+
target_item[pos_key] - last_visible_start >= 0
|
|
1370
|
+
) {
|
|
1371
|
+
//最后元素是占位符, 在保证获焦区域完全展示的前提下要保证不可获焦元素的完全展示
|
|
1366
1372
|
boundary = last_item[pos_key] - visibleInfo.range;
|
|
1367
1373
|
}
|
|
1368
1374
|
new_visible_start =
|
|
@@ -867,7 +867,7 @@ class JsvBaseMedia {
|
|
|
867
867
|
}
|
|
868
868
|
|
|
869
869
|
/**
|
|
870
|
-
* 属性,double
|
|
870
|
+
* 属性,double类型,可播放时长,本地缓存的视频时长,只支持读取。
|
|
871
871
|
*/
|
|
872
872
|
get playableDuration() {
|
|
873
873
|
return this.local.playableDuration;
|
|
@@ -893,7 +893,7 @@ class JsvBaseMedia {
|
|
|
893
893
|
* @param {string} head 网络请求的head信息,可以为NULL。
|
|
894
894
|
* @param {int} type 类型,1表示点播,2表示直播,3表示时移,默认1。
|
|
895
895
|
* @param {double} timeShift 时移时间,只有在type=3时才有效,表示从当前时间时移多长时间,单位秒。
|
|
896
|
-
* @param {int}
|
|
896
|
+
* @param {int} 分辨率类型 0:unknown或其它;1:标清;2:高清;3:超清(720P);4:蓝光(1080P);5:2K;6:4K;7:8K。
|
|
897
897
|
*/
|
|
898
898
|
setSrc(url, head, type, timeShift, resolution){
|
|
899
899
|
let src = {};
|
|
@@ -978,7 +978,6 @@ class JsvBaseMedia {
|
|
|
978
978
|
* 如频道地址为 igmp://的组播地址,则加入组播频道,播放器开始播放组播频道,并处理相应的时移等功能;
|
|
979
979
|
* 如频道地址为 rtsp://的单播地址,则连接单播频道,播放器开始播放;
|
|
980
980
|
* 如频道地址为 http://的地址,则浏览器直接发起请求,访问该页面。
|
|
981
|
-
* 【注】:在加入一个频道之前已经加入另外一个频道,需先调用 leaveChannel 方法离开前一个频道。
|
|
982
981
|
* @param {int} mixNo 用户频道号。
|
|
983
982
|
* @returns {int} 0,表示成功;-1:表示频道号无效。
|
|
984
983
|
*/
|
|
@@ -1244,7 +1243,7 @@ class JsvMediaVideo extends JsvMedia {
|
|
|
1244
1243
|
|
|
1245
1244
|
/**
|
|
1246
1245
|
* 属性,string类型,设置和读取显示模式。
|
|
1247
|
-
* full(fill模式)表示拉升至充满显示区域;origin(contain模式)表示原始比例缩放至宽或高和显示区域相等(不超过显示区域);x:y
|
|
1246
|
+
* full(fill模式)表示拉升至充满显示区域;origin(contain模式)表示原始比例缩放至宽或高和显示区域相等(不超过显示区域);x:y表示按照指定比例显示。
|
|
1248
1247
|
*/
|
|
1249
1248
|
get videoAspectRatio() {
|
|
1250
1249
|
return this.getState("aspectRatio");
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
let PluginInfo={
|
|
2
|
-
// downloadUrl:"http://192.168.0.
|
|
2
|
+
// downloadUrl:"http://192.168.0.63:8080/plugin/JsvPlayer-164.zip", //插件下载地址
|
|
3
3
|
packageName:"com.qcode.jsvplayer",
|
|
4
4
|
name:"播放器插件",
|
|
5
|
-
version:"1.6.
|
|
6
|
-
versionCodeMin:
|
|
7
|
-
versionCodeMax:
|
|
5
|
+
version:"1.6.5", //插件需要的版本号
|
|
6
|
+
versionCodeMin:165,
|
|
7
|
+
versionCodeMax:165,
|
|
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:"1d06b3a8acba255efb4826a15a7fb480"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// 不要用export default,update-env脚本不能解析
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-10-13 13:14:42
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-08-02 13:35:10
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -175,5 +175,5 @@ export default {
|
|
|
175
175
|
</script>
|
|
176
176
|
|
|
177
177
|
<template>
|
|
178
|
-
<img alt="" ref="element" :src="src" :style="style" />
|
|
178
|
+
<img jsv_disable_apic_autoplay alt="" ref="element" :src="src" :style="style" />
|
|
179
179
|
</template>
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* onBlur {Function} 失去焦点的回调
|
|
22
22
|
* swipeType {String} 切换方式,目前只支持 translate,之后可能会添加 opacity 等方式
|
|
23
23
|
* smoothTranslate {boolean} 平滑模式动画开关
|
|
24
|
+
* reverseSwipe {boolean} 反转滚动方向,默认值为false. 默认滚动方向是正向, 既向index增大的方向, 反转后为反向, 既向index减小的方向
|
|
24
25
|
* public methods:
|
|
25
26
|
* slideTo
|
|
26
27
|
* @description 滚动到指定id
|
|
@@ -123,6 +124,10 @@ export default {
|
|
|
123
124
|
type: Boolean,
|
|
124
125
|
default: false,
|
|
125
126
|
},
|
|
127
|
+
reverseSwipe: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: false,
|
|
130
|
+
}
|
|
126
131
|
},
|
|
127
132
|
computed: {
|
|
128
133
|
indicatorLayout() {
|
|
@@ -263,7 +268,7 @@ export default {
|
|
|
263
268
|
clearInterval(this.timeoutHandler);
|
|
264
269
|
}
|
|
265
270
|
this.timeoutHandler = setInterval(() => {
|
|
266
|
-
this._trigger(1);
|
|
271
|
+
this._trigger(this.reverseSwipe ? -1 : 1);
|
|
267
272
|
}, this.autoplayInterval);
|
|
268
273
|
}
|
|
269
274
|
},
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* backgroundImage {String} 组件背景图
|
|
24
24
|
* backgroundColor {String} 组件背景颜色
|
|
25
25
|
* scale {float} 当前 item 的放大倍数, 默认为1
|
|
26
|
+
* reverseSwipe {boolean} 反转滚动方向,默认值为false. 默认滚动方向是正向, 既向index增大的方向, 反转后为反向, 既向index减小的方向
|
|
26
27
|
-->
|
|
27
28
|
|
|
28
29
|
<script>
|
|
@@ -120,6 +121,10 @@ export default {
|
|
|
120
121
|
backgroundColor: {
|
|
121
122
|
type: String,
|
|
122
123
|
},
|
|
124
|
+
reverseSwipe: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false,
|
|
127
|
+
}
|
|
123
128
|
},
|
|
124
129
|
computed: {
|
|
125
130
|
indicatorLayout() {
|
|
@@ -311,7 +316,7 @@ export default {
|
|
|
311
316
|
if (this.autoplayInterval > 0) {
|
|
312
317
|
this.intervalHandler = setInterval(() => {
|
|
313
318
|
this.preOffset = this.offset;
|
|
314
|
-
this.offset = this.offset + 1;
|
|
319
|
+
this.offset = this.offset + this.reverseSwipe ? -1 : 1;
|
|
315
320
|
}, this.autoplayInterval);
|
|
316
321
|
}
|
|
317
322
|
},
|