const query = this.createSelectorQuery()
var that = this
query.select('#qrcode').fields({node: true}).exec((qrcoderes) => {
var canvas = qrcoderes[0].node
qrcode({
canvas: canvas,
canvasId: 'qrcode',
width: util.pxToRpx(125),
height: util.pxToRpx(125),
padding: 0,
text: res.result.activityMacheteMember.writeOffCode,
})
// 获取临时路径
wx.canvasToTempFilePath({
canvasId: 'qrcode',
canvas: canvas,
x: 0,
y: 0,
width: util.pxToRpx(125),
height: util.pxToRpx(125),
destWidth: util.pxToRpx(125),
destHeight: util.pxToRpx(125),
success(res) {
that.data.data.activityMacheteMember.tempImg = res.tempFilePath
that.setData({
data: that.data.data
})
},
fail(res) {
console.error(res)
}
})
})
.qrcode {
width: 250rpx;
height: 250rpx;
margin: 0 auto;
display: none;
}
.canvas_icon {
width: 250rpx;
height: 250rpx;
margin: 0 auto;
}
目前真机调试没问题,但是发布到体验版二维码悬浮
解决了吗?