Commit 298b7a25ab5713effbd12f7fee60961ba9c2e118
1 parent
f54b3e8f
拼单分享会员身份权限
Showing
2 changed files
with
28 additions
and
10 deletions
pages/activity/pind_list/pind_list.js
... | ... | @@ -27,9 +27,6 @@ Page({ |
27 | 27 | }) |
28 | 28 | var first_leader = t.first_leader; |
29 | 29 | var th = this; |
30 | - | |
31 | - console.log("------------"); | |
32 | - console.log(first_leader); | |
33 | 30 | getApp().getConfig(); |
34 | 31 | |
35 | 32 | if (first_leader) { |
... | ... | @@ -68,13 +65,11 @@ Page({ |
68 | 65 | }, |
69 | 66 | |
70 | 67 | onShow: function (t) { |
71 | - | |
72 | 68 | this.data.is_timer = 1; |
73 | 69 | this.data.currentPage = 1; |
74 | 70 | this.data.ismore = 1; |
75 | 71 | var th = this; |
76 | 72 | var userInfo = wx.getStorageSync('userinfo'); |
77 | - console.log(userInfo,30000); | |
78 | 73 | if (userInfo && th.data.goodlist.length==0) { |
79 | 74 | //调用列表 |
80 | 75 | this.requestSalelist(userInfo.user_id); |
... | ... | @@ -139,7 +134,7 @@ Page({ |
139 | 134 | var e = this, |
140 | 135 | th = e, |
141 | 136 | i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; |
142 | - var plist = null, | |
137 | + var plist = [], | |
143 | 138 | alllist = th.data.goodlist; |
144 | 139 | if (!alllist) alllist = []; |
145 | 140 | await getApp().request.promiseGet(i, { | ... | ... |
pages/team/team_success/team_success.js
... | ... | @@ -47,9 +47,8 @@ Page({ |
47 | 47 | }, |
48 | 48 | onLoad: function (t) { |
49 | 49 | wx.setNavigationBarTitle({ title: "拼团订单",}) |
50 | - | |
51 | 50 | var that=this; |
52 | - var th=this; | |
51 | + var th=this; | |
53 | 52 | //获取用户设备信息,屏幕宽度 |
54 | 53 | wx.getSystemInfo({ |
55 | 54 | success: res => { |
... | ... | @@ -183,13 +182,38 @@ Page({ |
183 | 182 | //获取活动表的信息根据活动pt_prom_id |
184 | 183 | await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { |
185 | 184 | data: { } |
186 | - }).then(res => { | |
185 | + }).then(async res => { | |
186 | + var flag=null; | |
187 | 187 | if (res.data.code==0){ |
188 | 188 | teamlist = res.data.data; |
189 | 189 | this.setData({teamlist: teamlist}); |
190 | 190 | //获取当前时间,并且判断剩余时间 |
191 | 191 | var nt = ut.gettimestamp(); |
192 | 192 | teamlist.status = 0; |
193 | + | |
194 | + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ | |
195 | + data:{ | |
196 | + store_id: os.stoid, | |
197 | + is_end: 0, | |
198 | + is_show: 1, | |
199 | + user_id: getApp().globalData.user_id, | |
200 | + pageSize:1000 | |
201 | + } | |
202 | + }).then(res=>{ | |
203 | + let pd_list=res.data.data.pageData; | |
204 | + if(res.data.code==0 && pd_list.length>0){ | |
205 | + flag =pd_list.some(pd=>{ | |
206 | + return pd.goods_id==teamlist['goods_id'] | |
207 | + }) | |
208 | + } | |
209 | + }) | |
210 | + if(!flag){ | |
211 | + wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000}); | |
212 | + setTimeout(function () { | |
213 | + ut.wx_back(); | |
214 | + }, 2000) | |
215 | + return false; | |
216 | + } | |
193 | 217 | if (nt >= teamlist.start_time) teamlist.status = 1; |
194 | 218 | |
195 | 219 | goods_id = res.data.data.goods_id; |
... | ... | @@ -226,7 +250,6 @@ Page({ |
226 | 250 | } |
227 | 251 | }) |
228 | 252 | |
229 | - | |
230 | 253 | //只装5个 |
231 | 254 | var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; |
232 | 255 | if(max_num){ | ... | ... |