From 51b6a2bdd095a6a7f4d8c0381fdb260342587d7f Mon Sep 17 00:00:00 2001 From: banche Date: Thu, 9 Dec 2021 09:44:33 +0800 Subject: [PATCH] 最后一步人头像 --- packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------- 1 file changed, 79 insertions(+), 52 deletions(-) diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index 0081df6..945de95 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -1150,78 +1150,102 @@ Page({ // 获取幸运购参团情况 async get_team_info () { - var th = this; + var th = this; + var team_id; + var luckyGoInfo; + var user_id = getApp().globalData.user_id; + + // 邀请链接待完善 + + await getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { + data: { + store_id: o.stoid, + is_end: 0, + timetype: 1, + id: th.data.param.group_id, + } + }).then(res => { + if(res.data.code == 0) { + + luckyGoInfo = res.data.data.pageData[0]; + // if(th.data.param.from == 1) { + // team_id = luckyGoInfo.team_id; + // } + + + // else { + // team_id = luckyGoInfo.team_id; + + // // 待完善 + // if(luckyGoInfo.team_id == 0) { + // team_id = wx.getStorageSync('team_id'); + // }; + + // }; + + th.setData({ + luckyGoInfo, + }); + + //参团成功后,检查team_id + //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ + //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 + //如果从会员中心的幸运购列表邀请好友点击进来,不执行storage操作 + if(th.data.param.from == 1) return false; + // if(team_id > 0) { + // wx.setStorage({ + // key: 'team_id', + // data: team_id, + // }); + // console.log('存储team_id', team_id); + // } else { + // let team_id2 = wx.getStorageSync('team_id'); + // console.log('获取team_id', team_id2); + // th.setData({ + // team_id: team_id2, + // // isSuccess: true, + // }); + // }; + + // th.setData({ + // luckyGoInfo, + // team_id, + // }); + + }; + + }); + + // wx.removeStorageSync('team_id'); // 幸运购成团信息 - await getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { + await getApp().request.promiseGet("/api/weshop/prom/luckyOrder/getUserOrderLastInfo/" + o.stoid + "/" + user_id + "/" + th.data.param.group_id, { data: { - store_id: o.stoid, - is_end: 0, - timetype: 1, - id: this.data.param.group_id, } }).then(res => { + if(res.data.code == 0) { - console.log('当前成团信息', res); - var luckyGoInfo = res.data.data.pageData[0]; - var team_id; - - if(th.data.param.from == 1) { - team_id = th.data.team_id; - } else { - team_id = luckyGoInfo.team_id; - if(luckyGoInfo.team_id == 0) { - team_id = wx.getStorageSync('team_id'); - }; - // else { - // team_id = luckyGoInfo.team_id; - // }; - // team_id = wx.getStorageSync('team_id'); - }; + + team_id = res.data.data.team_id; th.setData({ - luckyGoInfo, team_id, }); - //参团成功后,检查team_id - //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ - //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 - //如果从会员中心的幸运购列表邀请好友点击进来,不执行storage操作 - if(th.data.param.from == 1) return false; - // if(team_id > 0) { - // wx.setStorage({ - // key: 'team_id', - // data: team_id, - // }); - // console.log('存储team_id', team_id); - // } else { - // let team_id2 = wx.getStorageSync('team_id'); - // console.log('获取team_id', team_id2); - // th.setData({ - // team_id: team_id2, - // // isSuccess: true, - // }); - // }; - - // th.setData({ - // luckyGoInfo, - // team_id, - // }); - }; - }); + }); + // 幸运购成团成员 await getApp().request.promiseGet("/api/weshop/prom/luckyOrder/page", { data: { store_id: o.stoid, - team_id: this.data.team_id, + team_id: team_id, } }).then(res => { if(res.data.code == 0) { - console.log('当前参团成员', res, self.data.team_id); + console.log('当前参团成员', res, team_id); let myId = getApp().globalData.userInfo.user_id; let luckyGoMembers = res.data.data.pageData; th.setData({ @@ -1231,7 +1255,10 @@ Page({ self.isMe(myId, luckyGoMembers); }; - }); + }); + + + }, -- libgit2 0.21.4