diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.js b/packageB/pages/luckactivity/luckinfo/luckinfo.js index a831d4d..bd87da6 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.js +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.js @@ -217,7 +217,8 @@ let imgDraw = { Page({ data: { - imgDraw: imgDraw, + imgDraw: {}, + start: false, list: null, isLoading: false, // 检测是否已经发送请求,防止重复发送请求 @@ -257,21 +258,11 @@ Page({ }, onLoad(options) { - // wx.showLoading(); - // this.setData({ - // showMask2: true, - // }); - // console.log('imghost+++++', imghost); self = this; let first_leader = null; this.data.options = options; - // this.setData({ - // options, - // imghost, - // }); - // console.log('this data', this.data.imghost); wx.setNavigationBarTitle({ title: options.title, }); @@ -303,11 +294,7 @@ Page({ } }) }; - - - - - + }, onShow() { @@ -315,6 +302,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"); @@ -327,22 +315,33 @@ Page({ self.setData({ 'imgDraw.views[0].url': res.tempFilePath,//头像 }); + } } }); + this.setData({ + imgDraw: imgDraw, userInfo: app.globalData.userInfo, isLogin: true, 'imgDraw.views[1].text': app.globalData.userInfo.nickname,//昵称 }); + + // console.log('imgDraw.views[1].text+++++++++', imgDraw.views[1], app.globalData.userInfo.nickname); let user_id = app.globalData.userInfo.user_id; let store_id = app.globalData.setting.stoid; 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, { @@ -369,6 +368,8 @@ Page({ // console.log('luckInfo', res.data.data); let luckInfo = res.data.data; + + self.setData({ 'imgDraw.views[3].text': self.data.luckInfo.act_name,//分享标题 // 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容 @@ -528,28 +529,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 = []; @@ -768,7 +768,6 @@ Page({ // 根据lbtype指定奖品类别图标 prizeSrc(lbtype) { let src = ''; - // let imghost = this.data.imghost; switch(lbtype) { case 1: { //积分 src = imghost + 'miniapp/images/luckDraw/jf.png'; @@ -1310,13 +1309,14 @@ Page({ title: '生成海报中', }); setTimeout(function() { - wx.hideLoading(); self.setData({ hiddenCanvas: true, showMask: true, showPoster: true, }); - }, 3000); + wx.hideLoading(); + }, 3000) + }, diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.wxml b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml index 9289292..e5a3926 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.wxml +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml @@ -189,7 +189,7 @@ - +