|
|
|
|
@ -83,31 +83,35 @@
|
|
|
|
|
});
|
|
|
|
|
uni.request({
|
|
|
|
|
url: this.baseUrl + '/api/member/get-wxa-qrcode',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
method: 'GET',
|
|
|
|
|
data: {
|
|
|
|
|
path: '',
|
|
|
|
|
scene: this.user_info.id
|
|
|
|
|
},
|
|
|
|
|
success: r => {
|
|
|
|
|
if (r.data.status === 1) {
|
|
|
|
|
let img_qr = r.data.data // 二维码
|
|
|
|
|
let ctx = uni.createCanvasContext('firstCanvas')
|
|
|
|
|
// ctx.fillStyle = '#fff';
|
|
|
|
|
// ctx.fillRect(0, 0, 214, 342);
|
|
|
|
|
ctx.drawImage('../../static/bg_haibao@2x.png', 0, 0, 220, 220);
|
|
|
|
|
ctx.drawImage(img_qr, 43, 43, 128, 128);
|
|
|
|
|
ctx.draw()
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
uni.canvasToTempFilePath({
|
|
|
|
|
canvasId: 'firstCanvas',
|
|
|
|
|
fileType: 'jpg',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
this.$refs.shareCode.open()
|
|
|
|
|
this.img = res.tempFilePath
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
},100)
|
|
|
|
|
uni.getImageInfo({
|
|
|
|
|
src: this.baseUrl + r.data.data, // 二维码
|
|
|
|
|
success: res => {
|
|
|
|
|
let ctx = uni.createCanvasContext('firstCanvas')
|
|
|
|
|
// ctx.fillStyle = '#fff';
|
|
|
|
|
// ctx.fillRect(0, 0, 214, 342);
|
|
|
|
|
ctx.drawImage('../../static/bg_haibao@2x.png', 0, 0, 220, 220);
|
|
|
|
|
ctx.drawImage(res.path, 43, 43, 128, 128);
|
|
|
|
|
ctx.draw()
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
uni.canvasToTempFilePath({
|
|
|
|
|
canvasId: 'firstCanvas',
|
|
|
|
|
fileType: 'jpg',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
this.$refs.shareCode.open()
|
|
|
|
|
this.img = res.tempFilePath
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
},100)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.alert(r.data.msg)
|
|
|
|
|
}
|
|
|
|
|
|