// 快速扫码
scan : function() {
let that = this;
console.log("onScan");
wx.scanCode({
success: (res => {
console.log(res);
if (res.result. indexOf(prefix.DETAILS) != -1) {
let params = util.getParamsFromUrl(res.result);
if (params.id) {
wx.navigateTo({
url: '/pages/ryt6767566/details?id=' + params.id,
})
}
that.setData({
error: false
})
} else {
that.setData({
error: true
})
}
}),
complete: (res => {
console.log("complete");
}),
fail: (error => {
console.log('error');
})
})
}
wx-if是用来显示或者隐藏的、
wx:if是用来进行逻辑判断的