@shijiu/jsview-vue 0.9.426 → 0.9.502
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/jsv-browser-debug-dom.js_1 +8 -0
- package/dom/jsv-dom.js_1 +6 -0
- package/dom/jsv-forge-define.js_1 +6 -0
- package/dom/target_core_revision.js +3 -3
- package/package.json +1 -1
- package/patches/node_modules/@vue/cli-service/lib/config/assets.js +1 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +4 -1
- package/samples/ColorSpace/App.vue +4 -4
- package/samples/DemoHomepage/router.js +17 -2
- package/samples/FilterDemo/App.vue +121 -0
- package/samples/GridDemo/App.vue +183 -0
- package/samples/GridDemo/ButtonBlock.vue +111 -0
- package/samples/GridDemo/FocusItem.vue +56 -0
- package/samples/GridDemo/Item.vue +101 -0
- package/samples/NinePatchDemo/App.vue +146 -0
- package/samples/NinePatchDemo/Item.vue +70 -0
- package/samples/NinePatchDemo/assets/border.png +0 -0
- package/samples/TouchSample/App.vue +137 -0
- package/samples/TouchSample/Item.vue +101 -0
- package/samples/TouchSample/MetroWidgetHorizontal.vue +144 -0
- package/samples/TouchSample/MetroWidgetVertical.vue +144 -0
- package/samples/TouchSample/TouchContainerHorizontal.vue +159 -0
- package/samples/TouchSample/TouchContainerVertical.vue +159 -0
- package/samples/TouchSample/data.js +81 -0
- package/samples/{ColorSpace → assets}/bmpDemo.bmp +0 -0
- package/samples/{ColorSpace → assets}/jpegDemo.jpeg +0 -0
- package/samples/{ColorSpace → assets}/pngDemo.png +0 -0
- package/samples/{ColorSpace → assets}/pngNoAlphaDemo.png +0 -0
- package/samples/assets/webpDemo.webp +0 -0
- package/scripts/jsview-jsmap-serve.js +63 -0
- package/scripts/jsview-post-build.js +50 -3
- package/scripts/jsview-post-install.js +22 -0
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +7 -5
- package/utils/JsViewEngineWidget/JsvFocusManager.js +5 -0
- package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +7 -14
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +214 -89
- package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +4 -3
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +2 -0
- package/utils/JsViewEngineWidget/TemplateParser.js +8 -6
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +20 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +220 -85
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +43 -14
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +25 -12
- package/utils/JsViewPlugin/JsvPlayer/index.js +4 -0
- package/utils/JsViewPlugin/JsvPlayer/version.js +19 -0
- package/utils/JsViewVueTools/DebugTool.js +24 -0
- package/utils/JsViewVueTools/NinePatchHelper.js +44 -0
- package/utils/JsViewVueTools/TypeCheckAndSet.js +27 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +19 -8
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +1 -1
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +2 -2
- package/utils/JsViewVueWidget/JsvFilterView.vue +73 -0
- package/utils/JsViewVueWidget/JsvGrid.vue +573 -0
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +7 -0
- package/utils/JsViewVueWidget/JsvNinePatch.vue +2 -2
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +12 -3
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +1 -1
- package/utils/JsViewVueWidget/JsvTextureAnim/CommonType.js +8 -0
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +171 -38
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +3 -2
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +184 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {JsvMediaVideo, findMediaObjectByKey} from './JsvMedia'
|
|
2
|
+
import {JsvMediaVideo, findMediaObjectByKey, logDebug} from './JsvMedia'
|
|
3
3
|
import JsvNativeSharedDiv from 'jsview/utils/JsViewVueWidget/JsvNativeSharedDiv.vue'
|
|
4
4
|
|
|
5
5
|
|
|
@@ -46,6 +46,10 @@ export default {
|
|
|
46
46
|
* 属性,Boolean类型,是否保留最后一帧,true保留,false不保留。
|
|
47
47
|
*/
|
|
48
48
|
keepLastFrame: {type: Boolean, default: false},
|
|
49
|
+
/**
|
|
50
|
+
* 属性,String类型,视频显示比例,origin原始比例显示,full全屏显示,x:y按照指定比例显示。
|
|
51
|
+
*/
|
|
52
|
+
videoAspectRatio: {type: String, default: "origin"},
|
|
49
53
|
/**
|
|
50
54
|
* 回调函数,播放结束时通过此回调接口通知。
|
|
51
55
|
*/
|
|
@@ -113,6 +117,22 @@ export default {
|
|
|
113
117
|
* 回调函数,音频获取焦点后触发此事件,可能会触发resume(点播)或者加入频道(直播)。
|
|
114
118
|
*/
|
|
115
119
|
onAudioFocusGain: {type: Function, default: ()=>{return{}}},
|
|
120
|
+
/**
|
|
121
|
+
* 回调函数,直播进入时移状态时,触发此事件。
|
|
122
|
+
*/
|
|
123
|
+
onTimeShift: {type: Function, default: ()=>{return{}}},
|
|
124
|
+
/**
|
|
125
|
+
* 回调函数,直播进入时移状态时,成功播放触发此事件。
|
|
126
|
+
*/
|
|
127
|
+
onTimeShifted: {type: Function, default: ()=>{return{}}},
|
|
128
|
+
/**
|
|
129
|
+
* 回调函数,时移回到直播状态,触发此事件。
|
|
130
|
+
*/
|
|
131
|
+
onBackLive: {type: Function, default: ()=>{return{}}},
|
|
132
|
+
/**
|
|
133
|
+
* 回调函数,时移回到直播状态时,成功播放触发此事件。
|
|
134
|
+
*/
|
|
135
|
+
onBackLived: {type: Function, default: ()=>{return{}}},
|
|
116
136
|
/**
|
|
117
137
|
* 属性,Object类型,设置窗口属性,同其他组件的style设置。
|
|
118
138
|
*/
|
|
@@ -128,7 +148,7 @@ export default {
|
|
|
128
148
|
},
|
|
129
149
|
watch: {
|
|
130
150
|
active(newValue) {
|
|
131
|
-
|
|
151
|
+
logDebug("active newValue: "+newValue);
|
|
132
152
|
if(this.video){
|
|
133
153
|
if(newValue){
|
|
134
154
|
this.registerEvent();
|
|
@@ -146,7 +166,7 @@ export default {
|
|
|
146
166
|
}
|
|
147
167
|
},
|
|
148
168
|
style(newValue){
|
|
149
|
-
|
|
169
|
+
logDebug("holeStyle newValue: left="+newValue.left+", top="+newValue.top+", width="+newValue.width+", height="+newValue.height);
|
|
150
170
|
if(this.active){
|
|
151
171
|
this.holeStyle = {
|
|
152
172
|
left: 0, top: 0,
|
|
@@ -155,7 +175,7 @@ export default {
|
|
|
155
175
|
}
|
|
156
176
|
},
|
|
157
177
|
keepLastFrame(newValue){
|
|
158
|
-
|
|
178
|
+
logDebug("keepLastFrame newValue: "+newValue);
|
|
159
179
|
if(this.video && this.active){
|
|
160
180
|
this.video.keepLastFrame = this.keepLastFrame;
|
|
161
181
|
}
|
|
@@ -177,13 +197,13 @@ export default {
|
|
|
177
197
|
created() {
|
|
178
198
|
},
|
|
179
199
|
mounted() {
|
|
180
|
-
|
|
200
|
+
logDebug("JsvPlayer:",this.style)
|
|
181
201
|
|
|
182
202
|
let key = "Jsv_" + Math.floor(Math.random() * 10000);
|
|
183
203
|
if(this.playerKey){
|
|
184
204
|
key = this.playerKey;
|
|
185
205
|
}
|
|
186
|
-
|
|
206
|
+
logDebug("player key:"+key)
|
|
187
207
|
|
|
188
208
|
let player_type = 1;
|
|
189
209
|
if(this.playerType)
|
|
@@ -193,10 +213,10 @@ export default {
|
|
|
193
213
|
if(!this.background)
|
|
194
214
|
background = this.background;
|
|
195
215
|
|
|
196
|
-
|
|
216
|
+
logDebug("JsvPlayer background:"+background)
|
|
197
217
|
|
|
198
218
|
const designMap = window.Forge.DesignMap();
|
|
199
|
-
|
|
219
|
+
logDebug("JsvPlayer:", this.holeId)
|
|
200
220
|
|
|
201
221
|
this.video = findMediaObjectByKey(key);
|
|
202
222
|
let first_create = true;
|
|
@@ -212,12 +232,12 @@ export default {
|
|
|
212
232
|
if(this.active){
|
|
213
233
|
this.registerEvent();
|
|
214
234
|
|
|
215
|
-
if(first_create){
|
|
235
|
+
//if(first_create){
|
|
216
236
|
if(this.src && this.src !== "")
|
|
217
237
|
this.video.src = this.src;
|
|
218
238
|
|
|
219
|
-
if(this.
|
|
220
|
-
this.video.currentTime = this.
|
|
239
|
+
if(this.currentTime !== 0)
|
|
240
|
+
this.video.currentTime = this.currentTime;
|
|
221
241
|
|
|
222
242
|
if(this.autoplay){
|
|
223
243
|
this.video.autoplay = this.autoplay;
|
|
@@ -234,7 +254,12 @@ export default {
|
|
|
234
254
|
if(this.keepLastFrame){
|
|
235
255
|
this.video.keepLastFrame = this.keepLastFrame;
|
|
236
256
|
}
|
|
237
|
-
|
|
257
|
+
|
|
258
|
+
if(this.videoAspectRatio !== "origin"){
|
|
259
|
+
this.video.videoAspectRatio = this.videoAspectRatio;
|
|
260
|
+
}
|
|
261
|
+
//}else{
|
|
262
|
+
if(!first_create){
|
|
238
263
|
this.video.setHoleID(this.holeId);
|
|
239
264
|
this.holeStyle = {
|
|
240
265
|
left: 0, top: 0,
|
|
@@ -256,7 +281,7 @@ export default {
|
|
|
256
281
|
|
|
257
282
|
methods: {
|
|
258
283
|
getHoleId(id){
|
|
259
|
-
|
|
284
|
+
logDebug("getHoleId:", id)
|
|
260
285
|
this.holeId = id;
|
|
261
286
|
},
|
|
262
287
|
registerEvent(){
|
|
@@ -266,7 +291,7 @@ export default {
|
|
|
266
291
|
//this.video.addEventListener("abort", this.onAbort);
|
|
267
292
|
this.video.addEventListener("timeupdate", this.onTimeUpdate);
|
|
268
293
|
this.video.addEventListener("loadstart", () => {
|
|
269
|
-
|
|
294
|
+
logDebug("JsvPlayer received loadstart event.");
|
|
270
295
|
this.holeStyle = {
|
|
271
296
|
left: 0, top: 0,
|
|
272
297
|
width:this.style.width, height:this.style.height
|
|
@@ -285,6 +310,10 @@ export default {
|
|
|
285
310
|
this.video.addEventListener("canplay", this.onCanPlay);
|
|
286
311
|
this.video.addEventListener("audiofocusloss", this.onAudioFocusLoss);
|
|
287
312
|
this.video.addEventListener("audiofocusgain", this.onAudioFocusGain);
|
|
313
|
+
this.video.addEventListener("timeshift", this.onTimeShift);
|
|
314
|
+
this.video.addEventListener("timeshifted", this.onTimeShifted);
|
|
315
|
+
this.video.addEventListener("backlive", this.onBackLive);
|
|
316
|
+
this.video.addEventListener("backlived", this.onBackLived);
|
|
288
317
|
}
|
|
289
318
|
}
|
|
290
319
|
},
|
|
@@ -8,25 +8,38 @@ export default {
|
|
|
8
8
|
playerType: {type: Number, default: 1}, // PC 模拟时,不对接本功能
|
|
9
9
|
background: {type: Boolean, default: true}, // PC 模拟时,不对接本功能
|
|
10
10
|
},
|
|
11
|
+
setup() {
|
|
12
|
+
return {
|
|
13
|
+
VideoRef: null
|
|
14
|
+
};
|
|
15
|
+
},
|
|
11
16
|
methods: {
|
|
12
17
|
onRefProxy(video_ref) {
|
|
13
|
-
|
|
14
|
-
// 补充插件扩展出来的接口
|
|
15
|
-
for (let method_name in playerExMethods) {
|
|
16
|
-
video_ref[method_name] = playerExMethods[method_name].bind(video_ref);
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
// video_ref为null,代表video标签卸载处理
|
|
20
|
-
}
|
|
18
|
+
this.VideoRef = video_ref;
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.onRef(video_ref);
|
|
25
|
-
}
|
|
20
|
+
// 不在此直接回调 onRef,因为onRefProxy可能会因为 .src的设置导致重新触发一次调用(vue本身问题)
|
|
21
|
+
// 参照vue-core处理的 componentUpdateFn处理, onMounted 一次, src设置后会再次 onPatch 一次
|
|
26
22
|
}
|
|
27
23
|
},
|
|
28
24
|
mounted() {
|
|
25
|
+
if (this.VideoRef && this.onRef) {
|
|
26
|
+
let video_ref = this.VideoRef;
|
|
27
|
+
this.VideoRef = null;
|
|
28
|
+
|
|
29
|
+
// 补充插件扩展出来的接口
|
|
30
|
+
for (let method_name in playerExMethods) {
|
|
31
|
+
video_ref[method_name] = playerExMethods[method_name].bind(video_ref);
|
|
32
|
+
}
|
|
29
33
|
|
|
34
|
+
// 将修改好的video回调返回给使用者
|
|
35
|
+
this.onRef(video_ref);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
beforeUnmount() {
|
|
39
|
+
if (this.onRef) {
|
|
40
|
+
// video_ref为null,代表video标签卸载处理
|
|
41
|
+
this.onRef(null);
|
|
42
|
+
}
|
|
30
43
|
}
|
|
31
44
|
};
|
|
32
45
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
let PluginInfo={
|
|
2
|
+
//downloadUrl:"http://192.168.0.37:8080/plugin/JsvPlayer-6.0.zip", //插件下载地址
|
|
3
|
+
packageName:"com.qcode.jsvplayer",
|
|
4
|
+
name:"播放器插件",
|
|
5
|
+
version:"1.5.0", //插件需要的版本号
|
|
6
|
+
versionCodeMin:150,
|
|
7
|
+
versionCodeMax:150,
|
|
8
|
+
bridgeName:"jsvPlayerBridge", //插件bridge注册到jsview的名称
|
|
9
|
+
className:"com.qcode.jsvplayer.JsvPlayer", //插件初始化类名称
|
|
10
|
+
initMethod:"createInstance", //插件初始化方法
|
|
11
|
+
listener:"top.JsvPlayerPluginLoadResult", //插件加载结果回调
|
|
12
|
+
listener2: "top.JsvPlayerPluginStatus",
|
|
13
|
+
// debug:true,
|
|
14
|
+
md5:"b0d74cbeafdb0adb02862addf61ce9d3"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// 不要用export default,update-env脚本不能解析
|
|
18
|
+
// 导出字段要含有 pluginVersionInfo 信息,作为npm时版本参考
|
|
19
|
+
module.exports = PluginInfo;
|
|
@@ -12,10 +12,34 @@ let DebugTools = {
|
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
function DebugWrap81ErrorStack() {
|
|
16
|
+
// V8 js-core r81 版本内部,对于console.error和warn的堆栈无法和map自动匹配(缺少列号)
|
|
17
|
+
// 后续的V8版本修正了这个问题,而对于81版本,先使用new Error中的堆栈信息来绕开这个问题
|
|
18
|
+
if (!console._jsvOriginError) {
|
|
19
|
+
console._jsvOriginError = console.error; // JSExtra固化函数不能简单的用闭包替代
|
|
20
|
+
console.error = (...args) => {
|
|
21
|
+
console._jsvOriginError(...args, new Error("stack"));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function DebugWrap81WarnStack() {
|
|
27
|
+
// V8 js-core r81 版本内部,对于console.error和warn的堆栈无法和map自动匹配(缺少列号)
|
|
28
|
+
// 后续的V8版本修正了这个问题,而对于81版本,先使用new Error中的堆栈信息来绕开这个问题
|
|
29
|
+
if (!console._jsvOriginWarn) {
|
|
30
|
+
console._jsvOriginWarn = console.warn; // JSExtra固化函数不能简单的用闭包替代
|
|
31
|
+
console.warn = (...args) => {
|
|
32
|
+
console._jsvOriginWarn(...args, new Error("stack"));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
15
37
|
// 全局引用,以便于在devtools中能直接进行查询
|
|
16
38
|
window.JsvDebugTools = DebugTools;
|
|
17
39
|
|
|
18
40
|
export {
|
|
19
41
|
DebugTools,
|
|
20
42
|
DebugObjectRefer,
|
|
43
|
+
DebugWrap81ErrorStack,
|
|
44
|
+
DebugWrap81WarnStack
|
|
21
45
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function toHtmlBorderSet() {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* imageWidth { int } // (必填)原图信息: 原图的宽度(由于正方形,宽高相同)
|
|
8
|
+
* centerWidth { int } // (必填)原图信息: .9图的中心区域宽度(repeat区域)
|
|
9
|
+
* imageDspWidth { int } // (选填)原图缩放后的显示宽度,计算方法:
|
|
10
|
+
* 四角为90度圆弧时: imageDspWidth = 显示图形的圆弧半径 / 原图中圆弧的半径 * 原图宽度
|
|
11
|
+
* 原图中圆弧半径 = (原图宽度 - borderOutset * 2) / 2
|
|
12
|
+
* 四角为其他形状时,原图.9图的四角区域,缩放到要和显示图形重合后的宽度。
|
|
13
|
+
* borderOutset { int } // (必填)原图信息: 图片边缘到中心内容区域边缘的距离, 快速计算: (原图宽度 - 原图中放内容宽度) / 2
|
|
14
|
+
*/
|
|
15
|
+
function toNinePatchForgeViewSet(imageWidth, centerWidth, imageDspWidth, borderOutset) {
|
|
16
|
+
let image_scaledown_width = (imageDspWidth > 0 ? imageDspWidth : imageWidth);
|
|
17
|
+
|
|
18
|
+
// 内容边缘尺寸(相对于缩放后的图)
|
|
19
|
+
let outset_of_content_scaledown = Math.ceil(borderOutset * image_scaledown_width / imageWidth);
|
|
20
|
+
|
|
21
|
+
// 中心repeat区域宽度,最小为1px
|
|
22
|
+
let center_repeat_width_scaledown = Math.max(1, Math.ceil(centerWidth * image_scaledown_width / imageWidth));
|
|
23
|
+
|
|
24
|
+
// 计算repeat距离图片的边界
|
|
25
|
+
// 注意: 当去除repeat区域后左右不对称时,默认取左边比右边的短1px
|
|
26
|
+
let outset_of_repeat_scaledown = Math.floor((image_scaledown_width - center_repeat_width_scaledown) / 2);
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
padding: {
|
|
30
|
+
start: outset_of_content_scaledown,
|
|
31
|
+
width: Math.max(0, image_scaledown_width - 2 * outset_of_content_scaledown)
|
|
32
|
+
},
|
|
33
|
+
repeat: [{
|
|
34
|
+
start: outset_of_repeat_scaledown,
|
|
35
|
+
width: center_repeat_width_scaledown
|
|
36
|
+
}],
|
|
37
|
+
imageDspSize: image_scaledown_width
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
toHtmlBorderSet,
|
|
43
|
+
toNinePatchForgeViewSet
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var number_convert_tmp = new Float32Array(1);
|
|
2
|
+
|
|
3
|
+
function numberCheckSet(number) {
|
|
4
|
+
number_convert_tmp = number; // 强制类型转换, 避免JSON化时类型出错,因为 '123' 123 都能通过Nan检测
|
|
5
|
+
if (!isNaN(number_convert_tmp)) {
|
|
6
|
+
return number_convert_tmp;
|
|
7
|
+
} else {
|
|
8
|
+
console.warn(`${number} is not type of number, default as 0`);
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function urlCheckSet(origin_url) {
|
|
14
|
+
if (origin_url && origin_url.indexOf("http") === 0) {
|
|
15
|
+
return origin_url;
|
|
16
|
+
} else if (window.JsView.React.UrlRef) {
|
|
17
|
+
return (new window.JsView.React.UrlRef(origin_url)).href;
|
|
18
|
+
} else {
|
|
19
|
+
console.warn(`${origin_url} is not valid url format, default as null`);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
numberCheckSet,
|
|
26
|
+
urlCheckSet
|
|
27
|
+
};
|
|
@@ -4,9 +4,18 @@ export default {
|
|
|
4
4
|
props: {
|
|
5
5
|
value: String,
|
|
6
6
|
size: Number,
|
|
7
|
-
fgColor:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
fgColor: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "#000000"
|
|
10
|
+
},
|
|
11
|
+
bgColor: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "#ffffff"
|
|
14
|
+
},
|
|
15
|
+
level: {
|
|
16
|
+
type: String, // ,容错级别,分别是L(7%)、M(15%)、Q(25%)、H(30%),
|
|
17
|
+
default: "L"
|
|
18
|
+
},
|
|
10
19
|
imageSettings: Object
|
|
11
20
|
},
|
|
12
21
|
data() {
|
|
@@ -90,7 +99,7 @@ export default {
|
|
|
90
99
|
const imageSettings = props.imageSettings;
|
|
91
100
|
const size = props.size;
|
|
92
101
|
if (!imageSettings) {
|
|
93
|
-
|
|
102
|
+
return null;
|
|
94
103
|
}
|
|
95
104
|
const w = imageSettings.width;
|
|
96
105
|
const h = imageSettings.height;
|
|
@@ -123,6 +132,8 @@ export default {
|
|
|
123
132
|
left: calculatedImageSettings.x + margin,
|
|
124
133
|
top: calculatedImageSettings.y + margin
|
|
125
134
|
}
|
|
135
|
+
} else {
|
|
136
|
+
this.imageStyle = {}
|
|
126
137
|
}
|
|
127
138
|
const fgPath = this.generatePath(cells, margin);
|
|
128
139
|
return {numCells, fgPath};
|
|
@@ -133,16 +144,16 @@ export default {
|
|
|
133
144
|
|
|
134
145
|
<template>
|
|
135
146
|
<div>
|
|
136
|
-
<
|
|
147
|
+
<jsve-svg
|
|
137
148
|
:type="'qrcode'"
|
|
138
149
|
:shapeRendering="'crispEdges'"
|
|
139
150
|
:height="size"
|
|
140
151
|
:width="size"
|
|
141
152
|
:viewBox="'0 0 ' + renderQrcode().numCells + ' ' + renderQrcode().numCells"
|
|
142
153
|
>
|
|
143
|
-
<
|
|
144
|
-
<
|
|
145
|
-
</
|
|
154
|
+
<jsve-path :fill="bgColor" :d="'M0,0 h' + renderQrcode().numCells + 'v' + renderQrcode().numCells + 'H0z'" />
|
|
155
|
+
<jsve-path :fill="fgColor" :d="renderQrcode().fgPath" />
|
|
156
|
+
</jsve-svg>
|
|
146
157
|
<div :style="imageStyle"></div>
|
|
147
158
|
</div>
|
|
148
159
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-10-13 13:14:42
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2022-04-25 15:37:04
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 【模块 export 内容】
|
|
11
11
|
* JsvApic:Vue高阶组件,控制动图播放
|
|
12
12
|
* prop说明:
|
|
13
|
-
* src {string} 对应img标签的src
|
|
13
|
+
* src {string} 对应img标签的src, 传url时需要注意使用url([链接])
|
|
14
14
|
* style {object} 对应img标签的style
|
|
15
15
|
* loopType {enum} 循环播放类型 LOOP_DEFAULT(默认)/LOOP_INFINITE(无限)/LOOP_FINITE(有限)/LOOP_PART(部分帧循环)
|
|
16
16
|
* loopInfo {int[][3]} loopType为LOOP_PART时的循环设置,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* 【模块 export 内容】
|
|
3
|
+
* JsvFilterView:黑白滤镜组件
|
|
4
|
+
* props说明:
|
|
5
|
+
* width {int} 宽
|
|
6
|
+
* height {int} 高
|
|
7
|
+
* left {int} left位置
|
|
8
|
+
* top {int} top位置
|
|
9
|
+
* methods说明:
|
|
10
|
+
* enableFilter
|
|
11
|
+
@description 开关滤镜
|
|
12
|
+
@params {boolean} enable 滤镜是否生效
|
|
13
|
+
-->
|
|
14
|
+
<script>
|
|
15
|
+
import { Forge, ForgeExtension } from "../../dom/jsv-forge-define";
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
props: {
|
|
19
|
+
width: {
|
|
20
|
+
type: Number,
|
|
21
|
+
},
|
|
22
|
+
height: {
|
|
23
|
+
type: Number,
|
|
24
|
+
},
|
|
25
|
+
left: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 0,
|
|
28
|
+
},
|
|
29
|
+
top: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
setup() {
|
|
35
|
+
return {
|
|
36
|
+
filterView: null,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
created() {
|
|
40
|
+
this.filterView = new Forge.FilterView();
|
|
41
|
+
const view_store = ForgeExtension.RootActivity
|
|
42
|
+
? ForgeExtension.RootActivity.ViewStore
|
|
43
|
+
: Forge.sViewStore;
|
|
44
|
+
this.viewId = view_store.add(
|
|
45
|
+
new Forge.ViewInfo(this.filterView, {
|
|
46
|
+
x: this.left,
|
|
47
|
+
y: this.top,
|
|
48
|
+
width: this.width,
|
|
49
|
+
height: this.height,
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
beforeUnmount() {
|
|
54
|
+
const view_store = ForgeExtension.RootActivity
|
|
55
|
+
? ForgeExtension.RootActivity.ViewStore
|
|
56
|
+
: Forge.sViewStore;
|
|
57
|
+
view_store.remove(this.viewId);
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
enableFilter(enable) {
|
|
61
|
+
if (this.filterView) {
|
|
62
|
+
this.filterView.FilterSwitch(enable);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<div :jsv_innerview="viewId">
|
|
71
|
+
<slot></slot>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|