详细问题描述
页面在onShow中延迟启动扫码框,当延迟时间比较小的时候,bug出现:在开启扫码框后,点击返回,扫码框退出,返回到本页面,再次返回,返回主页面,在这时,无法再次进入页面。
但延迟时间大一点,这个问题就消失了。
async scanQrCode() {
let _this = this;
let status = await _this.checkPermission();
if (status !== 1) {
return;
}
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
}
});
},
onShow() {
//页面载入执行扫码
var _this = this;
setTimeout(function() {
_this.scanQrCode();
}, 300);
}
1 个评论
要回复文章请先登录或注册
公侯好仇