Commit 82ec4afb2b45840816206976c003759f55341cef
1 parent
e682561e
转盘
Showing
2 changed files
with
36 additions
and
16 deletions
packageB/pages/luckactivity/luckinfo/luckinfo.js
... | ... | @@ -217,7 +217,7 @@ let imgDraw = { |
217 | 217 | |
218 | 218 | Page({ |
219 | 219 | data: { |
220 | - imgDraw: imgDraw, | |
220 | + //imgDraw: imgDraw, | |
221 | 221 | |
222 | 222 | start: false, |
223 | 223 | list: null, |
... | ... | @@ -302,7 +302,7 @@ Page({ |
302 | 302 | |
303 | 303 | if(app.globalData.userInfo) { |
304 | 304 | if(!this.data.isLogin) { |
305 | - | |
305 | + imgDraw.views[1].text = app.globalData.userInfo.nickname; | |
306 | 306 | // 下载头像 |
307 | 307 | let path = app.globalData.userInfo.head_pic; |
308 | 308 | path = path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); |
... | ... | @@ -312,9 +312,11 @@ Page({ |
312 | 312 | success (res) { |
313 | 313 | // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容 |
314 | 314 | if (res.statusCode === 200) { |
315 | - self.setData({ | |
316 | - 'imgDraw.views[0].url': res.tempFilePath,//头像 | |
317 | - }); | |
315 | + // self.setData({ | |
316 | + // 'imgDraw.views[0].url': res.tempFilePath,//头像 | |
317 | + // }); | |
318 | + | |
319 | + imgDraw.views[0].url = res.tempFilePath; | |
318 | 320 | } |
319 | 321 | } |
320 | 322 | }); |
... | ... | @@ -323,8 +325,10 @@ Page({ |
323 | 325 | this.setData({ |
324 | 326 | userInfo: app.globalData.userInfo, |
325 | 327 | isLogin: true, |
326 | - 'imgDraw.views[1].text': app.globalData.userInfo.nickname,//昵称 | |
328 | + //'imgDraw.views[1].text': app.globalData.userInfo.nickname,//昵称 | |
327 | 329 | }); |
330 | + | |
331 | + | |
328 | 332 | // console.log('imgDraw.views[1].text+++++++++', imgDraw.views[1], app.globalData.userInfo.nickname); |
329 | 333 | let user_id = app.globalData.userInfo.user_id; |
330 | 334 | let store_id = app.globalData.setting.stoid; |
... | ... | @@ -364,11 +368,15 @@ Page({ |
364 | 368 | // console.log('luckInfo', res.data.data); |
365 | 369 | let luckInfo = res.data.data; |
366 | 370 | |
367 | - self.setData({ | |
368 | - 'imgDraw.views[3].text': self.data.luckInfo.act_name,//分享标题 | |
369 | - // 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容 | |
370 | - 'imgDraw.views[14].text': util.formar_no_full(luckInfo.begindate) + ' 至 ' + util.formar_no_full(luckInfo.enddate),//活动时间 | |
371 | - }); | |
371 | + imgDraw.views[3].text = self.data.luckInfo.act_name;//分享标题 | |
372 | + // 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容 | |
373 | + imgDraw.views[14].text = util.formar_no_full(luckInfo.begindate) + ' 至 ' + util.formar_no_full(luckInfo.enddate);//活动时间 | |
374 | + | |
375 | + // self.setData({ | |
376 | + // 'imgDraw.views[3].text': self.data.luckInfo.act_name,//分享标题 | |
377 | + // // 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容 | |
378 | + // 'imgDraw.views[14].text': util.formar_no_full(luckInfo.begindate) + ' 至 ' + util.formar_no_full(luckInfo.enddate),//活动时间 | |
379 | + // }); | |
372 | 380 | |
373 | 381 | |
374 | 382 | |
... | ... | @@ -387,11 +395,15 @@ Page({ |
387 | 395 | bannerUrl: imghost + template.bannerUrl, //背景图 |
388 | 396 | 'blocks[0].imgs[0].src': imghost + ((template&&template.wheelBaseUrl) ? template.wheelBaseUrl:'miniapp/images/luckDraw/weel.png?v=3'), |
389 | 397 | 'buttons[0].imgs[0].src': imghost + ((template&&template.wheelPointerUrl) ? template.wheelPointerUrl:'miniapp/images/luckDraw/pointer.png?v=3'), //指针 |
390 | - 'imgDraw.views[3].text': template.share_title ? template.share_title:self.data.luckInfo.act_name, //分享标题 | |
391 | - 'imgDraw.views[5].url': imghost + (template&&template.share_image ? template.share_image:self.data.luckInfo.imageurl), //分享图片 | |
398 | + // 要用 | |
399 | + //'imgDraw.views[3].text': template.share_title ? template.share_title:self.data.luckInfo.act_name, //分享标题 | |
400 | + //'imgDraw.views[5].url': imghost + (template&&template.share_image ? template.share_image:self.data.luckInfo.imageurl), //分享图片 | |
392 | 401 | |
393 | 402 | }); |
394 | 403 | |
404 | + imgDraw.views[3].text = template.share_title ? template.share_title:self.data.luckInfo.act_name; //分享标题 | |
405 | + imgDraw.views[5].url = imghost + (template&&template.share_image ? template.share_image:self.data.luckInfo.imageurl); //分享图片 | |
406 | + | |
395 | 407 | let color = template&&template.colorCode ? template.colorCode:'#da104b'; |
396 | 408 | luckStyle = `background: ${color} url(${self.data.bannerUrl}) no-repeat;`; |
397 | 409 | self.setData({ |
... | ... | @@ -413,10 +425,13 @@ Page({ |
413 | 425 | luckStyle = `background: #da104b url(${imghost + 'miniapp/images/luckDraw/bg.png?v=2'}) no-repeat;`; |
414 | 426 | self.setData({ |
415 | 427 | luckStyle, |
416 | - 'imgDraw.views[5].url': self.data.luckInfo.imageurl ? (imghost + self.data.luckInfo.imageurl):'/packageB/images/luckDraw/jiang.png', //分享图片 | |
428 | + //'imgDraw.views[5].url': self.data.luckInfo.imageurl ? (imghost + self.data.luckInfo.imageurl):'/packageB/images/luckDraw/jiang.png', //分享图片 | |
417 | 429 | 'blocks[0].imgs[0].src': imghost + 'miniapp/images/luckDraw/weel.png?v=3', //转盘 |
418 | 430 | 'buttons[0].imgs[0].src': imghost + 'miniapp/images/luckDraw/pointer.png?v=3', //指针 |
419 | 431 | }); |
432 | + | |
433 | + imgDraw.views[5].url = self.data.luckInfo.imageurl ? (imghost + self.data.luckInfo.imageurl):'/packageB/images/luckDraw/jiang.png'; //分享图片 | |
434 | + | |
420 | 435 | // let color = template&&template.colorCode ? template.colorCode:'#da104b'; |
421 | 436 | |
422 | 437 | // self.setData({ |
... | ... | @@ -430,8 +445,10 @@ Page({ |
430 | 445 | |
431 | 446 | if(luckInfo && luckInfo.imageurl) { |
432 | 447 | self.setData({ |
433 | - 'imgDraw.views[5].url': imghost + self.data.luckInfo.imageurl, //分享图片 | |
448 | + //'imgDraw.views[5].url': imghost + self.data.luckInfo.imageurl, //分享图片 | |
434 | 449 | }); |
450 | + | |
451 | + imgDraw.views[5].url = imghost + self.data.luckInfo.imageurl; //分享图片 | |
435 | 452 | }; |
436 | 453 | |
437 | 454 | if(luckInfo && luckInfo.store_bannerUrl) { |
... | ... | @@ -456,6 +473,9 @@ Page({ |
456 | 473 | |
457 | 474 | }; |
458 | 475 | |
476 | + self.setData({ | |
477 | + imgDraw: imgDraw, | |
478 | + }); | |
459 | 479 | |
460 | 480 | if(self.data.luckInfo.msgInfo) { |
461 | 481 | wx.showToast({ | ... | ... |
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
... | ... | @@ -205,4 +205,4 @@ |
205 | 205 | <qrcode id="qrcode" bind:close="closeQr"></qrcode> |
206 | 206 | |
207 | 207 | |
208 | -<painter style="position: absolute; top: -9999rpx;" palette="{{imgDraw}}" bind:imgOK="onImgOK" dirty="true"/> | |
209 | 208 | \ No newline at end of file |
209 | +<painter style="position: absolute; top: -9999rpx;" palette="{{imgDraw}}" bind:imgOK="onImgOK"/> | |
210 | 210 | \ No newline at end of file | ... | ... |