Commit 452672f8584db4d3b6870a8a22291e23f1026af0
1 parent
02bfdad1
幸运购修改5
Showing
2 changed files
with
27 additions
and
18 deletions
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
... | ... | @@ -52,7 +52,7 @@ Page({ |
52 | 52 | showPoster: false, |
53 | 53 | |
54 | 54 | luckyGoMembers: [], |
55 | - team_id: 0, | |
55 | + // team_id: 0, | |
56 | 56 | }, |
57 | 57 | |
58 | 58 | onLoad: function (t) { |
... | ... | @@ -113,8 +113,9 @@ Page({ |
113 | 113 | |
114 | 114 | |
115 | 115 | onUnload: function () { |
116 | + console.log('999999999999999999999onUnolad~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~',this.data.luckyGoInfo); | |
116 | 117 | // 开团成功后,清除storage里的team_id |
117 | - if(this.data.luckyGoInfo.num && this.data.luckyGoInfo.num == 0) { | |
118 | + if(this.data.luckyGoInfo && this.data.luckyGoInfo.num == 0) { | |
118 | 119 | wx.removeStorageSync('team_id'); |
119 | 120 | }; |
120 | 121 | // 如果是从会员中心的幸运购列表点击进来的,退出时清除storage里的team_id |
... | ... | @@ -1149,6 +1150,7 @@ Page({ |
1149 | 1150 | // 获取幸运购参团情况 |
1150 | 1151 | async get_team_info () { |
1151 | 1152 | var th = this; |
1153 | + // wx.removeStorageSync('team_id'); | |
1152 | 1154 | // 幸运购成团信息 |
1153 | 1155 | await getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { |
1154 | 1156 | data: { |
... | ... | @@ -1166,7 +1168,10 @@ Page({ |
1166 | 1168 | if(th.data.param.from == 1) { |
1167 | 1169 | team_id = th.data.team_id; |
1168 | 1170 | } else { |
1169 | - team_id = luckyGoInfo.team_id; | |
1171 | + // team_id = luckyGoInfo.team_id; | |
1172 | + if(luckyGoInfo.team_id == 0) { | |
1173 | + team_id = wx.getStorageSync('team_id'); | |
1174 | + } | |
1170 | 1175 | }; |
1171 | 1176 | |
1172 | 1177 | th.setData({ |
... | ... | @@ -1179,20 +1184,20 @@ Page({ |
1179 | 1184 | //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 |
1180 | 1185 | //如果从会员中心的幸运购列表邀请好友点击进来,不执行storage操作 |
1181 | 1186 | if(th.data.param.from == 1) return false; |
1182 | - if(team_id != 0) { | |
1183 | - wx.setStorage({ | |
1184 | - key: 'team_id', | |
1185 | - data: team_id, | |
1186 | - }); | |
1187 | - console.log('存储team_id', team_id); | |
1188 | - } else { | |
1189 | - let team_id2 = wx.getStorageSync('team_id'); | |
1190 | - console.log('获取team_id', team_id2); | |
1191 | - th.setData({ | |
1192 | - team_id: team_id2, | |
1193 | - // isSuccess: true, | |
1194 | - }); | |
1195 | - }; | |
1187 | + // if(team_id > 0) { | |
1188 | + // wx.setStorage({ | |
1189 | + // key: 'team_id', | |
1190 | + // data: team_id, | |
1191 | + // }); | |
1192 | + // console.log('存储team_id', team_id); | |
1193 | + // } else { | |
1194 | + // let team_id2 = wx.getStorageSync('team_id'); | |
1195 | + // console.log('获取team_id', team_id2); | |
1196 | + // th.setData({ | |
1197 | + // team_id: team_id2, | |
1198 | + // // isSuccess: true, | |
1199 | + // }); | |
1200 | + // }; | |
1196 | 1201 | |
1197 | 1202 | // th.setData({ |
1198 | 1203 | // luckyGoInfo, |
... | ... | @@ -1211,7 +1216,7 @@ Page({ |
1211 | 1216 | } |
1212 | 1217 | }).then(res => { |
1213 | 1218 | if(res.data.code == 0) { |
1214 | - console.log('当前参团成员', res, ); | |
1219 | + console.log('当前参团成员', res, self.data.team_id); | |
1215 | 1220 | let myId = getApp().globalData.userInfo.user_id; |
1216 | 1221 | let luckyGoMembers = res.data.data.pageData; |
1217 | 1222 | th.setData({ | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -1083,6 +1083,10 @@ Page({ |
1083 | 1083 | team_id: res.data.data.pageData[0].team_id, |
1084 | 1084 | luckGoMembers: [], |
1085 | 1085 | }); |
1086 | + wx.setStorage({ | |
1087 | + key: 'team_id', | |
1088 | + data: th.data.team_id, | |
1089 | + }); | |
1086 | 1090 | th.countDown(th.data.luckGoInfo.end_time, 0); |
1087 | 1091 | }; |
1088 | 1092 | ... | ... |