master
pipi 4 years ago
parent e43c76df15
commit 7928916143

@ -83,19 +83,21 @@
}); });
uni.request({ uni.request({
url: this.baseUrl + '/api/member/get-wxa-qrcode', url: this.baseUrl + '/api/member/get-wxa-qrcode',
method: 'POST', method: 'GET',
data: { data: {
path: '', path: '',
scene: this.user_info.id scene: this.user_info.id
}, },
success: r => { success: r => {
if (r.data.status === 1) { if (r.data.status === 1) {
let img_qr = r.data.data // uni.getImageInfo({
src: this.baseUrl + r.data.data, //
success: res => {
let ctx = uni.createCanvasContext('firstCanvas') let ctx = uni.createCanvasContext('firstCanvas')
// ctx.fillStyle = '#fff'; // ctx.fillStyle = '#fff';
// ctx.fillRect(0, 0, 214, 342); // ctx.fillRect(0, 0, 214, 342);
ctx.drawImage('../../static/bg_haibao@2x.png', 0, 0, 220, 220); ctx.drawImage('../../static/bg_haibao@2x.png', 0, 0, 220, 220);
ctx.drawImage(img_qr, 43, 43, 128, 128); ctx.drawImage(res.path, 43, 43, 128, 128);
ctx.draw() ctx.draw()
setTimeout(()=>{ setTimeout(()=>{
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
@ -108,6 +110,8 @@
}, },
}) })
},100) },100)
}
})
} else { } else {
this.alert(r.data.msg) this.alert(r.data.msg)
} }

Loading…
Cancel
Save