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,9 +27,6 @@ Page({ | ||
27 | }) | 27 | }) |
28 | var first_leader = t.first_leader; | 28 | var first_leader = t.first_leader; |
29 | var th = this; | 29 | var th = this; |
30 | - | ||
31 | - console.log("------------"); | ||
32 | - console.log(first_leader); | ||
33 | getApp().getConfig(); | 30 | getApp().getConfig(); |
34 | 31 | ||
35 | if (first_leader) { | 32 | if (first_leader) { |
@@ -68,13 +65,11 @@ Page({ | @@ -68,13 +65,11 @@ Page({ | ||
68 | }, | 65 | }, |
69 | 66 | ||
70 | onShow: function (t) { | 67 | onShow: function (t) { |
71 | - | ||
72 | this.data.is_timer = 1; | 68 | this.data.is_timer = 1; |
73 | this.data.currentPage = 1; | 69 | this.data.currentPage = 1; |
74 | this.data.ismore = 1; | 70 | this.data.ismore = 1; |
75 | var th = this; | 71 | var th = this; |
76 | var userInfo = wx.getStorageSync('userinfo'); | 72 | var userInfo = wx.getStorageSync('userinfo'); |
77 | - console.log(userInfo,30000); | ||
78 | if (userInfo && th.data.goodlist.length==0) { | 73 | if (userInfo && th.data.goodlist.length==0) { |
79 | //调用列表 | 74 | //调用列表 |
80 | this.requestSalelist(userInfo.user_id); | 75 | this.requestSalelist(userInfo.user_id); |
@@ -139,7 +134,7 @@ Page({ | @@ -139,7 +134,7 @@ Page({ | ||
139 | var e = this, | 134 | var e = this, |
140 | th = e, | 135 | th = e, |
141 | i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; | 136 | i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; |
142 | - var plist = null, | 137 | + var plist = [], |
143 | alllist = th.data.goodlist; | 138 | alllist = th.data.goodlist; |
144 | if (!alllist) alllist = []; | 139 | if (!alllist) alllist = []; |
145 | await getApp().request.promiseGet(i, { | 140 | await getApp().request.promiseGet(i, { |
pages/team/team_success/team_success.js
@@ -47,9 +47,8 @@ Page({ | @@ -47,9 +47,8 @@ Page({ | ||
47 | }, | 47 | }, |
48 | onLoad: function (t) { | 48 | onLoad: function (t) { |
49 | wx.setNavigationBarTitle({ title: "拼团订单",}) | 49 | wx.setNavigationBarTitle({ title: "拼团订单",}) |
50 | - | ||
51 | var that=this; | 50 | var that=this; |
52 | - var th=this; | 51 | + var th=this; |
53 | //获取用户设备信息,屏幕宽度 | 52 | //获取用户设备信息,屏幕宽度 |
54 | wx.getSystemInfo({ | 53 | wx.getSystemInfo({ |
55 | success: res => { | 54 | success: res => { |
@@ -183,13 +182,38 @@ Page({ | @@ -183,13 +182,38 @@ Page({ | ||
183 | //获取活动表的信息根据活动pt_prom_id | 182 | //获取活动表的信息根据活动pt_prom_id |
184 | await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { | 183 | await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { |
185 | data: { } | 184 | data: { } |
186 | - }).then(res => { | 185 | + }).then(async res => { |
186 | + var flag=null; | ||
187 | if (res.data.code==0){ | 187 | if (res.data.code==0){ |
188 | teamlist = res.data.data; | 188 | teamlist = res.data.data; |
189 | this.setData({teamlist: teamlist}); | 189 | this.setData({teamlist: teamlist}); |
190 | //获取当前时间,并且判断剩余时间 | 190 | //获取当前时间,并且判断剩余时间 |
191 | var nt = ut.gettimestamp(); | 191 | var nt = ut.gettimestamp(); |
192 | teamlist.status = 0; | 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 | if (nt >= teamlist.start_time) teamlist.status = 1; | 217 | if (nt >= teamlist.start_time) teamlist.status = 1; |
194 | 218 | ||
195 | goods_id = res.data.data.goods_id; | 219 | goods_id = res.data.data.goods_id; |
@@ -226,7 +250,6 @@ Page({ | @@ -226,7 +250,6 @@ Page({ | ||
226 | } | 250 | } |
227 | }) | 251 | }) |
228 | 252 | ||
229 | - | ||
230 | //只装5个 | 253 | //只装5个 |
231 | var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; | 254 | var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; |
232 | if(max_num){ | 255 | if(max_num){ |