wx.scanCode({
scanType: ['qrCode'],
success: (res) => {
wx.showLoading({
title: '验证中',
mask: true
});
verifyCode({
scanCode: res.result,
exchangeMode: currentMode.modeCode
}).then((data) => {
const isCodeExists = this.checkDuplicateCode(data);
if (isCodeExists) {
Message.error({
offset: [150, 32],
content: '请勿重复扫码',
});
return;
}
let newCodes = [...this.data.multiCodes, data];
this.setData({
multiCodes: newCodes
}, () => {
if (newCodes.length > 3) {
this.scrollToBottom();
}
this.checkExchangeCondition();
});
}).finally(() => {
wx.hideLoading();
});
},
fail() {
Message.error({
offset: [150, 32],
content: '未扫描到二维码',
});
}
});
},
请问这个问题解决了吗,我们也遇到了,个别手机上会这样,比如小米
用<camera mode="scanCode"/>试试呢