|
@@ -827,29 +827,23 @@ export default {
|
|
this.$wx.scanQRCode({
|
|
this.$wx.scanQRCode({
|
|
onlyFromCamera: false,
|
|
onlyFromCamera: false,
|
|
// desc: 'scanQRCode desc',
|
|
// desc: 'scanQRCode desc',
|
|
- needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
|
|
|
|
+ needResult: 0, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
// scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
|
// scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log('H5页面扫码获取到的参数——成功1', res);
|
|
console.log('H5页面扫码获取到的参数——成功1', res);
|
|
// const res = {"resultStr": "lo$Qed.3YuVi*D7vXilrrV0571a1&type=unlicensedIn", "errMsg": "scanQRCode:ok"}
|
|
// const res = {"resultStr": "lo$Qed.3YuVi*D7vXilrrV0571a1&type=unlicensedIn", "errMsg": "scanQRCode:ok"}
|
|
// const test = {"resultStr": "lp$Qed.3YuVi*D7vXilrrV0571a2&type=unlicensedOut", "errMsg": "scanQRCode:ok"}
|
|
// const test = {"resultStr": "lp$Qed.3YuVi*D7vXilrrV0571a2&type=unlicensedOut", "errMsg": "scanQRCode:ok"}
|
|
let path = res.resultStr.replace(/.*([a-z0-9]{6}&type)/g, '8b$1')
|
|
let path = res.resultStr.replace(/.*([a-z0-9]{6}&type)/g, '8b$1')
|
|
- console.log(614, path);
|
|
|
|
const regex = /(\w+)&type=(\w+)/;
|
|
const regex = /(\w+)&type=(\w+)/;
|
|
const match = path.match(regex);
|
|
const match = path.match(regex);
|
|
const obj = {code: match[1], type: match[2]};
|
|
const obj = {code: match[1], type: match[2]};
|
|
- console.log(618, obj);
|
|
|
|
- console.log(696, this.qrCodesRule);
|
|
|
|
this.$store.commit('SET_UNLICENSED_INFO', obj);
|
|
this.$store.commit('SET_UNLICENSED_INFO', obj);
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.qrCodesRule(obj.code, 'scan');
|
|
this.qrCodesRule(obj.code, 'scan');
|
|
})
|
|
})
|
|
- // runScanFn(res);
|
|
|
|
- // this.formMsg.deviceCode = res.resultStr;
|
|
|
|
},
|
|
},
|
|
error: (res) => {
|
|
error: (res) => {
|
|
console.log('H5页面扫码获取到的参数——失败', res);
|
|
console.log('H5页面扫码获取到的参数——失败', res);
|
|
- // console.log(242, res);
|
|
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|