From 298b7a25ab5713effbd12f7fee60961ba9c2e118 Mon Sep 17 00:00:00 2001 From: abson Date: Wed, 5 Jan 2022 16:21:54 +0800 Subject: [PATCH] 拼单分享会员身份权限 --- pages/activity/pind_list/pind_list.js | 7 +------ pages/team/team_success/team_success.js | 31 +++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js index 0eaca33..18c2377 100644 --- a/pages/activity/pind_list/pind_list.js +++ b/pages/activity/pind_list/pind_list.js @@ -27,9 +27,6 @@ Page({ }) var first_leader = t.first_leader; var th = this; - - console.log("------------"); - console.log(first_leader); getApp().getConfig(); if (first_leader) { @@ -68,13 +65,11 @@ Page({ }, onShow: function (t) { - this.data.is_timer = 1; this.data.currentPage = 1; this.data.ismore = 1; var th = this; var userInfo = wx.getStorageSync('userinfo'); - console.log(userInfo,30000); if (userInfo && th.data.goodlist.length==0) { //调用列表 this.requestSalelist(userInfo.user_id); @@ -139,7 +134,7 @@ Page({ var e = this, th = e, i = "/api/weshop/teamlist/pageteam/" + th.data.type + "?page=" + e.data.currentPage; - var plist = null, + var plist = [], alllist = th.data.goodlist; if (!alllist) alllist = []; await getApp().request.promiseGet(i, { diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index 744d2ce..a14f4ae 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -47,9 +47,8 @@ Page({ }, onLoad: function (t) { wx.setNavigationBarTitle({ title: "拼团订单",}) - var that=this; - var th=this; + var th=this; //获取用户设备信息,屏幕宽度 wx.getSystemInfo({ success: res => { @@ -183,13 +182,38 @@ Page({ //获取活动表的信息根据活动pt_prom_id await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { data: { } - }).then(res => { + }).then(async res => { + var flag=null; if (res.data.code==0){ teamlist = res.data.data; this.setData({teamlist: teamlist}); //获取当前时间,并且判断剩余时间 var nt = ut.gettimestamp(); teamlist.status = 0; + + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ + data:{ + store_id: os.stoid, + is_end: 0, + is_show: 1, + user_id: getApp().globalData.user_id, + pageSize:1000 + } + }).then(res=>{ + let pd_list=res.data.data.pageData; + if(res.data.code==0 && pd_list.length>0){ + flag =pd_list.some(pd=>{ + return pd.goods_id==teamlist['goods_id'] + }) + } + }) + if(!flag){ + wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000}); + setTimeout(function () { + ut.wx_back(); + }, 2000) + return false; + } if (nt >= teamlist.start_time) teamlist.status = 1; goods_id = res.data.data.goods_id; @@ -226,7 +250,6 @@ Page({ } }) - //只装5个 var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; if(max_num){ -- libgit2 0.21.4