|
|
@ -311,6 +311,7 @@ |
|
|
context.draw(); |
|
|
context.draw(); |
|
|
//将生成好的图片保存到本地,需要延迟一会,绘制期间耗时 |
|
|
//将生成好的图片保存到本地,需要延迟一会,绘制期间耗时 |
|
|
setTimeout(function() { |
|
|
setTimeout(function() { |
|
|
|
|
|
wx.hideToast(); |
|
|
wx.canvasToTempFilePath({ |
|
|
wx.canvasToTempFilePath({ |
|
|
canvasId: 'mycanvas', |
|
|
canvasId: 'mycanvas', |
|
|
success: function(res) { |
|
|
success: function(res) { |
|
|
@ -354,22 +355,23 @@ |
|
|
}, |
|
|
}, |
|
|
formSubmit() { |
|
|
formSubmit() { |
|
|
var that = this; |
|
|
var that = this; |
|
|
wx.showToast({ |
|
|
|
|
|
title: '生成海报中...', |
|
|
|
|
|
icon: 'loading', |
|
|
|
|
|
duration: 1000 |
|
|
|
|
|
}); |
|
|
|
|
|
wx.hideToast() |
|
|
|
|
|
console.log(that.onceCode) |
|
|
|
|
|
console.log(that.backgroundImg) |
|
|
|
|
|
if(that.onceCode) { |
|
|
|
|
|
that.createNewImg() |
|
|
|
|
|
}else if(!that.onceCode){ |
|
|
|
|
|
this.$msg('小程序码生成失败!') |
|
|
|
|
|
} |
|
|
|
|
|
// else if(!that.backgroundImg){ |
|
|
|
|
|
// this.$msg('海报背景图生成失败!') |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
that.$u.throttle(() => { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '生成海报中...', |
|
|
|
|
|
icon: 'loading', |
|
|
|
|
|
duration: 1000 |
|
|
|
|
|
}); |
|
|
|
|
|
console.log(that.onceCode) |
|
|
|
|
|
console.log(that.backgroundImg) |
|
|
|
|
|
if(that.onceCode) { |
|
|
|
|
|
that.createNewImg() |
|
|
|
|
|
}else if(!that.onceCode){ |
|
|
|
|
|
this.$msg('小程序码生成失败!') |
|
|
|
|
|
} |
|
|
|
|
|
// else if(!that.backgroundImg){ |
|
|
|
|
|
// this.$msg('海报背景图生成失败!') |
|
|
|
|
|
// } |
|
|
|
|
|
}, 500); |
|
|
}, |
|
|
}, |
|
|
//海报结束 |
|
|
//海报结束 |
|
|
getGoodsDetail() { |
|
|
getGoodsDetail() { |
|
|
|