From d3fb0a647ad1a00edf896bf07f0229f781dbda14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Fri, 16 Jul 2021 14:29:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E7=94=9F=E6=88=90=E6=B5=B7=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goodsDetail/index.vue | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/pages/goodsDetail/index.vue b/pages/goodsDetail/index.vue index 45ccdb1..e01f691 100644 --- a/pages/goodsDetail/index.vue +++ b/pages/goodsDetail/index.vue @@ -311,6 +311,7 @@ context.draw(); //将生成好的图片保存到本地,需要延迟一会,绘制期间耗时 setTimeout(function() { + wx.hideToast(); wx.canvasToTempFilePath({ canvasId: 'mycanvas', success: function(res) { @@ -354,22 +355,23 @@ }, formSubmit() { 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() {