From 452672f8584db4d3b6870a8a22291e23f1026af0 Mon Sep 17 00:00:00 2001 From: taiyuan Date: Fri, 3 Dec 2021 14:48:24 +0800 Subject: [PATCH] 幸运购修改5 --- packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js | 41 +++++++++++++++++++++++------------------ packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 4 ++++ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index 5ab59ea..1b2a44e 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -52,7 +52,7 @@ Page({ showPoster: false, luckyGoMembers: [], - team_id: 0, + // team_id: 0, }, onLoad: function (t) { @@ -113,8 +113,9 @@ Page({ onUnload: function () { + console.log('999999999999999999999onUnolad~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~',this.data.luckyGoInfo); // 开团成功后,清除storage里的team_id - if(this.data.luckyGoInfo.num && this.data.luckyGoInfo.num == 0) { + if(this.data.luckyGoInfo && this.data.luckyGoInfo.num == 0) { wx.removeStorageSync('team_id'); }; // 如果是从会员中心的幸运购列表点击进来的,退出时清除storage里的team_id @@ -1149,6 +1150,7 @@ Page({ // 获取幸运购参团情况 async get_team_info () { var th = this; + // wx.removeStorageSync('team_id'); // 幸运购成团信息 await getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { data: { @@ -1166,7 +1168,10 @@ Page({ if(th.data.param.from == 1) { team_id = th.data.team_id; } else { - team_id = luckyGoInfo.team_id; + // team_id = luckyGoInfo.team_id; + if(luckyGoInfo.team_id == 0) { + team_id = wx.getStorageSync('team_id'); + } }; th.setData({ @@ -1179,20 +1184,20 @@ Page({ //如果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, - }); - }; + // 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, @@ -1211,7 +1216,7 @@ Page({ } }).then(res => { if(res.data.code == 0) { - console.log('当前参团成员', res, ); + console.log('当前参团成员', res, self.data.team_id); let myId = getApp().globalData.userInfo.user_id; let luckyGoMembers = res.data.data.pageData; th.setData({ diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index e1fd245..0327415 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -1083,6 +1083,10 @@ Page({ team_id: res.data.data.pageData[0].team_id, luckGoMembers: [], }); + wx.setStorage({ + key: 'team_id', + data: th.data.team_id, + }); th.countDown(th.data.luckGoInfo.end_time, 0); }; -- libgit2 0.21.4