@shijiu/jsview-vue 0.9.502 → 0.9.631
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 +63 -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 +78 -59
- 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/Collision/App.vue +452 -0
- package/samples/ColorSpace/App.vue +15 -24
- package/samples/DemoHomepage/App.vue +7 -11
- package/samples/DemoHomepage/components/BodyFrame.vue +21 -9
- package/samples/DemoHomepage/components/TabFrame.vue +7 -8
- package/samples/DemoHomepage/router.js +52 -33
- package/samples/DemoHomepage/views/Homepage.vue +18 -9
- 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/ImpactStop/App.vue +435 -0
- package/samples/Input/App.vue +8 -18
- package/samples/Input/FullKeyboard.vue +2 -6
- package/samples/Input/InputPanel.vue +18 -12
- 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 +47 -0
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- 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/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 +73 -0
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +62 -0
- package/samples/MetroWidgetDemos/PingPong/TabItem.vue +84 -0
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
- package/samples/MetroWidgetDemos/Simple/App.vue +45 -0
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -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 +67 -64
- 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/TextureAnimation/App2.vue +111 -0
- package/samples/TextureAnimation/assets/blackWhiteGrid.png +0 -0
- package/samples/TextureAnimation/assets/light.png +0 -0
- package/samples/TextureAnimation/assets/light2.png +0 -0
- package/samples/TextureAnimation/assets/mask.png +0 -0
- 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 +234 -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 +1561 -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 +301 -58
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +22 -3
- package/utils/JsViewPlugin/JsvPlayer/index.js +8 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
- package/utils/JsViewVueTools/JsvRefTaker.js +35 -0
- package/utils/JsViewVueTools/index.js +20 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +8 -4
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +203 -14
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -2
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +2 -2
- package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
- package/utils/JsViewVueWidget/JsvGrid.vue +139 -41
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +4 -2
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +13 -12
- 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 +39 -53
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -10
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +282 -285
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -3
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +6 -1
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +6 -1
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +142 -61
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +9 -5
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +7 -8
- package/utils/JsViewVueWidget/JsvVideo.vue +9 -12
- 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
|
@@ -22,6 +22,10 @@ export default {
|
|
|
22
22
|
* 属性,int类型,底层使用的播放器类型。1:系统播放器;2:jsv播放器。默认2。
|
|
23
23
|
*/
|
|
24
24
|
playerType: {type: Number, default: 2},
|
|
25
|
+
/**
|
|
26
|
+
* 属性,int类型,播放器解码方式。0:根据硬件能力自动匹配;1:硬解码;2:软解码。默认0(根据芯片能力自动匹配)。
|
|
27
|
+
*/
|
|
28
|
+
decodeType: {type: Number, default: 0},
|
|
25
29
|
/**
|
|
26
30
|
* 属性,Boolean类型,层级关系,true表示在界面的下面,false表示在界面上面,默认true。
|
|
27
31
|
*/
|
|
@@ -45,11 +49,21 @@ export default {
|
|
|
45
49
|
/**
|
|
46
50
|
* 属性,Boolean类型,是否保留最后一帧,true保留,false不保留。
|
|
47
51
|
*/
|
|
48
|
-
keepLastFrame: {type: Boolean, default:
|
|
52
|
+
keepLastFrame: {type: Boolean, default: true},
|
|
49
53
|
/**
|
|
50
54
|
* 属性,String类型,视频显示比例,origin原始比例显示,full全屏显示,x:y按照指定比例显示。
|
|
51
55
|
*/
|
|
52
56
|
videoAspectRatio: {type: String, default: "origin"},
|
|
57
|
+
/**
|
|
58
|
+
* 属性,JSON Object类型,色度抠像参数,包含color,colorDistance,edgeDistance,greenOffset四个参数,
|
|
59
|
+
* 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
|
|
60
|
+
* color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
|
|
61
|
+
* colorDistance,float类型,色域范围,范围0-1.0。
|
|
62
|
+
* edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
|
|
63
|
+
* greenOffset,float类型,红蓝差值,范围0-1.0。
|
|
64
|
+
* 目前只支持扣绿。
|
|
65
|
+
*/
|
|
66
|
+
chromaKey: {type: Object, default: null},
|
|
53
67
|
/**
|
|
54
68
|
* 回调函数,播放结束时通过此回调接口通知。
|
|
55
69
|
*/
|
|
@@ -222,7 +236,7 @@ export default {
|
|
|
222
236
|
let first_create = true;
|
|
223
237
|
|
|
224
238
|
if(!this.video){
|
|
225
|
-
this.video = new JsvMediaVideo(this.holeId, player_type, key, background, designMap.width);
|
|
239
|
+
this.video = new JsvMediaVideo(this.holeId, player_type, key, background, designMap.width, this.decodeType);
|
|
226
240
|
}else{
|
|
227
241
|
this.video.setRef();
|
|
228
242
|
first_create = false;
|
|
@@ -251,13 +265,17 @@ export default {
|
|
|
251
265
|
this.video.loop = this.loop;
|
|
252
266
|
}
|
|
253
267
|
|
|
254
|
-
if(this.keepLastFrame){
|
|
268
|
+
if(!this.keepLastFrame){
|
|
255
269
|
this.video.keepLastFrame = this.keepLastFrame;
|
|
256
270
|
}
|
|
257
271
|
|
|
258
272
|
if(this.videoAspectRatio !== "origin"){
|
|
259
273
|
this.video.videoAspectRatio = this.videoAspectRatio;
|
|
260
274
|
}
|
|
275
|
+
|
|
276
|
+
if(this.chromaKey && this.chromaKey !== ""){
|
|
277
|
+
this.video.setChromaKey(this.chromaKey)
|
|
278
|
+
}
|
|
261
279
|
//}else{
|
|
262
280
|
if(!first_create){
|
|
263
281
|
this.video.setHoleID(this.holeId);
|
|
@@ -275,6 +293,7 @@ export default {
|
|
|
275
293
|
unmounted(){
|
|
276
294
|
if(this.video != null){
|
|
277
295
|
this.video.releasePlayer();
|
|
296
|
+
|
|
278
297
|
this.onRef?.(null)
|
|
279
298
|
}
|
|
280
299
|
},
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
import * as JsvPlayer from "./JsvPlayer.vue";
|
|
3
3
|
import { globalLoadJsvPlayerPlugin as initPlugin } from "./JsvMedia.js"
|
|
4
4
|
import { getJsvPlayerCapabilitySet as getCapabilitySet } from "./JsvMedia.js"
|
|
5
|
+
import { setJsvPlayerDebugMode as setDebugMode } from "./JsvMedia.js"
|
|
5
6
|
let _JsvPlayer = JsvPlayer;
|
|
6
7
|
|
|
7
8
|
let globalLoadJsvPlayerPlugin = initPlugin;
|
|
8
9
|
let getJsvPlayerCapabilitySet = getCapabilitySet;
|
|
10
|
+
let setJsvPlayerDebugMode = setDebugMode;
|
|
11
|
+
|
|
9
12
|
if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
|
|
10
13
|
// 浏览器版本
|
|
11
14
|
_JsvPlayer = window.JsvWidgetWrapperGroup.BrowserJsvPlayer;
|
|
@@ -19,6 +22,10 @@ if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
|
|
|
19
22
|
getJsvPlayerCapabilitySet = () => {
|
|
20
23
|
return null;
|
|
21
24
|
}
|
|
25
|
+
|
|
26
|
+
setJsvPlayerDebugMode = () => {
|
|
27
|
+
console.log("Set debug mode");
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
let component = _JsvPlayer.default;
|
|
@@ -27,5 +34,5 @@ export default component;
|
|
|
27
34
|
export {
|
|
28
35
|
globalLoadJsvPlayerPlugin, // 全局初始化播放器插件处理
|
|
29
36
|
getJsvPlayerCapabilitySet, //获取设备能力集
|
|
30
|
-
|
|
37
|
+
setJsvPlayerDebugMode, //设置调试模式,可以查看帧率等信息
|
|
31
38
|
}
|
|
@@ -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
|
-
versionCodeMin:
|
|
7
|
-
versionCodeMax:
|
|
5
|
+
version:"1.6.7", //插件需要的版本号
|
|
6
|
+
versionCodeMin:167,
|
|
7
|
+
versionCodeMax:167,
|
|
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:"19b065b6d4d2acdbaf6093c4864fea22"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// 不要用export default,update-env脚本不能解析
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-08-30 10:54:42
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-08-30 10:54:44
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Created by donglin.lu@qcast.cn on 4/30/2020.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* 【模块 export 内容】
|
|
14
|
+
* createImpactTracer: 函数,创建碰撞跟踪对象
|
|
15
|
+
* createImpactCallback: 函数,创建碰撞发生后的回调函数
|
|
16
|
+
* createImpactAutoFroze: 函数,注册碰撞发生后,控制动画立刻停止的管理对象
|
|
17
|
+
* updateImpactAutoFroze: 函数,更新 createImpactAutoFroze 创建的碰撞即停管理对象中管理的运动元素列表
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { Forge } from "../../dom/jsv-forge-define";
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* createImpactCallback 参数说明:
|
|
24
|
+
* on_contact (function[]) 接受碰撞事件的回调
|
|
25
|
+
* on_dis_contact (function[]) 接受物体分离事件的回调
|
|
26
|
+
* 返回值:
|
|
27
|
+
* Object 句柄,用于传输给 createImpactTracer
|
|
28
|
+
*/
|
|
29
|
+
function createImpactCallback(on_contact, on_dis_contact) {
|
|
30
|
+
return new Forge.sImpactSensorManager.Callback(on_contact, on_dis_contact);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* createImpactTracer 参数说明:
|
|
35
|
+
* ele1 (Element) html element句柄,1号碰撞体
|
|
36
|
+
* ele2 (Element) html element句柄,2号碰撞体
|
|
37
|
+
* callback (Object) 由 createImpactCallback 创建的回调构造体句柄
|
|
38
|
+
* auto_froze (Object) 由 createImpactAutoFroze 创建的碰撞即停构造体句柄
|
|
39
|
+
* 返回值:
|
|
40
|
+
* Object 句柄,提供 Recycle() 函数用于停止碰撞检测,需要再componentWillUnmount进行调用(清理)
|
|
41
|
+
*/
|
|
42
|
+
function createImpactTracer(ele1, ele2, callback, auto_froze) {
|
|
43
|
+
return Forge.sImpactSensorManager.StartTrace(ele1.jsvMainView, ele2.jsvMainView, callback, auto_froze);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 创建用于设置碰撞即停管理对象的参数
|
|
47
|
+
// 结果用于函数 createImpactAutoFroze 和 updateImpactAutoFroze
|
|
48
|
+
function _ConvertToViewsList(elements_array) {
|
|
49
|
+
const views_array = [];
|
|
50
|
+
if (elements_array) {
|
|
51
|
+
for (const ele of elements_array) {
|
|
52
|
+
views_array.push(ele.jsvMainView);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return views_array;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* createImpactAutoFroze 参数说明:
|
|
60
|
+
* element_auto_froze_pre_impact (Array<Element>) 关联运动元素的列表,这些元素碰撞前一帧停止运动
|
|
61
|
+
* element_auto_froze_on_impact (Array<Element>) 关联运动元素的列表,这些元素碰撞当前帧停止运动
|
|
62
|
+
* 返回值:
|
|
63
|
+
* Object 句柄,用于传输给 createImpactTracer,也用于 updateImpactAutoFroze 调整关联元素
|
|
64
|
+
*
|
|
65
|
+
* 【注意点】
|
|
66
|
+
* 多个碰撞对可以共享同一个碰撞管理对象,并且建议共享同一个对象以提升效率
|
|
67
|
+
* 该管理对象中的view的列表可以通过 updateImpactAutoFrozeHandler进行更新,
|
|
68
|
+
* 更新后立刻在对所有的共享此管理对象的碰撞对中生效
|
|
69
|
+
*/
|
|
70
|
+
function createImpactAutoFroze(element_auto_froze_pre_impact, element_auto_froze_on_impact) {
|
|
71
|
+
if (!element_auto_froze_pre_impact && !element_auto_froze_on_impact) {
|
|
72
|
+
// Nothing to set
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const pre_impact_list = _ConvertToViewsList(element_auto_froze_pre_impact);
|
|
77
|
+
const on_impact_list = _ConvertToViewsList(element_auto_froze_on_impact);
|
|
78
|
+
|
|
79
|
+
return new Forge.sImpactSensorManager.AutoFroze(
|
|
80
|
+
(pre_impact_list.length > 0 ? pre_impact_list : null),
|
|
81
|
+
(on_impact_list.length > 0 ? on_impact_list : null));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* updateImpactAutoFroze 参数说明:
|
|
86
|
+
* handler (Object) 由 createImpactAutoFroze 创建的句柄
|
|
87
|
+
* element_auto_froze_pre_impact (Array<Element>) 关联运动元素的列表,这些元素碰撞前一帧停止运动
|
|
88
|
+
* element_auto_froze_on_impact (Array<Element>) 关联运动元素的列表,这些元素碰撞当前帧停止运动
|
|
89
|
+
* 返回值:
|
|
90
|
+
* 无
|
|
91
|
+
*/
|
|
92
|
+
function updateImpactAutoFroze(handler, element_auto_froze_pre_impact, element_auto_froze_on_impact) {
|
|
93
|
+
if (handler instanceof Forge.sImpactSensorManager.AutoFroze) {
|
|
94
|
+
console.error("Error: handler type error");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const pre_impact_list = _ConvertToViewsList(element_auto_froze_pre_impact);
|
|
99
|
+
const on_impact_list = _ConvertToViewsList(element_auto_froze_on_impact);
|
|
100
|
+
|
|
101
|
+
// 更新碰撞即停列表
|
|
102
|
+
handler.UpdatePreImpactList((pre_impact_list.length > 0 ? pre_impact_list : null));
|
|
103
|
+
|
|
104
|
+
// 更新接触接触即停列表
|
|
105
|
+
handler.UpdateOnImpactList((on_impact_list.length ? on_impact_list : null));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
createImpactCallback,
|
|
110
|
+
createImpactTracer,
|
|
111
|
+
createImpactAutoFroze,
|
|
112
|
+
updateImpactAutoFroze,
|
|
113
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
/********************
|
|
3
|
+
* JsvRefTaker模块
|
|
4
|
+
*
|
|
5
|
+
* 用于解决 script setup 写法,不容易通过 this.$ref.xxxx 拿到子模块的句柄,
|
|
6
|
+
* 但使用ref(null)的方式构筑的深度reactive对象又会严重影响element的内部处理性能的问题
|
|
7
|
+
*
|
|
8
|
+
* 使用方法:
|
|
9
|
+
* <script setup>
|
|
10
|
+
* const element_ref = buildTaker();
|
|
11
|
+
*
|
|
12
|
+
* onMounted(()=>{
|
|
13
|
+
* // onMounted以后,可以用 .current 访问到引用
|
|
14
|
+
* console.log(element.current)
|
|
15
|
+
* })
|
|
16
|
+
* </script>
|
|
17
|
+
*
|
|
18
|
+
* <template>
|
|
19
|
+
* <div :ref="element_ref.fnc" />
|
|
20
|
+
* </template>
|
|
21
|
+
*
|
|
22
|
+
********************/
|
|
23
|
+
|
|
24
|
+
function buildTaker() {
|
|
25
|
+
let pack = {
|
|
26
|
+
fnc: null,
|
|
27
|
+
current: null
|
|
28
|
+
}
|
|
29
|
+
pack.fnc = (r)=>{
|
|
30
|
+
pack.current = r;
|
|
31
|
+
}
|
|
32
|
+
return pack;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default buildTaker;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-07-05 14:09:55
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-08-30 10:58:14
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from "./JsvHashHistory";
|
|
10
|
+
export * from "./JsvDynamicCssStyle.js";
|
|
11
|
+
export * from "./JsvDynamicKeyFrames.js";
|
|
12
|
+
export * from "./JsvRuntimeBridge.js";
|
|
13
|
+
export * from "./NinePatchHelper";
|
|
14
|
+
export * from "./TypeCheckAndSet";
|
|
15
|
+
export * from "./JsvRefTaker.js";
|
|
16
|
+
export * from "./JsvStyleClass.js";
|
|
17
|
+
export * from "./DebugContentShellJBridge.js";
|
|
18
|
+
export * from "./DebugTool.js";
|
|
19
|
+
export * from "./JsvImpactTracer.js";
|
|
20
|
+
export { default as DefaultKeyCodeMap } from "./DefaultKeyMap.js";
|
|
@@ -10,6 +10,8 @@ export default {
|
|
|
10
10
|
setup() {
|
|
11
11
|
return {
|
|
12
12
|
preloadResultMap: {},
|
|
13
|
+
downloadResultMap: {},
|
|
14
|
+
downloadUrlList: [],
|
|
13
15
|
unmountStatus: {unmount:false}
|
|
14
16
|
};
|
|
15
17
|
},
|
|
@@ -70,16 +72,19 @@ export default {
|
|
|
70
72
|
},
|
|
71
73
|
getDownloadList() {
|
|
72
74
|
this.downloadStateList = new Array(this.downloadList.length).fill(false);
|
|
75
|
+
this.downloadUrlList = new Array(this.downloadStateList.length);
|
|
73
76
|
let downloadListData = this.downloadList;
|
|
74
77
|
for (let i = 0; i < downloadListData.length; i++) {
|
|
75
78
|
if (!downloadListData[i].url) {
|
|
76
79
|
this.downloadStateList[i] = true;
|
|
80
|
+
this.downloadUrlList[i] = "invalid";
|
|
77
81
|
// downloadListData.splice(i, 1);
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
this._DownloadViewList = downloadListData.map((item, index) => {
|
|
81
85
|
if (!item.url) {
|
|
82
86
|
this.downloadStateList[index] = true;
|
|
87
|
+
this.downloadUrlList[index] = "invalid";
|
|
83
88
|
return null;
|
|
84
89
|
}
|
|
85
90
|
const image = new Image();
|
|
@@ -91,6 +96,11 @@ export default {
|
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
this.downloadStateList[index] = true;
|
|
99
|
+
this.downloadUrlList[index] = item.url;
|
|
100
|
+
this.downloadResultMap[item.url] = {
|
|
101
|
+
width: image.width,
|
|
102
|
+
height: image.height
|
|
103
|
+
}
|
|
94
104
|
console.log(`pre download succeed ${item.url}`);
|
|
95
105
|
if (this.onDownloadDone) {
|
|
96
106
|
let downloadNum = 0;
|
|
@@ -98,7 +108,7 @@ export default {
|
|
|
98
108
|
downloadNum += item ? 1 : 0;
|
|
99
109
|
});
|
|
100
110
|
if (downloadNum == this.downloadStateList.length) {
|
|
101
|
-
this.onDownloadDone?.();
|
|
111
|
+
this.onDownloadDone?.(this.downloadUrlList, this.downloadResultMap);
|
|
102
112
|
}
|
|
103
113
|
}
|
|
104
114
|
};
|
|
@@ -18,11 +18,15 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
imageSettings: Object
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
setup() {
|
|
22
22
|
return {
|
|
23
23
|
imageStyle: null,
|
|
24
|
+
qrcodeRes: null,
|
|
24
25
|
}
|
|
25
26
|
},
|
|
27
|
+
created() {
|
|
28
|
+
this.qrcodeRes = this.renderQrcode();
|
|
29
|
+
},
|
|
26
30
|
methods: {
|
|
27
31
|
convertStr(str) {
|
|
28
32
|
let out = "";
|
|
@@ -149,10 +153,10 @@ export default {
|
|
|
149
153
|
:shapeRendering="'crispEdges'"
|
|
150
154
|
:height="size"
|
|
151
155
|
:width="size"
|
|
152
|
-
:viewBox="'0 0 ' +
|
|
156
|
+
:viewBox="'0 0 ' + qrcodeRes.numCells + ' ' + qrcodeRes.numCells"
|
|
153
157
|
>
|
|
154
|
-
<jsve-path :fill="bgColor" :d="'M0,0 h' +
|
|
155
|
-
<jsve-path :fill="fgColor" :d="
|
|
158
|
+
<jsve-path :fill="bgColor" :d="'M0,0 h' + qrcodeRes.numCells + 'v' + qrcodeRes.numCells + 'H0z'" />
|
|
159
|
+
<jsve-path :fill="fgColor" :d="qrcodeRes.fgPath" />
|
|
156
160
|
</jsve-svg>
|
|
157
161
|
<div :style="imageStyle"></div>
|
|
158
162
|
</div>
|
|
@@ -2,19 +2,81 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-02-08 09:29:17
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-08-22 16:00:50
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
+
import { ref } from "vue";
|
|
9
10
|
import { getKeyFramesGroup } from "jsview/utils/JsViewVueTools/JsvDynamicKeyFrames";
|
|
10
11
|
|
|
12
|
+
const DECORATE_BORDER_RADIUS = "BroderRaidus";
|
|
13
|
+
const DECORATE_NINEPATCH_ALPHA_MIX = "NinePatchAlphaMix";
|
|
14
|
+
|
|
15
|
+
const TexAlignAnchor = {
|
|
16
|
+
LEFT_TOP: 1,
|
|
17
|
+
CENTER_TOP: 2,
|
|
18
|
+
RIGHT_TOP: 3,
|
|
19
|
+
LEFT_MIDDLE: 4,
|
|
20
|
+
CENTER: 5,
|
|
21
|
+
RIGHT_MIDDLE: 6,
|
|
22
|
+
LEFT_BOTTOM: 7,
|
|
23
|
+
CENTER_BOTTOM: 8,
|
|
24
|
+
RIGHT_BOTTOM: 9,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const getOffset = (type, viewW, viewH, texLeft, texTop) => {
|
|
28
|
+
let extraLeft, extraTop;
|
|
29
|
+
switch (type) {
|
|
30
|
+
case TexAlignAnchor.LEFT_TOP:
|
|
31
|
+
extraLeft = 0;
|
|
32
|
+
extraTop = 0;
|
|
33
|
+
break;
|
|
34
|
+
case TexAlignAnchor.CENTER_TOP:
|
|
35
|
+
extraLeft = viewW / 2;
|
|
36
|
+
extraTop = 0;
|
|
37
|
+
break;
|
|
38
|
+
case TexAlignAnchor.RIGHT_TOP:
|
|
39
|
+
extraLeft = viewW;
|
|
40
|
+
extraTop = 0;
|
|
41
|
+
break;
|
|
42
|
+
case TexAlignAnchor.LEFT_MIDDLE:
|
|
43
|
+
extraLeft = 0;
|
|
44
|
+
extraTop = viewH / 2;
|
|
45
|
+
break;
|
|
46
|
+
case TexAlignAnchor.RIGHT_MIDDLE:
|
|
47
|
+
extraLeft = viewW;
|
|
48
|
+
extraTop = viewH / 2;
|
|
49
|
+
break;
|
|
50
|
+
case TexAlignAnchor.LEFT_BOTTOM:
|
|
51
|
+
extraLeft = 0;
|
|
52
|
+
extraTop = viewH;
|
|
53
|
+
break;
|
|
54
|
+
case TexAlignAnchor.CENTER_BOTTOM:
|
|
55
|
+
extraLeft = viewW / 2;
|
|
56
|
+
extraTop = viewH;
|
|
57
|
+
break;
|
|
58
|
+
case TexAlignAnchor.RIGHT_BOTTOM:
|
|
59
|
+
extraLeft = viewW;
|
|
60
|
+
extraTop = viewH;
|
|
61
|
+
break;
|
|
62
|
+
case TexAlignAnchor.CENTER:
|
|
63
|
+
default:
|
|
64
|
+
extraLeft = viewW / 2;
|
|
65
|
+
extraTop = viewH / 2;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
return [texLeft + extraLeft, texTop + extraTop];
|
|
69
|
+
};
|
|
11
70
|
let TOKEN = 0;
|
|
12
71
|
export default {
|
|
13
72
|
props: {
|
|
14
73
|
src: String,
|
|
74
|
+
top: Number,
|
|
75
|
+
left: Number,
|
|
15
76
|
width: Number,
|
|
16
77
|
height: Number,
|
|
17
78
|
borderRadius: String,
|
|
79
|
+
decorate: Object,
|
|
18
80
|
animation: String,
|
|
19
81
|
duration: Number,
|
|
20
82
|
transform: String,
|
|
@@ -36,13 +98,17 @@ export default {
|
|
|
36
98
|
type: Boolean,
|
|
37
99
|
default: false,
|
|
38
100
|
},
|
|
101
|
+
texCoord: {
|
|
102
|
+
type: Object,
|
|
103
|
+
},
|
|
39
104
|
},
|
|
40
|
-
setup() {
|
|
105
|
+
setup(props) {
|
|
41
106
|
let styleShell = getKeyFramesGroup();
|
|
42
107
|
return {
|
|
43
108
|
styleShell,
|
|
44
109
|
animName: "browser-texture-anim-" + TOKEN++,
|
|
45
110
|
animDiv: null,
|
|
111
|
+
watcherHandlerList: [],
|
|
46
112
|
};
|
|
47
113
|
},
|
|
48
114
|
computed: {
|
|
@@ -51,6 +117,104 @@ export default {
|
|
|
51
117
|
this.delay / 1000
|
|
52
118
|
}s ${this.repeat === -1 ? "infinite" : this.repeat}`;
|
|
53
119
|
},
|
|
120
|
+
textureLayout() {
|
|
121
|
+
if (!isNaN(this.texCoord?.width) && !isNaN(this.texCoord?.height)) {
|
|
122
|
+
const texLeft = !isNaN(this.texCoord.left)
|
|
123
|
+
? this.texCoord.left
|
|
124
|
+
: -this.texCoord.width / 2;
|
|
125
|
+
const texTop = !isNaN(this.texCoord.top)
|
|
126
|
+
? this.texCoord.top
|
|
127
|
+
: -this.texCoord.height / 2;
|
|
128
|
+
const type = !isNaN(this.texCoord.alignAnchor)
|
|
129
|
+
? this.texCoord.alignAnchor
|
|
130
|
+
: 5;
|
|
131
|
+
const offset = getOffset(
|
|
132
|
+
type,
|
|
133
|
+
this.width,
|
|
134
|
+
this.height,
|
|
135
|
+
texLeft,
|
|
136
|
+
texTop
|
|
137
|
+
);
|
|
138
|
+
const transition = this.decorate?.animTime
|
|
139
|
+
? `left ${this.decorate.animTime}s, top ${this.decorate.animTime}s`
|
|
140
|
+
: "";
|
|
141
|
+
return {
|
|
142
|
+
position: "absolute",
|
|
143
|
+
left: offset[0] + "px",
|
|
144
|
+
top: offset[1] + "px",
|
|
145
|
+
transition,
|
|
146
|
+
width: this.texCoord.width + "px",
|
|
147
|
+
height: this.texCoord.height + "px",
|
|
148
|
+
};
|
|
149
|
+
} else {
|
|
150
|
+
return {
|
|
151
|
+
position: "absolute",
|
|
152
|
+
left: 0 + "px",
|
|
153
|
+
top: 0 + "px",
|
|
154
|
+
width: this.width + "px",
|
|
155
|
+
height: this.height + "px",
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
maskStyle() {
|
|
160
|
+
if (this.borderRadius) {
|
|
161
|
+
return {
|
|
162
|
+
left: this.left + "px",
|
|
163
|
+
top: this.top + "px",
|
|
164
|
+
borderRadius: this.borderRadius,
|
|
165
|
+
width: this.width + "px",
|
|
166
|
+
height: this.height + "px",
|
|
167
|
+
overflow: 'hidden',
|
|
168
|
+
};
|
|
169
|
+
} else if (this.decorate) {
|
|
170
|
+
if (this.decorate.type == DECORATE_NINEPATCH_ALPHA_MIX) {
|
|
171
|
+
const imageDspWidth =
|
|
172
|
+
this.decorate.imageDspWidth > 0
|
|
173
|
+
? this.decorate.imageDspWidth
|
|
174
|
+
: this.decorate.imageWidth;
|
|
175
|
+
const slideWidth =
|
|
176
|
+
(this.decorate.imageWidth - this.decorate.centerWidth) / 2;
|
|
177
|
+
const outset = Math.ceil(
|
|
178
|
+
(this.decorate.borderOutset * imageDspWidth) /
|
|
179
|
+
this.decorate.imageWidth
|
|
180
|
+
);
|
|
181
|
+
console.log("get mask style");
|
|
182
|
+
const transitionTime = this.decorate.animTime;
|
|
183
|
+
return {
|
|
184
|
+
left: this.left + "px",
|
|
185
|
+
top: this.top + "px",
|
|
186
|
+
width: this.width + "px",
|
|
187
|
+
height: this.height + "px",
|
|
188
|
+
transition: `left ${transitionTime}s, top ${transitionTime}s, width ${transitionTime}s, height ${transitionTime}s`,
|
|
189
|
+
webkitMaskBoxImageSource: this.decorate.url,
|
|
190
|
+
webkitMaskBoxImageSlice: slideWidth,
|
|
191
|
+
webkitMaskBoxImageWidth:
|
|
192
|
+
Math.ceil(
|
|
193
|
+
(slideWidth * imageDspWidth) / this.decorate.imageWidth
|
|
194
|
+
) + "px",
|
|
195
|
+
webkitMaskBoxImageOutset: outset + "px",
|
|
196
|
+
position: "absolute",
|
|
197
|
+
};
|
|
198
|
+
} else if (this.decorate.type == DECORATE_BORDER_RADIUS) {
|
|
199
|
+
return {
|
|
200
|
+
left: this.left + "px",
|
|
201
|
+
top: this.top + "px",
|
|
202
|
+
borderRadius: `${this.decorate.topLeft}px ${this.decorate.topRight}px ${this.decorate.bottomRight}px ${this.decorate.bottomLeft}`,
|
|
203
|
+
width: this.width + "px",
|
|
204
|
+
height: this.height + "px",
|
|
205
|
+
overflow: 'hidden',
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
return {
|
|
210
|
+
left: this.left + "px",
|
|
211
|
+
top: this.top + "px",
|
|
212
|
+
width: this.width + "px",
|
|
213
|
+
height: this.height + "px",
|
|
214
|
+
overflow: 'hidden',
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
},
|
|
54
218
|
},
|
|
55
219
|
methods: {
|
|
56
220
|
start() {
|
|
@@ -65,28 +229,22 @@ export default {
|
|
|
65
229
|
"@keyframes " + this.animName + " " + this.animation
|
|
66
230
|
);
|
|
67
231
|
}
|
|
68
|
-
|
|
232
|
+
//绕过 jsview 对document 的 hook
|
|
69
233
|
const clipDiv = window.originDocument.createElement("div");
|
|
70
|
-
clipDiv.style
|
|
71
|
-
clipDiv.style.height = this.height + "px";
|
|
72
|
-
clipDiv.style.position = "absolute";
|
|
73
|
-
clipDiv.style.borderRadius = this.borderRadius;
|
|
74
|
-
clipDiv.style.overflow = "hidden";
|
|
234
|
+
Object.assign(clipDiv.style, this.maskStyle);
|
|
75
235
|
|
|
236
|
+
const textureLayout = this.textureLayout;
|
|
76
237
|
this.animDiv = window.originDocument.createElement("div");
|
|
77
|
-
this.animDiv.style
|
|
78
|
-
this.animDiv.style.height = this.height + "px";
|
|
79
|
-
this.animDiv.style.position = "absolute";
|
|
238
|
+
Object.assign(this.animDiv.style, textureLayout);
|
|
80
239
|
this.animDiv.onanimationend = () => {
|
|
81
240
|
this.animDiv.style.animation = null;
|
|
82
241
|
this.onAnimationEnd?.();
|
|
83
242
|
};
|
|
84
243
|
|
|
85
244
|
const imgDiv = window.originDocument.createElement("div");
|
|
86
|
-
imgDiv.style.width =
|
|
87
|
-
imgDiv.style.height =
|
|
245
|
+
imgDiv.style.width = textureLayout.width;
|
|
246
|
+
imgDiv.style.height = textureLayout.height;
|
|
88
247
|
imgDiv.style.backgroundImage = `url(${this.src})`;
|
|
89
|
-
// imgDiv.style.backgroundColor = "#FF0000"
|
|
90
248
|
imgDiv.style.transform = this.transform;
|
|
91
249
|
imgDiv.style.transformOrigin = this.transformOrigin;
|
|
92
250
|
|
|
@@ -94,6 +252,33 @@ export default {
|
|
|
94
252
|
clipDiv.appendChild(this.animDiv);
|
|
95
253
|
this.$refs.root.jsvMaskView.Element.appendChild(clipDiv);
|
|
96
254
|
|
|
255
|
+
this.watcherHandlerList.push(
|
|
256
|
+
this.$watch("left", (newValue) => {
|
|
257
|
+
clipDiv.style.left = newValue + "px";
|
|
258
|
+
})
|
|
259
|
+
);
|
|
260
|
+
this.watcherHandlerList.push(
|
|
261
|
+
this.$watch("top", (newValue) => {
|
|
262
|
+
clipDiv.style.top = newValue + "px";
|
|
263
|
+
})
|
|
264
|
+
);
|
|
265
|
+
this.watcherHandlerList.push(
|
|
266
|
+
this.$watch("width", (newValue) => {
|
|
267
|
+
clipDiv.style.width = newValue + "px";
|
|
268
|
+
})
|
|
269
|
+
);
|
|
270
|
+
this.watcherHandlerList.push(
|
|
271
|
+
this.$watch("height", (newValue) => {
|
|
272
|
+
clipDiv.style.height = newValue + "px";
|
|
273
|
+
})
|
|
274
|
+
);
|
|
275
|
+
this.watcherHandlerList.push(
|
|
276
|
+
this.$watch("textureLayout", (newValue) => {
|
|
277
|
+
Object.assign(this.animDiv.style, newValue);
|
|
278
|
+
imgDiv.style.width = newValue.width;
|
|
279
|
+
imgDiv.style.height = newValue.height;
|
|
280
|
+
})
|
|
281
|
+
);
|
|
97
282
|
if (this.autoStart) {
|
|
98
283
|
setTimeout(() => {
|
|
99
284
|
this.start();
|
|
@@ -102,6 +287,10 @@ export default {
|
|
|
102
287
|
},
|
|
103
288
|
beforeUnmount() {
|
|
104
289
|
this.styleShell.removeRule(this.animName);
|
|
290
|
+
for (let handler of this.watcherHandlerList) {
|
|
291
|
+
handler?.();
|
|
292
|
+
}
|
|
293
|
+
this.watcherHandlerList = [];
|
|
105
294
|
},
|
|
106
295
|
};
|
|
107
296
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-10-20 17:21:21
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2022-08-31 11:14:13
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
if (this.refDefine) {
|
|
49
49
|
const type = typeof this.refDefine;
|
|
50
50
|
if (type === "object") {
|
|
51
|
-
|
|
51
|
+
this.refDefine.current = this.$refs.element;
|
|
52
52
|
} else if (type === "function") {
|
|
53
53
|
this.refDefine(this.$refs.element);
|
|
54
54
|
}
|