ctx.draw(true,function (e) {
console.log(‘draw callback’)
})
finishCanvas(){
var self=this
ctx.draw(true,function (e) {
console.log(‘draw callback’)
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: 680,
height: 570,
destWidth: 100,
destHeight: 100,
canvasId: ‘myCanvas’,
success: function (res) {
self.setData({
pic: res.tempFilePath
})
console.log(self.data.pic)
wx.navigateTo({
url: ‘/pages/pay/pay?pic=’ + self.data.pic + ‘&pic_title=’ + self.data.pic_title
})
},
fail:function(res){
console.log(“保存图片返回路径调用失败”)
}
},this)
})
},