@tplc/wot 0.1.32 → 0.1.37
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/CHANGELOG.md +10 -0
- package/components/wd-qr-code/types.ts +2 -3
- package/components/wd-qr-code/uqrcode.vue +26 -26
- package/components/wd-qr-code/wd-qr-code.vue +1 -1
- package/package.json +1 -1
- package/types/components/wd-qr-code/types.d.ts +2 -6
- package/types/components/wd-qr-code/wd-qr-code.vue.d.ts +4 -14
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.37](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.36...v0.1.37) (2024-11-24)
|
|
6
|
+
|
|
7
|
+
### [0.1.36](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.35...v0.1.36) (2024-11-24)
|
|
8
|
+
|
|
9
|
+
### [0.1.35](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.34...v0.1.35) (2024-11-24)
|
|
10
|
+
|
|
11
|
+
### [0.1.34](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.33...v0.1.34) (2024-11-24)
|
|
12
|
+
|
|
13
|
+
### [0.1.33](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.32...v0.1.33) (2024-11-24)
|
|
14
|
+
|
|
5
15
|
### [0.1.32](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.76...v0.1.32) (2024-11-24)
|
|
6
16
|
|
|
7
17
|
### [0.1.31](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.70...v0.1.31) (2024-11-22)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeBooleanProp, makeNumberProp, makeRequiredProp, makeStringProp } from '../common/props'
|
|
2
2
|
|
|
3
3
|
export const qrCodeProps = {
|
|
4
|
-
...baseProps,
|
|
5
4
|
/** canvas组件id */
|
|
6
|
-
canvasId:
|
|
5
|
+
canvasId: makeRequiredProp(String),
|
|
7
6
|
/** 二维码内容 */
|
|
8
7
|
value: makeStringProp(''),
|
|
9
8
|
options: {
|
|
@@ -365,7 +365,7 @@ export default {
|
|
|
365
365
|
* 获取模板选项
|
|
366
366
|
*/
|
|
367
367
|
getTemplateOptions() {
|
|
368
|
-
|
|
368
|
+
const size = this.sizeUnit == 'rpx' ? uni.upx2px(this.size) : this.size
|
|
369
369
|
return deepReplace(this.templateOptions, {
|
|
370
370
|
size,
|
|
371
371
|
width: size,
|
|
@@ -397,13 +397,13 @@ export default {
|
|
|
397
397
|
* 绘制二维码
|
|
398
398
|
*/
|
|
399
399
|
async draw(callback = {}, isDrawDelegate = false) {
|
|
400
|
-
if (typeof callback.success
|
|
400
|
+
if (typeof callback.success !== 'function') {
|
|
401
401
|
callback.success = () => {}
|
|
402
402
|
}
|
|
403
|
-
if (typeof callback.fail
|
|
403
|
+
if (typeof callback.fail !== 'function') {
|
|
404
404
|
callback.fail = () => {}
|
|
405
405
|
}
|
|
406
|
-
if (typeof callback.complete
|
|
406
|
+
if (typeof callback.complete !== 'function') {
|
|
407
407
|
callback.complete = () => {}
|
|
408
408
|
}
|
|
409
409
|
|
|
@@ -590,7 +590,7 @@ export default {
|
|
|
590
590
|
// #endif
|
|
591
591
|
// #ifdef APP-NVUE
|
|
592
592
|
/* NVue获取canvas上下文方式 */
|
|
593
|
-
const gcanvas = this.$refs
|
|
593
|
+
const gcanvas = this.$refs.gcanvas
|
|
594
594
|
const canvas = enable(gcanvas, {
|
|
595
595
|
bridge: WeexBridge,
|
|
596
596
|
})
|
|
@@ -622,10 +622,10 @@ export default {
|
|
|
622
622
|
/* 延时等待页面重新绘制完毕 */
|
|
623
623
|
setTimeout(() => {
|
|
624
624
|
/* 从插件获取具体要调用哪一个扩展函数 */
|
|
625
|
-
|
|
626
|
-
|
|
625
|
+
const plugin = this.plugins.find((p) => p.name == qr.style)
|
|
626
|
+
const drawCanvasName = plugin ? plugin.drawCanvas : 'drawCanvas'
|
|
627
627
|
/* 虽然qr[drawCanvasName]是直接返回Promise的,但由于js内部this指向问题,故不能直接exec(qr[drawCanvasName])此方式执行,需要改成exec(() => qr[drawCanvasName]())才能正确获取this */
|
|
628
|
-
|
|
628
|
+
let drawCanvas
|
|
629
629
|
if (this.queue) {
|
|
630
630
|
drawCanvas = () => queueDraw.exec(() => qr[drawCanvasName]())
|
|
631
631
|
// drawCanvas = () => queueDraw.exec(() => new Promise((resolve, reject) => {
|
|
@@ -641,7 +641,7 @@ export default {
|
|
|
641
641
|
.then(() => {
|
|
642
642
|
if (this.drawDelegate) {
|
|
643
643
|
/* 高频重绘纠正 */
|
|
644
|
-
|
|
644
|
+
const delegate = this.drawDelegate
|
|
645
645
|
this.drawDelegate = undefined
|
|
646
646
|
delegate()
|
|
647
647
|
} else {
|
|
@@ -653,7 +653,7 @@ export default {
|
|
|
653
653
|
console.log(err)
|
|
654
654
|
if (this.drawDelegate) {
|
|
655
655
|
/* 高频重绘纠正 */
|
|
656
|
-
|
|
656
|
+
const delegate = this.drawDelegate
|
|
657
657
|
this.drawDelegate = undefined
|
|
658
658
|
delegate()
|
|
659
659
|
} else {
|
|
@@ -675,13 +675,13 @@ export default {
|
|
|
675
675
|
this.makeing = true
|
|
676
676
|
this.isError = false
|
|
677
677
|
|
|
678
|
-
if (typeof callback.success
|
|
678
|
+
if (typeof callback.success !== 'function') {
|
|
679
679
|
callback.success = () => {}
|
|
680
680
|
}
|
|
681
|
-
if (typeof callback.fail
|
|
681
|
+
if (typeof callback.fail !== 'function') {
|
|
682
682
|
callback.fail = () => {}
|
|
683
683
|
}
|
|
684
|
-
if (typeof callback.complete
|
|
684
|
+
if (typeof callback.complete !== 'function') {
|
|
685
685
|
callback.complete = () => {}
|
|
686
686
|
}
|
|
687
687
|
|
|
@@ -734,19 +734,19 @@ export default {
|
|
|
734
734
|
* 导出临时路径
|
|
735
735
|
*/
|
|
736
736
|
toTempFilePath(callback = {}) {
|
|
737
|
-
if (typeof callback.success
|
|
737
|
+
if (typeof callback.success !== 'function') {
|
|
738
738
|
callback.success = () => {}
|
|
739
739
|
}
|
|
740
|
-
if (typeof callback.fail
|
|
740
|
+
if (typeof callback.fail !== 'function') {
|
|
741
741
|
callback.fail = () => {}
|
|
742
742
|
}
|
|
743
|
-
if (typeof callback.complete
|
|
743
|
+
if (typeof callback.complete !== 'function') {
|
|
744
744
|
callback.complete = () => {}
|
|
745
745
|
}
|
|
746
746
|
|
|
747
747
|
if (!this.makeExecuted) {
|
|
748
748
|
console.error('[uQRCode]: make() 方法从未调用!请先成功调用 make() 后再进行操作。')
|
|
749
|
-
|
|
749
|
+
const err = {
|
|
750
750
|
errMsg:
|
|
751
751
|
'[uQRCode]: make() method has never been executed! please execute make() successfully before operating.',
|
|
752
752
|
}
|
|
@@ -812,7 +812,7 @@ export default {
|
|
|
812
812
|
callback.complete()
|
|
813
813
|
},
|
|
814
814
|
},
|
|
815
|
-
this
|
|
815
|
+
this,
|
|
816
816
|
)
|
|
817
817
|
}
|
|
818
818
|
// #endif
|
|
@@ -830,7 +830,7 @@ export default {
|
|
|
830
830
|
(res) => {
|
|
831
831
|
callback.success(res)
|
|
832
832
|
callback.complete(res)
|
|
833
|
-
}
|
|
833
|
+
},
|
|
834
834
|
)
|
|
835
835
|
// #endif
|
|
836
836
|
},
|
|
@@ -838,13 +838,13 @@ export default {
|
|
|
838
838
|
* 保存
|
|
839
839
|
*/
|
|
840
840
|
save(callback = {}) {
|
|
841
|
-
if (typeof callback.success
|
|
841
|
+
if (typeof callback.success !== 'function') {
|
|
842
842
|
callback.success = () => {}
|
|
843
843
|
}
|
|
844
|
-
if (typeof callback.fail
|
|
844
|
+
if (typeof callback.fail !== 'function') {
|
|
845
845
|
callback.fail = () => {}
|
|
846
846
|
}
|
|
847
|
-
if (typeof callback.complete
|
|
847
|
+
if (typeof callback.complete !== 'function') {
|
|
848
848
|
callback.complete = () => {}
|
|
849
849
|
}
|
|
850
850
|
|
|
@@ -960,8 +960,8 @@ export default {
|
|
|
960
960
|
}
|
|
961
961
|
},
|
|
962
962
|
getLoadImage(loadImage) {
|
|
963
|
-
|
|
964
|
-
if (typeof loadImage
|
|
963
|
+
const that = this
|
|
964
|
+
if (typeof loadImage === 'function') {
|
|
965
965
|
return function (src) {
|
|
966
966
|
/* 判断是否是队列加载图片的 */
|
|
967
967
|
if (that.isQueueLoadImage) {
|
|
@@ -1018,8 +1018,8 @@ function deepReplace(o = {}, r = {}, c = false) {
|
|
|
1018
1018
|
...o,
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
for (
|
|
1022
|
-
|
|
1021
|
+
for (const k in r) {
|
|
1022
|
+
const vr = r[k]
|
|
1023
1023
|
if (vr != undefined) {
|
|
1024
1024
|
if (vr.constructor == Object) {
|
|
1025
1025
|
obj[k] = this.deepReplace(obj[k], vr)
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const qrCodeProps: {
|
|
2
2
|
/** canvas组件id */
|
|
3
3
|
canvasId: {
|
|
4
|
-
type:
|
|
5
|
-
|
|
4
|
+
type: StringConstructor
|
|
5
|
+
required: true
|
|
6
6
|
}
|
|
7
7
|
/** 二维码内容 */
|
|
8
8
|
value: {
|
|
@@ -76,8 +76,4 @@ export declare const qrCodeProps: {
|
|
|
76
76
|
type: import('vue').PropType<string>
|
|
77
77
|
default: string
|
|
78
78
|
}
|
|
79
|
-
customStyle: {
|
|
80
|
-
type: import('vue').PropType<string>
|
|
81
|
-
default: string
|
|
82
|
-
}
|
|
83
79
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<
|
|
2
2
|
{
|
|
3
3
|
canvasId: {
|
|
4
|
-
type:
|
|
5
|
-
|
|
4
|
+
type: StringConstructor
|
|
5
|
+
required: true
|
|
6
6
|
}
|
|
7
7
|
value: {
|
|
8
8
|
type: import('vue').PropType<string>
|
|
@@ -63,10 +63,6 @@ declare const _default: import('vue').DefineComponent<
|
|
|
63
63
|
type: import('vue').PropType<string>
|
|
64
64
|
default: string
|
|
65
65
|
}
|
|
66
|
-
customStyle: {
|
|
67
|
-
type: import('vue').PropType<string>
|
|
68
|
-
default: string
|
|
69
|
-
}
|
|
70
66
|
},
|
|
71
67
|
{},
|
|
72
68
|
unknown,
|
|
@@ -80,8 +76,8 @@ declare const _default: import('vue').DefineComponent<
|
|
|
80
76
|
Readonly<
|
|
81
77
|
import('vue').ExtractPropTypes<{
|
|
82
78
|
canvasId: {
|
|
83
|
-
type:
|
|
84
|
-
|
|
79
|
+
type: StringConstructor
|
|
80
|
+
required: true
|
|
85
81
|
}
|
|
86
82
|
value: {
|
|
87
83
|
type: import('vue').PropType<string>
|
|
@@ -142,21 +138,15 @@ declare const _default: import('vue').DefineComponent<
|
|
|
142
138
|
type: import('vue').PropType<string>
|
|
143
139
|
default: string
|
|
144
140
|
}
|
|
145
|
-
customStyle: {
|
|
146
|
-
type: import('vue').PropType<string>
|
|
147
|
-
default: string
|
|
148
|
-
}
|
|
149
141
|
}>
|
|
150
142
|
>,
|
|
151
143
|
{
|
|
152
|
-
customStyle: string
|
|
153
144
|
customClass: string
|
|
154
145
|
value: string
|
|
155
146
|
type: string
|
|
156
147
|
size: number
|
|
157
148
|
loading: boolean
|
|
158
149
|
start: boolean
|
|
159
|
-
canvasId: string
|
|
160
150
|
auto: boolean
|
|
161
151
|
fileType: string
|
|
162
152
|
sizeUnit: string
|