diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.js b/packageB/pages/luckactivity/luckinfo/luckinfo.js index bd87da6..040dd9a 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.js +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.js @@ -158,11 +158,12 @@ let imgDraw = { { //12.横线 "type": "rect", "css": { - "background": "#f8f8f8", - "width": "554px", + "color": "#eee", + "width": "548px", "height": "1px", "top": "676px", - "left": "0px", + "left": "277px", + "align": "center", } }, { //13 @@ -217,7 +218,7 @@ let imgDraw = { Page({ data: { - imgDraw: {}, + imgDraw: imgDraw, start: false, list: null, @@ -322,7 +323,6 @@ Page({ this.setData({ - imgDraw: imgDraw, userInfo: app.globalData.userInfo, isLogin: true, 'imgDraw.views[1].text': app.globalData.userInfo.nickname,//昵称 @@ -544,6 +544,7 @@ Page({ if(res.code != -1) { self.setData({ 'imgDraw.views[16].url': res.path, + getMiniCode: true, }); }; } @@ -1047,7 +1048,7 @@ Page({ num: --num, }); } - }, 1000); + }, 500); }; @@ -1304,20 +1305,67 @@ Page({ this.showQr(); }, + + showPoster() { + + console.log('已经生成图片!!!!!!', self.data.imgPath); + // console.log(Promise.resolve(this.onImgOK)); wx.showLoading({ title: '生成海报中', }); - setTimeout(function() { + var timer; + if(this.data.isImgOk && this.data.getMiniCode) { + wx.hideLoading(); self.setData({ + myimg: self.data.imgPath, hiddenCanvas: true, showMask: true, showPoster: true, }); - wx.hideLoading(); - }, 3000) - + } else { + timer = setInterval(function() { + if(self.data.isImgOk && self.data.getMiniCode) { + clearInterval(timer); + wx.hideLoading(); + self.setData({ + myimg: self.data.imgPath, + hiddenCanvas: true, + showMask: true, + showPoster: true, + }); + }; + }, 1000); + }; + // if(this.data.isImgOk) { + // setTimeout(function() { + // wx.hideLoading(); + // self.setData({ + // myimg: self.data.imgPath, + // hiddenCanvas: true, + // showMask: true, + // showPoster: true, + // }); + // }, 300); + + // } else { + // wx.showToast({ + // title: '生成失败,请重新点击', + // icon: 'none', + // }); + // }; + // setTimeout(function() { + // // if(self.data.myimg) { + // if(self.data.imgPath) { + // wx.hideLoading(); + + // } else { + // console.log('没有生成图片!!!!!!', self.data.imgPath); + // }; + + // // } + // }, 300); }, closePoster() { @@ -1331,9 +1379,19 @@ Page({ onImgOK(e) { - this.setData({ - myimg: e.detail.path, - }); + console.log('图片绘制成功', e.detail.path); + // this.setData({ + // imgPath: e.detail.path, + // }); + if(e&&e.detail.path) { + this.setData({ + isImgOk: true, + imgPath: e.detail.path, + }); + }; + }, + + }) \ No newline at end of file diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.wxml b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml index e5a3926..49d030c 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.wxml +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml @@ -70,14 +70,14 @@ - + 活动时间: {{filter.format_time(luckInfo.begindate, 1) + ' 至 ' + filter.format_time(luckInfo.enddate, 1)}} - + 活动说明: