@shijiu/jsview-vue 1.9.650 → 1.9.719
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/package.json +7 -18
- package/samples/AnimPicture/App.vue +5 -5
- package/samples/Basic/components/div/DivLayout.vue +1 -1
- package/samples/Basic/components/text/TextOverflow.vue +10 -5
- package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/samples/Collision/App.vue +452 -0
- package/samples/DemoHomepage/components/BodyFrame.vue +2 -0
- package/samples/DemoHomepage/router.js +21 -1
- package/samples/DemoHomepage/views/Homepage.vue +3 -7
- package/samples/FilterDemo/App.vue +1 -1
- package/samples/FlipCard/App.vue +2 -2
- package/samples/FlipCard/FlipCard.vue +2 -2
- 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 +435 -0
- package/samples/Input/App.vue +8 -17
- package/samples/Input/InputPanel.vue +19 -12
- 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/App.vue +176 -40
- package/samples/Marquee/longText.js +14 -0
- package/samples/MetroWidgetDemos/Advanced/App.vue +5 -6
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +3 -3
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
- package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
- package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
- package/samples/MetroWidgetDemos/Advanced/{Widgets.vue → widgets/Widgets.vue} +56 -11
- package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/samples/MetroWidgetDemos/Item.vue +20 -2
- package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
- package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
- package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +1 -1
- package/samples/MetroWidgetDemos/PingPong/App.vue +3 -3
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +17 -2
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +3 -10
- package/samples/MetroWidgetDemos/PingPong/{Item.vue → TabItem.vue} +3 -11
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/App.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +6 -6
- package/samples/MetroWidgetDemos/WidgetItem.vue +2 -2
- package/samples/MetroWidgetDemos/data.js +2 -1
- package/samples/NinePatchDemo/App.vue +2 -2
- package/samples/NinePatchDemo/Item.vue +1 -1
- package/samples/Preload/App.vue +17 -12
- package/samples/Preload/Item.vue +1 -1
- package/samples/QrcodeDemo/App.vue +1 -1
- package/samples/ScaleDownNeon/App.vue +107 -0
- package/samples/SoundPool/App.vue +1 -1
- package/samples/TextBox/App.vue +9 -82
- package/samples/TextBox/RenderCenter.vue +40 -16
- package/samples/TextBox/RenderLeft.vue +48 -19
- package/samples/TextBox/RenderOneLine.vue +30 -49
- package/samples/TextBox/RenderRight.vue +40 -16
- package/samples/TextShadowDemo/App.vue +11 -17
- package/samples/TextureAnimation/App2.vue +43 -15
- package/samples/TextureAnimation/assets/light.png +0 -0
- package/samples/TextureAnimation/assets/light2.png +0 -0
- package/samples/TextureSize/App.vue +3 -3
- 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/VisibleSensorDemo/App.vue +94 -27
- package/tsconfig.json +6 -6
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +55 -59
- package/utils/JsViewEngineWidget/JsvFocusManager.js +1 -1
- package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +226 -107
- package/utils/JsViewEngineWidget/TemplateParser.js +227 -178
- package/utils/JsViewEngineWidget/WidgetCommon.js +13 -5
- package/utils/JsViewEngineWidget/index.js +3 -2
- package/utils/JsViewPlugin/BrowserPluginLoader.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +95 -12
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +23 -2
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +1 -1
- package/utils/JsViewPlugin/JsvPlayer/index.js +22 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +4 -4
- package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
- package/utils/JsViewVueTools/JsvStyleClass.js +1 -1
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +1 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +7 -9
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +3 -3
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +5 -5
- package/utils/JsViewVueWidget/JsvFilterView.vue +1 -1
- package/utils/JsViewVueWidget/JsvGrid.vue +3 -11
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +5 -3
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +15 -14
- package/utils/JsViewVueWidget/JsvMarquee.vue +180 -207
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -2
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
- package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -2
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +38 -42
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +1 -1
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +24 -8
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +23 -3
- package/utils/JsViewVueWidget/JsvTextBox.vue +20 -86
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +2 -9
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +6 -7
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +6 -6
- package/utils/JsViewVueWidget/index.js +8 -8
- package/utils/JsViewVueWidget/utils/index.js +8 -0
- package/utils/JsViewVueWidget/utils/text.js +19 -0
- package/dom/bin/jsview-browser-debug-dom.min.js +0 -1
- package/dom/bin/jsview-dom.min.js +0 -1
- package/dom/bin/jsview-forge-define.min.js +0 -1
- package/dom/browser-root-style.css +0 -21
- package/dom/jsv-browser-debug-dom.js +0 -8
- package/dom/jsv-dom.js +0 -6
- package/dom/jsv-forge-define.js +0 -6
- package/dom/target_core_revision.mjs +0 -15
- package/loader/header_script_loader.js +0 -134
- package/loader/jsview-main.js +0 -42
- package/loader/jsview.config.default.js +0 -37
- package/loader/jsview.default.config.js +0 -37
- package/loader/loader.js +0 -179
- package/loader/loader_webkit.js +0 -40
- package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -17609
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +0 -335
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +0 -446
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-types.js +0 -91
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8038
- package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1700
- package/patches/node_modules/postcss-js/objectifier.js +0 -90
- package/patches/node_modules/vite/dist/node/chunks/dep-0fc8e132.js +0 -63147
- package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -53
- package/patches/node_modules/vue-router/dist/vue-router.mjs +0 -3595
- package/scripts/common.js +0 -58
- package/scripts/jsview-install-local-packages.js +0 -73
- package/scripts/jsview-jsmap-serve.js +0 -105
- package/scripts/jsview-post-build.js +0 -183
- package/scripts/jsview-post-install.js +0 -102
- package/scripts/jsview-run-android.js +0 -67
- package/utils/JsViewEngineWidget/MetroPage.js +0 -2128
- package/utils/JsViewEngineWidget/SimpleWidget/ContentView.vue +0 -51
- package/utils/JsViewEngineWidget/SimpleWidget/Dispatcher.js +0 -19
- package/utils/JsViewEngineWidget/SimpleWidget/DivWrapper.vue +0 -53
- package/utils/JsViewEngineWidget/SimpleWidget/ItemView.vue +0 -142
- package/utils/JsViewEngineWidget/SimpleWidget/RootView.vue +0 -140
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +0 -1629
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-22 13:47:23
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-02-11 17:55:55
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
import ItemView from "./ItemView.vue";
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
props: {
|
|
13
|
-
token: Number,
|
|
14
|
-
onItemEdge: Function,
|
|
15
|
-
data: Object,
|
|
16
|
-
loadAll: Boolean,
|
|
17
|
-
enableTouch: Boolean,
|
|
18
|
-
onLoad: Function,
|
|
19
|
-
widgetHandler: Object,
|
|
20
|
-
enableItemRenderBreak: Boolean,
|
|
21
|
-
},
|
|
22
|
-
components: {
|
|
23
|
-
ItemView,
|
|
24
|
-
},
|
|
25
|
-
mounted() {
|
|
26
|
-
this.onLoad();
|
|
27
|
-
},
|
|
28
|
-
updated() {
|
|
29
|
-
this.onLoad();
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<item-view
|
|
36
|
-
v-for="(item, index) in data"
|
|
37
|
-
:key="item.id"
|
|
38
|
-
:index="index"
|
|
39
|
-
:data="item.data"
|
|
40
|
-
:loadAll="loadAll"
|
|
41
|
-
:enableTouch="enableTouch"
|
|
42
|
-
:onEdge="onItemEdge"
|
|
43
|
-
:controlObj="item.controller"
|
|
44
|
-
:widgetHandler="widgetHandler"
|
|
45
|
-
:allowRenderBreak="enableItemRenderBreak"
|
|
46
|
-
>
|
|
47
|
-
<template v-slot:renderItem="slotProps">
|
|
48
|
-
<slot name="renderItem" v-bind="slotProps"></slot>
|
|
49
|
-
</template>
|
|
50
|
-
</item-view>
|
|
51
|
-
</template>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-22 16:50:09
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-01-26 10:17:47
|
|
6
|
-
* @Description: file content
|
|
7
|
-
*/
|
|
8
|
-
import { BaseDispatcher } from "../WidgetCommon";
|
|
9
|
-
|
|
10
|
-
class Dispatcher extends BaseDispatcher {}
|
|
11
|
-
Dispatcher.Type = {
|
|
12
|
-
setFocusId: Symbol("setFocusId"),
|
|
13
|
-
updateItem: Symbol("updateItem"),
|
|
14
|
-
slideToItem: Symbol("slideTo"),
|
|
15
|
-
setEnterFocusId: Symbol("setEnterFocusId"),
|
|
16
|
-
setEnterFocusRect: Symbol("setEnterFocusRect"),
|
|
17
|
-
};
|
|
18
|
-
export { Dispatcher as SWidgetDispatcher };
|
|
19
|
-
export default Dispatcher;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-01-14 18:18:00
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-01-26 17:35:26
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
export default {
|
|
10
|
-
props: [
|
|
11
|
-
"data",
|
|
12
|
-
"controlObj",
|
|
13
|
-
"onEdge",
|
|
14
|
-
"onAction",
|
|
15
|
-
"queryObj",
|
|
16
|
-
"widgetHandler",
|
|
17
|
-
"index",
|
|
18
|
-
"onFocus",
|
|
19
|
-
],
|
|
20
|
-
mounted() {
|
|
21
|
-
this.widgetHandler.updateMounted(this.index, true);
|
|
22
|
-
const curFocus = this.widgetHandler.getCurrentFocusId();
|
|
23
|
-
if (this.widgetHandler.isFocus() && curFocus.index === this.index) {
|
|
24
|
-
//unmount 后导致的onFocus 在 mount 前,onFocus 为生效的问题
|
|
25
|
-
this.onFocus();
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
beforeUnmount() {
|
|
29
|
-
this.widgetHandler.updateMounted(this.index, false);
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<div
|
|
36
|
-
ref="element"
|
|
37
|
-
:style="{
|
|
38
|
-
left: data.xPos,
|
|
39
|
-
top: data.yPos,
|
|
40
|
-
width: data.width,
|
|
41
|
-
height: data.height,
|
|
42
|
-
zIndex: controlObj.zIndex,
|
|
43
|
-
}"
|
|
44
|
-
>
|
|
45
|
-
<slot
|
|
46
|
-
name="renderItem"
|
|
47
|
-
:data="data.data"
|
|
48
|
-
:onEdge="onEdge"
|
|
49
|
-
:onAction="onAction"
|
|
50
|
-
:query="queryObj"
|
|
51
|
-
></slot>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-18 14:34:20
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-02-11 13:43:39
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
import Forge from "../ForgeDefine";
|
|
10
|
-
import DivWrapper from "./DivWrapper.vue";
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
components: { DivWrapper },
|
|
14
|
-
props: {
|
|
15
|
-
data: Object,
|
|
16
|
-
loadAll: Boolean,
|
|
17
|
-
enableTouch: Boolean,
|
|
18
|
-
controlObj: Object,
|
|
19
|
-
onEdge: Function,
|
|
20
|
-
widgetHandler: Object,
|
|
21
|
-
index: Number,
|
|
22
|
-
},
|
|
23
|
-
setup() {
|
|
24
|
-
let onAction = {
|
|
25
|
-
register(name, func) {
|
|
26
|
-
this[name] = func;
|
|
27
|
-
},
|
|
28
|
-
unregister(name) {
|
|
29
|
-
delete this[name];
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
return {
|
|
33
|
-
onAction,
|
|
34
|
-
queryObj: null,
|
|
35
|
-
touchTested: false,
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
onFocus(preEdge) {
|
|
40
|
-
this.widgetHandler.onFocusChange(this.data.id);
|
|
41
|
-
if (this.onAction.onFocus) {
|
|
42
|
-
this.onAction.onFocus(preEdge);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
onBlur() {
|
|
46
|
-
if (this.onAction.onBlur) {
|
|
47
|
-
this.onAction.onBlur();
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
onClick() {
|
|
51
|
-
if (this.onAction.onClick) {
|
|
52
|
-
return this.onAction.onClick();
|
|
53
|
-
} else {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
reachEdge(edgeInfo) {
|
|
58
|
-
if (this.onAction.onWidgetEdge) {
|
|
59
|
-
this.onAction.onWidgetEdge(edgeInfo);
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
getDivElement() {
|
|
63
|
-
return this.$refs.element?.$refs?.element;
|
|
64
|
-
},
|
|
65
|
-
testTouchEnable() {
|
|
66
|
-
if (this.enableTouch) {
|
|
67
|
-
if (this.$refs.element?.$refs?.element /* DivWrapper的element ref */) {
|
|
68
|
-
if (!this.touchTested) {
|
|
69
|
-
// 为view添加触控处理
|
|
70
|
-
let view = this.$refs.element.$refs.element.jsvMaskView;
|
|
71
|
-
var dragSetting = new Forge.DragSetting(
|
|
72
|
-
Forge.DragSetting.DIRECTION_DISABLE,
|
|
73
|
-
20,
|
|
74
|
-
false,
|
|
75
|
-
new Forge.RectArea(0, 0, 0, 0),
|
|
76
|
-
-1,
|
|
77
|
-
3 / 4
|
|
78
|
-
);
|
|
79
|
-
let callback = {
|
|
80
|
-
OnTap: (msg) => {
|
|
81
|
-
console.log("Item View Container OnTap:", msg);
|
|
82
|
-
return this.onClick(this.data.id);
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
view.EnableDrag(dragSetting, callback, "translateMat(dx,dy,0)");
|
|
86
|
-
this.touchTested = true;
|
|
87
|
-
}
|
|
88
|
-
} else {
|
|
89
|
-
// 元素消失后要重新设置Touch处理
|
|
90
|
-
this.touchTested = false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
created() {
|
|
96
|
-
this.queryObj = {
|
|
97
|
-
id: this.data.id,
|
|
98
|
-
index: this.index,
|
|
99
|
-
position: this.widgetHandler.getPosition,
|
|
100
|
-
templatePosition: this.widgetHandler.getTemplatePosition,
|
|
101
|
-
absolutePosition: this.widgetHandler.getAbsolutePosition,
|
|
102
|
-
getCurrentFocusId: this.widgetHandler.getCurrentFocusId,
|
|
103
|
-
slideTo: this.widgetHandler.customerSlide,
|
|
104
|
-
};
|
|
105
|
-
this.widgetHandler.registerItemRef(this.index, this);
|
|
106
|
-
//export handlers
|
|
107
|
-
this.widgetHandler.registerItemFunc(this.index, {
|
|
108
|
-
onFocus: this.onFocus,
|
|
109
|
-
onBlur: this.onBlur,
|
|
110
|
-
onClick: this.onClick,
|
|
111
|
-
reachEdge: this.reachEdge,
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
mounted() {
|
|
115
|
-
this.testTouchEnable();
|
|
116
|
-
},
|
|
117
|
-
updated() {
|
|
118
|
-
this.testTouchEnable();
|
|
119
|
-
},
|
|
120
|
-
beforeUnmount() {},
|
|
121
|
-
};
|
|
122
|
-
</script>
|
|
123
|
-
|
|
124
|
-
<template>
|
|
125
|
-
<div-wrapper
|
|
126
|
-
v-if="loadAll || controlObj.visible"
|
|
127
|
-
:key="data.xPos + '_' + data.yPos"
|
|
128
|
-
ref="element"
|
|
129
|
-
:data="data"
|
|
130
|
-
:controlObj="controlObj"
|
|
131
|
-
:onEdge="onEdge"
|
|
132
|
-
:onAction="onAction"
|
|
133
|
-
:queryObj="queryObj"
|
|
134
|
-
:widgetHandler="widgetHandler"
|
|
135
|
-
:index="index"
|
|
136
|
-
:onFocus="onFocus"
|
|
137
|
-
>
|
|
138
|
-
<template v-slot:renderItem="slotProps">
|
|
139
|
-
<slot name="renderItem" v-bind="slotProps"></slot>
|
|
140
|
-
</template>
|
|
141
|
-
</div-wrapper>
|
|
142
|
-
</template>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-22 14:03:32
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-02-11 14:49:26
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
import ContentView from "./ContentView.vue";
|
|
10
|
-
import Forge from "../ForgeDefine";
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
props: {
|
|
14
|
-
token: Number,
|
|
15
|
-
data: Object,
|
|
16
|
-
onItemEdge: Function,
|
|
17
|
-
onLoad: Function,
|
|
18
|
-
register: Function,
|
|
19
|
-
widgetHandler: Object,
|
|
20
|
-
|
|
21
|
-
x: Number,
|
|
22
|
-
y: Number,
|
|
23
|
-
width: Number,
|
|
24
|
-
height: Number,
|
|
25
|
-
|
|
26
|
-
loadAll: Boolean,
|
|
27
|
-
enableTouch: Boolean,
|
|
28
|
-
touchListener: Object,
|
|
29
|
-
flingPageWidth: Number,
|
|
30
|
-
flingPageEdge: Number,
|
|
31
|
-
slidePile: Object,
|
|
32
|
-
direction: Number, //Forge.DragSetting的方向是数字类型
|
|
33
|
-
enableItemRenderBreak: Boolean,
|
|
34
|
-
},
|
|
35
|
-
components: {
|
|
36
|
-
ContentView,
|
|
37
|
-
},
|
|
38
|
-
data() {
|
|
39
|
-
return {
|
|
40
|
-
innerX: 0,
|
|
41
|
-
innerY: 0,
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
setup() {
|
|
45
|
-
let element = {};
|
|
46
|
-
return {
|
|
47
|
-
element,
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
$_rootView_initTouch_() {
|
|
52
|
-
if (this.touchListener && this.$refs.element) {
|
|
53
|
-
let view = this.$refs.element.jsvMaskView;
|
|
54
|
-
let page_width = this.flingPageWidth;
|
|
55
|
-
let page_edge = this.flingPageEdge;
|
|
56
|
-
let slide_pile = this.slidePile;
|
|
57
|
-
var drag_setting = new Forge.DragSetting(
|
|
58
|
-
this.direction,
|
|
59
|
-
20,
|
|
60
|
-
false,
|
|
61
|
-
slide_pile,
|
|
62
|
-
page_width,
|
|
63
|
-
page_edge
|
|
64
|
-
);
|
|
65
|
-
view.EnableDrag(
|
|
66
|
-
drag_setting,
|
|
67
|
-
this.touchListener,
|
|
68
|
-
"translateMat(dx,dy,0)"
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
updatePosition(x, y, anim_info) {
|
|
73
|
-
if (this.$refs.element) {
|
|
74
|
-
let pre_pos = this.$refs.element.jsvMaskView.GetLayoutParams();
|
|
75
|
-
//jsvMaskView的位置更新时会被设置位0,因此不能通过ResetLayoutParams设置位置
|
|
76
|
-
this.innerX = x;
|
|
77
|
-
this.innerY = y;
|
|
78
|
-
if (anim_info) {
|
|
79
|
-
let delta_x = Math.abs(pre_pos.MarginLeft - x);
|
|
80
|
-
let delta_y = Math.abs(pre_pos.MarginTop - y);
|
|
81
|
-
let duration = Math.round(
|
|
82
|
-
delta_x === 0
|
|
83
|
-
? delta_y / anim_info.speed
|
|
84
|
-
: delta_x / anim_info.speed
|
|
85
|
-
);
|
|
86
|
-
let slide_animation = new Forge.TranslateAnimation(
|
|
87
|
-
pre_pos.MarginLeft - x,
|
|
88
|
-
0,
|
|
89
|
-
pre_pos.MarginTop - y,
|
|
90
|
-
0,
|
|
91
|
-
duration,
|
|
92
|
-
anim_info.easing
|
|
93
|
-
);
|
|
94
|
-
slide_animation.SetAnimationListener(
|
|
95
|
-
new Forge.AnimationListener(
|
|
96
|
-
anim_info.onstart,
|
|
97
|
-
anim_info.onend,
|
|
98
|
-
null
|
|
99
|
-
)
|
|
100
|
-
);
|
|
101
|
-
this.$refs.element.jsvMaskView.StartAnimation(slide_animation);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
created() {
|
|
107
|
-
if (this.register) {
|
|
108
|
-
this.register(this);
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
mounted() {
|
|
112
|
-
this.$_rootView_initTouch_();
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
</script>
|
|
116
|
-
|
|
117
|
-
<template>
|
|
118
|
-
<div :style="{ left: x, top: y }">
|
|
119
|
-
<div
|
|
120
|
-
key="touchcontainer"
|
|
121
|
-
ref="element"
|
|
122
|
-
:style="{ left: innerX, top: innerY, width: width, height: height }"
|
|
123
|
-
>
|
|
124
|
-
<content-view
|
|
125
|
-
:token="token"
|
|
126
|
-
:data="data"
|
|
127
|
-
:onItemEdge="onItemEdge"
|
|
128
|
-
:loadAll="loadAll"
|
|
129
|
-
:enableTouch="enableTouch"
|
|
130
|
-
:onLoad="onLoad"
|
|
131
|
-
:widgetHandler="widgetHandler"
|
|
132
|
-
:enableItemRenderBreak="enableItemRenderBreak"
|
|
133
|
-
>
|
|
134
|
-
<template v-slot:renderItem="slotProps">
|
|
135
|
-
<slot name="renderItem" v-bind="slotProps"></slot>
|
|
136
|
-
</template>
|
|
137
|
-
</content-view>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
</template>
|