w-ui-v1 1.0.68 → 1.0.70
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 +1 -1
- package/utils/idata-scan.ts +26 -2
package/package.json
CHANGED
package/utils/idata-scan.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//注意:需要在插件市场 安装 安卓原生插件“iData
|
|
1
|
+
//注意:需要在插件市场 安装 安卓原生插件“iData条码扫描插件”,https://ext.dcloud.net.cn/plugin?id=3898#
|
|
2
2
|
interface callback {
|
|
3
3
|
(scanData:any): void;
|
|
4
4
|
}
|
|
@@ -63,7 +63,31 @@ const closeBarcode=()=>{
|
|
|
63
63
|
});
|
|
64
64
|
// #endif
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
const stopBarcode=()=>{
|
|
68
|
+
// #ifdef APP-PLUS
|
|
69
|
+
//建议在页面onHide方法里调用
|
|
70
|
+
//停止扫描
|
|
71
|
+
//接口scanStop(UniJSCallback callback)
|
|
72
|
+
barcodeModel.scanStop((ret) => {
|
|
73
|
+
console.log(ret)
|
|
74
|
+
});
|
|
75
|
+
globalEvent.removeEventListener('iDataBarcodeEvent')
|
|
76
|
+
// #endif
|
|
77
|
+
}
|
|
78
|
+
const startBarcode=()=>{
|
|
79
|
+
// #ifdef APP-PLUS
|
|
80
|
+
//建议在页面onShow方法里调用
|
|
81
|
+
//开始扫描
|
|
82
|
+
//接口scanStop(UniJSCallback callback)
|
|
83
|
+
barcodeModel.scanStart((ret) => {
|
|
84
|
+
console.log(ret)
|
|
85
|
+
});
|
|
86
|
+
// #endif
|
|
87
|
+
}
|
|
66
88
|
export default {
|
|
67
89
|
initBarcode,
|
|
68
|
-
closeBarcode
|
|
90
|
+
closeBarcode,
|
|
91
|
+
stopBarcode,
|
|
92
|
+
startBarcode
|
|
69
93
|
}
|