修改扫码功能报错的问题

master
lemon橪 2021-06-07 11:31:30 +08:00
parent db63ace4b0
commit 3cc2f1e019
1 changed files with 25 additions and 12 deletions

View File

@ -107,11 +107,9 @@ export default {
}, },
/** /**
* 唤醒客户端扫码 * 扫码
* 没权限去申请权限有权限获取扫码功能
*/ */
scan() { seacnCode() {
if (permision.judgeIosPermission("camera")) {
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
let path = encodeURIComponent(res.result); let path = encodeURIComponent(res.result);
@ -124,6 +122,16 @@ export default {
}, 100); }, 100);
}, },
}); });
},
/**
* 唤醒客户端扫码
* 没权限去申请权限有权限获取扫码功能
*/
scan() {
// #ifdef APP-PLUS
if (permision.judgeIosPermission("camera")) {
this.seacnCode();
} else { } else {
// //
uni.showModal({ uni.showModal({
@ -136,6 +144,11 @@ export default {
}, },
}); });
} }
// #endif
// #ifdef MP-WEIXIN
this.seacnCode();
// #endif
}, },
}, },
}; };