const ctx = wx.createCanvasContext('share', that)
const that = this;
setTimeout(()=>{
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: 332,
height: 360,
destWidth: 332 / 2,
destHeight: 360 / 2,
canvasId: 'share',
success(res){
console.log(res)
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success(result){
console.log(result);
wx.showToast({
title: '证件已保存至相册',
icon: 'none'
})
},
fail(err){
console.log(err)
}
})
},
fail(err){
console.log(err)
}
}, that)
}, 500)
创建上下文和保存的时候都传入了this,但还报错找不到