Commit 82ec4afb2b45840816206976c003759f55341cef

Authored by taiyuan
1 parent e682561e

转盘

packageB/pages/luckactivity/luckinfo/luckinfo.js
@@ -217,7 +217,7 @@ let imgDraw = { @@ -217,7 +217,7 @@ let imgDraw = {
217 217
218 Page({ 218 Page({
219 data: { 219 data: {
220 - imgDraw: imgDraw, 220 + //imgDraw: imgDraw,
221 221
222 start: false, 222 start: false,
223 list: null, 223 list: null,
@@ -302,7 +302,7 @@ Page({ @@ -302,7 +302,7 @@ Page({
302 302
303 if(app.globalData.userInfo) { 303 if(app.globalData.userInfo) {
304 if(!this.data.isLogin) { 304 if(!this.data.isLogin) {
305 - 305 + imgDraw.views[1].text = app.globalData.userInfo.nickname;
306 // 下载头像 306 // 下载头像
307 let path = app.globalData.userInfo.head_pic; 307 let path = app.globalData.userInfo.head_pic;
308 path = path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); 308 path = path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
@@ -312,9 +312,11 @@ Page({ @@ -312,9 +312,11 @@ Page({
312 success (res) { 312 success (res) {
313 // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容 313 // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
314 if (res.statusCode === 200) { 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,8 +325,10 @@ Page({
323 this.setData({ 325 this.setData({
324 userInfo: app.globalData.userInfo, 326 userInfo: app.globalData.userInfo,
325 isLogin: true, 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 // console.log('imgDraw.views[1].text+++++++++', imgDraw.views[1], app.globalData.userInfo.nickname); 332 // console.log('imgDraw.views[1].text+++++++++', imgDraw.views[1], app.globalData.userInfo.nickname);
329 let user_id = app.globalData.userInfo.user_id; 333 let user_id = app.globalData.userInfo.user_id;
330 let store_id = app.globalData.setting.stoid; 334 let store_id = app.globalData.setting.stoid;
@@ -364,11 +368,15 @@ Page({ @@ -364,11 +368,15 @@ Page({
364 // console.log('luckInfo', res.data.data); 368 // console.log('luckInfo', res.data.data);
365 let luckInfo = res.data.data; 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,11 +395,15 @@ Page({
387 bannerUrl: imghost + template.bannerUrl, //背景图 395 bannerUrl: imghost + template.bannerUrl, //背景图
388 'blocks[0].imgs[0].src': imghost + ((template&&template.wheelBaseUrl) ? template.wheelBaseUrl:'miniapp/images/luckDraw/weel.png?v=3'), 396 'blocks[0].imgs[0].src': imghost + ((template&&template.wheelBaseUrl) ? template.wheelBaseUrl:'miniapp/images/luckDraw/weel.png?v=3'),
389 'buttons[0].imgs[0].src': imghost + ((template&&template.wheelPointerUrl) ? template.wheelPointerUrl:'miniapp/images/luckDraw/pointer.png?v=3'), //指针 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 let color = template&&template.colorCode ? template.colorCode:'#da104b'; 407 let color = template&&template.colorCode ? template.colorCode:'#da104b';
396 luckStyle = `background: ${color} url(${self.data.bannerUrl}) no-repeat;`; 408 luckStyle = `background: ${color} url(${self.data.bannerUrl}) no-repeat;`;
397 self.setData({ 409 self.setData({
@@ -413,10 +425,13 @@ Page({ @@ -413,10 +425,13 @@ Page({
413 luckStyle = `background: #da104b url(${imghost + 'miniapp/images/luckDraw/bg.png?v=2'}) no-repeat;`; 425 luckStyle = `background: #da104b url(${imghost + 'miniapp/images/luckDraw/bg.png?v=2'}) no-repeat;`;
414 self.setData({ 426 self.setData({
415 luckStyle, 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 'blocks[0].imgs[0].src': imghost + 'miniapp/images/luckDraw/weel.png?v=3', //转盘 429 'blocks[0].imgs[0].src': imghost + 'miniapp/images/luckDraw/weel.png?v=3', //转盘
418 'buttons[0].imgs[0].src': imghost + 'miniapp/images/luckDraw/pointer.png?v=3', //指针 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 // let color = template&&template.colorCode ? template.colorCode:'#da104b'; 435 // let color = template&&template.colorCode ? template.colorCode:'#da104b';
421 436
422 // self.setData({ 437 // self.setData({
@@ -430,8 +445,10 @@ Page({ @@ -430,8 +445,10 @@ Page({
430 445
431 if(luckInfo && luckInfo.imageurl) { 446 if(luckInfo && luckInfo.imageurl) {
432 self.setData({ 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 if(luckInfo && luckInfo.store_bannerUrl) { 454 if(luckInfo && luckInfo.store_bannerUrl) {
@@ -456,6 +473,9 @@ Page({ @@ -456,6 +473,9 @@ Page({
456 473
457 }; 474 };
458 475
  476 + self.setData({
  477 + imgDraw: imgDraw,
  478 + });
459 479
460 if(self.data.luckInfo.msgInfo) { 480 if(self.data.luckInfo.msgInfo) {
461 wx.showToast({ 481 wx.showToast({
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
@@ -205,4 +205,4 @@ @@ -205,4 +205,4 @@
205 <qrcode id="qrcode" bind:close="closeQr"></qrcode> 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 \ No newline at end of file 208 \ No newline at end of file
  209 +<painter style="position: absolute; top: -9999rpx;" palette="{{imgDraw}}" bind:imgOK="onImgOK"/>
210 \ No newline at end of file 210 \ No newline at end of file