From 403172bd91433ee0bca4d8c97d248179ffecdd85 Mon Sep 17 00:00:00 2001 From: WXD-SEASON\season Date: Fri, 14 Apr 2023 17:42:24 +0800 Subject: [PATCH] 朋友圈打开场景处理首页和组合购首页 --- packageB/pages/zuhegou/index/index.js | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- pages/index/index/index.js | 8 +++++--- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js index 5febaef..acf0c50 100644 --- a/packageB/pages/zuhegou/index/index.js +++ b/packageB/pages/zuhegou/index/index.js @@ -191,11 +191,60 @@ Page({ */ onShow: function () { getApp().check_can_share(); + var th = this, + that = this, + ee = this; + + let scene = wx.getLaunchOptionsSync().scene; + //--判断是否是单页面-- + if (scene== 1154) { + var url = "/api/weshop/prom/zhbuy/getone/" + os.stoid + "/" + th.data.id; + getApp().request.get(url, { + success: function (e) { + th.data.is_get_act = 1; + if (e.data.code == 0 && e.data.data) { + self.setData({ + act: e.data.data + }); + if (e.data.data.is_show != 1) { + th.setData({ + error: '活动未开启' + }); + return false; + } + if (ut.gettimestamp() < e.data.data.start_time) { + th.setData({ + error: '活动还未开始' + }); + return false; + } + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { + //判断是否有限制购买次数 + if(e.data.data.buy_limit !=0){ + + } + //-- 获取商品列表 -- + self.get_list(); + self.countDown(); + } else { + th.setData({ + error: '活动已经过期' + }); + return false; + } + } else { + th.data.is_get_act = 0; + th.setData({ + error: e.data.msg + }); + return false; + } + } + }); + } getApp().is_Single_page(this, function () { - var th = this, - that = this, - ee = this; + this.data.is_timer = 1; if (this.data.act) this.countDown(); //如果有会员的时候 @@ -414,6 +463,9 @@ Page({ return false; } }) + + + }, //获取用户参与活动的次数 getUserBuyPromNum(){ diff --git a/pages/index/index/index.js b/pages/index/index/index.js index 3901fac..475e433 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -394,9 +394,11 @@ Page({ getApp().check_can_share(); - this.getTabBar().setData({ - cartGoodsNum: getApp().globalData.cartGoodsNum - }) + if (typeof this.getTabBar === 'function' && this.getTabBar()) { + this.getTabBar().setData({ + cartGoodsNum: getApp().globalData.cartGoodsNum + }) + } var th = this; //-- 登录回来判断弹框 -- var user_id = getApp().globalData.user_id; -- libgit2 0.21.4