uu
This commit is contained in:
parent
11609b9f8c
commit
fea523a122
@ -1,20 +1,23 @@
|
||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
{
|
||||
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"app-plus" :
|
||||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-android"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -3,6 +3,10 @@ import qs from "@/common/libs/qs"
|
||||
import { saveAs } from "file-saver"
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
const appCloudScanner = uni.requireNativePlugin('Ba-Scanner');
|
||||
// #endif
|
||||
|
||||
|
||||
const tabBarUrls = [
|
||||
'/pages/tabBar/deal/deal',
|
||||
@ -78,8 +82,34 @@ const hideLoading = ()=> {
|
||||
uni.hideLoading();
|
||||
}
|
||||
|
||||
const customAppScanCode = ({resolve, reject})=> {
|
||||
appCloudScanner.onScan(
|
||||
{
|
||||
// isContinuous: true,
|
||||
barcodeFormats: [
|
||||
// "QR Code"
|
||||
],
|
||||
// scanTimeSpace: 2000,
|
||||
// isShowVibrate: true,
|
||||
// isShowBeep: false,
|
||||
hintText: '扫码',
|
||||
},
|
||||
(res) => {
|
||||
console.log("scanCode res========", res)
|
||||
if (res.result) {
|
||||
resolve(res.result)
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const scanCode = ()=> {
|
||||
return new Promise((resolve, reject)=> {
|
||||
// #ifdef APP-PLUS
|
||||
customAppScanCode({resolve, reject})
|
||||
// #endif
|
||||
|
||||
// #ifndef APP-PLUS
|
||||
uni.scanCode({
|
||||
onlyFromCamera: false,
|
||||
success: (res) =>{
|
||||
@ -88,6 +118,7 @@ const scanCode = ()=> {
|
||||
},
|
||||
fail: reject
|
||||
})
|
||||
// #endif0
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -180,6 +180,22 @@
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : true
|
||||
},
|
||||
"nativePlugins" : {
|
||||
"Ba-Scanner" : {
|
||||
"__plugin_info__" : {
|
||||
"name" : "扫码原生插件 - 新(连续扫码、设置格式、任意自定义界面)Ba-Scanner",
|
||||
"description" : "Ba-Scanner 是一款毫秒级扫码插件,采用Google MLKit。支持连续扫码,持续万次不卡顿;支持自定义任意界面、任意点击事件、权限说明;支持多码、相册、闪光灯、焦距缩放、提示音、震动等等。",
|
||||
"platforms" : "Android",
|
||||
"url" : "https://ext.dcloud.net.cn/plugin?id=9669",
|
||||
"android_package_name" : "uni.UNIBCB0FB5",
|
||||
"ios_bundle_id" : "uni.UNIBCB0FB5",
|
||||
"isCloud" : true,
|
||||
"bought" : 1,
|
||||
"pid" : "9669",
|
||||
"parameters" : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user