Why use this tool to generate two-dimensional code will have the probability of the problem of messy code?
MachoManCk opened this issue · 1 comments
MachoManCk commented
MachoManCk commented
const that = this;
new QRCode('myQrcode', {
text: checkSaleLink,
width: 150,
height: 150,
padding: 6,
correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度
callback: (e) => {
// 使用 setTimeout, 避免部分安卓机转出来的二维码图片不完整
setTimeout(() => {
wx.canvasToTempFilePath({
canvasId: 'myQrcode',
width: 150,
height: 150,
success: (e) => {
that.setData({
codeUrl: e.tempFilePath
})
log.info(二维码绘制成功,url参数为${checkSaleLink},用户唯一标示为${wx.getStorageSync('openId')},用户微信名称为${JSON.stringify(wx.getStorageSync('userInfo'))},当前店铺为${wx.getStorageSync('shopUuid')}
)
},
fail: err => {
log.error(二维码绘制失败错误日志为${JSON.stringify(err)}
)
}
})
}, 200);
}
})