This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
"modules" : {
|
||||
"Barcode" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
|
||||
@@ -127,29 +127,29 @@
|
||||
|
||||
const handleScanLogin = () => {
|
||||
// #ifdef H5
|
||||
if (typeof wx === 'undefined' || !wx.scanQRCode) {
|
||||
uni.showToast({ title: '请在微信中打开', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
wx.scanQRCode({
|
||||
needResult: 1,
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: (res) => {
|
||||
const result = res.resultStr;
|
||||
if (result && result.includes('device_id')) {
|
||||
const match = result.match(/device_id[=]([^&]*)/);
|
||||
if (match && match[1]) {
|
||||
identifier.value = match[1];
|
||||
handleLogin();
|
||||
if (typeof wx !== 'undefined' && wx.scanQRCode) {
|
||||
wx.scanQRCode({
|
||||
needResult: 1,
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: (res) => {
|
||||
const result = res.resultStr;
|
||||
if (result && result.includes('device_id')) {
|
||||
const match = result.match(/device_id[=]([^&]*)/);
|
||||
if (match && match[1]) {
|
||||
identifier.value = match[1];
|
||||
handleLogin();
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: '无效的二维码', icon: 'none' });
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: '无效的二维码', icon: 'none' });
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: '扫码失败,请重试', icon: 'none' });
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: '扫码失败', icon: 'none' });
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
uni.showToast({ title: '扫一扫功能暂不可用', icon: 'none' });
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
uni.showToast({ title: '请在微信中打开', icon: 'none' });
|
||||
|
||||
Reference in New Issue
Block a user