Commit 51b6a2bdd095a6a7f4d8c0381fdb260342587d7f
1 parent
35a7c3da
最后一步人头像
Showing
1 changed file
with
79 additions
and
52 deletions
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
@@ -1150,78 +1150,102 @@ Page({ | @@ -1150,78 +1150,102 @@ Page({ | ||
1150 | 1150 | ||
1151 | // 获取幸运购参团情况 | 1151 | // 获取幸运购参团情况 |
1152 | async get_team_info () { | 1152 | async get_team_info () { |
1153 | - var th = this; | 1153 | + var th = this; |
1154 | + var team_id; | ||
1155 | + var luckyGoInfo; | ||
1156 | + var user_id = getApp().globalData.user_id; | ||
1157 | + | ||
1158 | + // 邀请链接待完善 | ||
1159 | + | ||
1160 | + await getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { | ||
1161 | + data: { | ||
1162 | + store_id: o.stoid, | ||
1163 | + is_end: 0, | ||
1164 | + timetype: 1, | ||
1165 | + id: th.data.param.group_id, | ||
1166 | + } | ||
1167 | + }).then(res => { | ||
1168 | + if(res.data.code == 0) { | ||
1169 | + | ||
1170 | + luckyGoInfo = res.data.data.pageData[0]; | ||
1171 | + // if(th.data.param.from == 1) { | ||
1172 | + // team_id = luckyGoInfo.team_id; | ||
1173 | + // } | ||
1174 | + | ||
1175 | + | ||
1176 | + // else { | ||
1177 | + // team_id = luckyGoInfo.team_id; | ||
1178 | + | ||
1179 | + // // 待完善 | ||
1180 | + // if(luckyGoInfo.team_id == 0) { | ||
1181 | + // team_id = wx.getStorageSync('team_id'); | ||
1182 | + // }; | ||
1183 | + | ||
1184 | + // }; | ||
1185 | + | ||
1186 | + th.setData({ | ||
1187 | + luckyGoInfo, | ||
1188 | + }); | ||
1189 | + | ||
1190 | + //参团成功后,检查team_id | ||
1191 | + //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ | ||
1192 | + //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 | ||
1193 | + //如果从会员中心的幸运购列表邀请好友点击进来,不执行storage操作 | ||
1194 | + if(th.data.param.from == 1) return false; | ||
1195 | + // if(team_id > 0) { | ||
1196 | + // wx.setStorage({ | ||
1197 | + // key: 'team_id', | ||
1198 | + // data: team_id, | ||
1199 | + // }); | ||
1200 | + // console.log('存储team_id', team_id); | ||
1201 | + // } else { | ||
1202 | + // let team_id2 = wx.getStorageSync('team_id'); | ||
1203 | + // console.log('获取team_id', team_id2); | ||
1204 | + // th.setData({ | ||
1205 | + // team_id: team_id2, | ||
1206 | + // // isSuccess: true, | ||
1207 | + // }); | ||
1208 | + // }; | ||
1209 | + | ||
1210 | + // th.setData({ | ||
1211 | + // luckyGoInfo, | ||
1212 | + // team_id, | ||
1213 | + // }); | ||
1214 | + | ||
1215 | + }; | ||
1216 | + | ||
1217 | + }); | ||
1218 | + | ||
1219 | + | ||
1154 | // wx.removeStorageSync('team_id'); | 1220 | // wx.removeStorageSync('team_id'); |
1155 | // 幸运购成团信息 | 1221 | // 幸运购成团信息 |
1156 | - await getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { | 1222 | + await getApp().request.promiseGet("/api/weshop/prom/luckyOrder/getUserOrderLastInfo/" + o.stoid + "/" + user_id + "/" + th.data.param.group_id, { |
1157 | data: { | 1223 | data: { |
1158 | - store_id: o.stoid, | ||
1159 | - is_end: 0, | ||
1160 | - timetype: 1, | ||
1161 | - id: this.data.param.group_id, | ||
1162 | } | 1224 | } |
1163 | }).then(res => { | 1225 | }).then(res => { |
1226 | + | ||
1164 | if(res.data.code == 0) { | 1227 | if(res.data.code == 0) { |
1165 | - console.log('当前成团信息', res); | ||
1166 | - var luckyGoInfo = res.data.data.pageData[0]; | ||
1167 | - var team_id; | ||
1168 | - | ||
1169 | - if(th.data.param.from == 1) { | ||
1170 | - team_id = th.data.team_id; | ||
1171 | - } else { | ||
1172 | - team_id = luckyGoInfo.team_id; | ||
1173 | - if(luckyGoInfo.team_id == 0) { | ||
1174 | - team_id = wx.getStorageSync('team_id'); | ||
1175 | - }; | ||
1176 | - // else { | ||
1177 | - // team_id = luckyGoInfo.team_id; | ||
1178 | - // }; | ||
1179 | - // team_id = wx.getStorageSync('team_id'); | ||
1180 | - }; | 1228 | + |
1229 | + team_id = res.data.data.team_id; | ||
1181 | 1230 | ||
1182 | th.setData({ | 1231 | th.setData({ |
1183 | - luckyGoInfo, | ||
1184 | team_id, | 1232 | team_id, |
1185 | }); | 1233 | }); |
1186 | 1234 | ||
1187 | - //参团成功后,检查team_id | ||
1188 | - //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ | ||
1189 | - //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 | ||
1190 | - //如果从会员中心的幸运购列表邀请好友点击进来,不执行storage操作 | ||
1191 | - if(th.data.param.from == 1) return false; | ||
1192 | - // if(team_id > 0) { | ||
1193 | - // wx.setStorage({ | ||
1194 | - // key: 'team_id', | ||
1195 | - // data: team_id, | ||
1196 | - // }); | ||
1197 | - // console.log('存储team_id', team_id); | ||
1198 | - // } else { | ||
1199 | - // let team_id2 = wx.getStorageSync('team_id'); | ||
1200 | - // console.log('获取team_id', team_id2); | ||
1201 | - // th.setData({ | ||
1202 | - // team_id: team_id2, | ||
1203 | - // // isSuccess: true, | ||
1204 | - // }); | ||
1205 | - // }; | ||
1206 | - | ||
1207 | - // th.setData({ | ||
1208 | - // luckyGoInfo, | ||
1209 | - // team_id, | ||
1210 | - // }); | ||
1211 | - | ||
1212 | }; | 1235 | }; |
1213 | 1236 | ||
1214 | - }); | 1237 | + }); |
1238 | + | ||
1215 | 1239 | ||
1216 | // 幸运购成团成员 | 1240 | // 幸运购成团成员 |
1217 | await getApp().request.promiseGet("/api/weshop/prom/luckyOrder/page", { | 1241 | await getApp().request.promiseGet("/api/weshop/prom/luckyOrder/page", { |
1218 | data: { | 1242 | data: { |
1219 | store_id: o.stoid, | 1243 | store_id: o.stoid, |
1220 | - team_id: this.data.team_id, | 1244 | + team_id: team_id, |
1221 | } | 1245 | } |
1222 | }).then(res => { | 1246 | }).then(res => { |
1223 | if(res.data.code == 0) { | 1247 | if(res.data.code == 0) { |
1224 | - console.log('当前参团成员', res, self.data.team_id); | 1248 | + console.log('当前参团成员', res, team_id); |
1225 | let myId = getApp().globalData.userInfo.user_id; | 1249 | let myId = getApp().globalData.userInfo.user_id; |
1226 | let luckyGoMembers = res.data.data.pageData; | 1250 | let luckyGoMembers = res.data.data.pageData; |
1227 | th.setData({ | 1251 | th.setData({ |
@@ -1231,7 +1255,10 @@ Page({ | @@ -1231,7 +1255,10 @@ Page({ | ||
1231 | self.isMe(myId, luckyGoMembers); | 1255 | self.isMe(myId, luckyGoMembers); |
1232 | }; | 1256 | }; |
1233 | 1257 | ||
1234 | - }); | 1258 | + }); |
1259 | + | ||
1260 | + | ||
1261 | + | ||
1235 | 1262 | ||
1236 | }, | 1263 | }, |
1237 | 1264 |