From dcc0098884b576ef8caa30456078598c035a24eb Mon Sep 17 00:00:00 2001 From: taiyuan Date: Wed, 11 Aug 2021 11:33:14 +0800 Subject: [PATCH] 转盘小程序码 --- packageB/pages/luckactivity/luckinfo/luckinfo.js | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.js b/packageB/pages/luckactivity/luckinfo/luckinfo.js index a831d4d..05b5e65 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.js +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.js @@ -315,6 +315,7 @@ Page({ if(app.globalData.userInfo) { if(!this.data.isLogin) { + // 下载头像 let path = app.globalData.userInfo.head_pic; path = path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); @@ -331,6 +332,7 @@ Page({ } }); + this.setData({ userInfo: app.globalData.userInfo, isLogin: true, @@ -342,7 +344,13 @@ Page({ let id = this.data.options.id; let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`; - + //获取小程序码 + this.getMiniCode({ + url: app.globalData.setting.url, + store_id: app.globalData.setting.stoid, + user_id: app.globalData.userInfo.user_id, + id: this.data.options.id, + }); app.request.get(url, { @@ -528,28 +536,27 @@ Page({ }, }); - let mainUrl = app.globalData.setting.url; - // let stoid = app.globalData.setting.stoid; - let cj_id = this.data.options.id; - // let user_id = app.globalData.userInfo.user_id; - wx.getImageInfo({ - src: `${mainUrl}/api/wx/open/app/user/getWeAppEwm/${store_id}?sceneValue=${user_id}_${cj_id}&pageValue=pages/index/index/index`, - success (res) { - if(res.code != -1) { - self.setData({ - 'imgDraw.views[16].url': res.path, - }); - }; - - } - }); }; }; }, + //获取小程序码 + getMiniCode(objData) { + wx.getImageInfo({ + src: `${objData.url}/api/wx/open/app/user/getWeAppEwm/${objData.store_id}?sceneValue=${objData.user_id}_${objData.id}&pageValue=pages/index/index/index`, + success (res) { + if(res.code != -1) { + self.setData({ + 'imgDraw.views[16].url': res.path, + }); + }; + } + }); + }, + // 设置转盘奖品布局 prizeLayout(award) { let prizes = []; @@ -1306,17 +1313,11 @@ Page({ }, showPoster() { - wx.showLoading({ - title: '生成海报中', + this.setData({ + hiddenCanvas: true, + showMask: true, + showPoster: true, }); - setTimeout(function() { - wx.hideLoading(); - self.setData({ - hiddenCanvas: true, - showMask: true, - showPoster: true, - }); - }, 3000); }, -- libgit2 0.21.4