Commit dcc0098884b576ef8caa30456078598c035a24eb
1 parent
5faf982b
转盘小程序码
Showing
1 changed file
with
27 additions
and
26 deletions
packageB/pages/luckactivity/luckinfo/luckinfo.js
@@ -315,6 +315,7 @@ Page({ | @@ -315,6 +315,7 @@ Page({ | ||
315 | 315 | ||
316 | if(app.globalData.userInfo) { | 316 | if(app.globalData.userInfo) { |
317 | if(!this.data.isLogin) { | 317 | if(!this.data.isLogin) { |
318 | + | ||
318 | // 下载头像 | 319 | // 下载头像 |
319 | let path = app.globalData.userInfo.head_pic; | 320 | let path = app.globalData.userInfo.head_pic; |
320 | path = path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | 321 | path = path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); |
@@ -331,6 +332,7 @@ Page({ | @@ -331,6 +332,7 @@ Page({ | ||
331 | } | 332 | } |
332 | }); | 333 | }); |
333 | 334 | ||
335 | + | ||
334 | this.setData({ | 336 | this.setData({ |
335 | userInfo: app.globalData.userInfo, | 337 | userInfo: app.globalData.userInfo, |
336 | isLogin: true, | 338 | isLogin: true, |
@@ -342,7 +344,13 @@ Page({ | @@ -342,7 +344,13 @@ Page({ | ||
342 | let id = this.data.options.id; | 344 | let id = this.data.options.id; |
343 | let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`; | 345 | let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`; |
344 | 346 | ||
345 | - | 347 | + //获取小程序码 |
348 | + this.getMiniCode({ | ||
349 | + url: app.globalData.setting.url, | ||
350 | + store_id: app.globalData.setting.stoid, | ||
351 | + user_id: app.globalData.userInfo.user_id, | ||
352 | + id: this.data.options.id, | ||
353 | + }); | ||
346 | 354 | ||
347 | 355 | ||
348 | app.request.get(url, { | 356 | app.request.get(url, { |
@@ -528,28 +536,27 @@ Page({ | @@ -528,28 +536,27 @@ Page({ | ||
528 | }, | 536 | }, |
529 | }); | 537 | }); |
530 | 538 | ||
531 | - let mainUrl = app.globalData.setting.url; | ||
532 | - // let stoid = app.globalData.setting.stoid; | ||
533 | - let cj_id = this.data.options.id; | ||
534 | - // let user_id = app.globalData.userInfo.user_id; | ||
535 | 539 | ||
536 | - wx.getImageInfo({ | ||
537 | - src: `${mainUrl}/api/wx/open/app/user/getWeAppEwm/${store_id}?sceneValue=${user_id}_${cj_id}&pageValue=pages/index/index/index`, | ||
538 | - success (res) { | ||
539 | - if(res.code != -1) { | ||
540 | - self.setData({ | ||
541 | - 'imgDraw.views[16].url': res.path, | ||
542 | - }); | ||
543 | - }; | ||
544 | - | ||
545 | - } | ||
546 | - }); | ||
547 | 540 | ||
548 | 541 | ||
549 | }; | 542 | }; |
550 | }; | 543 | }; |
551 | }, | 544 | }, |
552 | 545 | ||
546 | + //获取小程序码 | ||
547 | + getMiniCode(objData) { | ||
548 | + wx.getImageInfo({ | ||
549 | + src: `${objData.url}/api/wx/open/app/user/getWeAppEwm/${objData.store_id}?sceneValue=${objData.user_id}_${objData.id}&pageValue=pages/index/index/index`, | ||
550 | + success (res) { | ||
551 | + if(res.code != -1) { | ||
552 | + self.setData({ | ||
553 | + 'imgDraw.views[16].url': res.path, | ||
554 | + }); | ||
555 | + }; | ||
556 | + } | ||
557 | + }); | ||
558 | + }, | ||
559 | + | ||
553 | // 设置转盘奖品布局 | 560 | // 设置转盘奖品布局 |
554 | prizeLayout(award) { | 561 | prizeLayout(award) { |
555 | let prizes = []; | 562 | let prizes = []; |
@@ -1306,17 +1313,11 @@ Page({ | @@ -1306,17 +1313,11 @@ Page({ | ||
1306 | }, | 1313 | }, |
1307 | 1314 | ||
1308 | showPoster() { | 1315 | showPoster() { |
1309 | - wx.showLoading({ | ||
1310 | - title: '生成海报中', | 1316 | + this.setData({ |
1317 | + hiddenCanvas: true, | ||
1318 | + showMask: true, | ||
1319 | + showPoster: true, | ||
1311 | }); | 1320 | }); |
1312 | - setTimeout(function() { | ||
1313 | - wx.hideLoading(); | ||
1314 | - self.setData({ | ||
1315 | - hiddenCanvas: true, | ||
1316 | - showMask: true, | ||
1317 | - showPoster: true, | ||
1318 | - }); | ||
1319 | - }, 3000); | ||
1320 | 1321 | ||
1321 | }, | 1322 | }, |
1322 | 1323 |