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/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 246b62e..abefaf6 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -2192,6 +2192,9 @@ Page({ //普通券的时候 if (quan_no && th.data.using_quan[pickid].isby != 1) { + + var IsUserWare=1; + //---获取优惠券优惠--- await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { data: { @@ -2205,11 +2208,33 @@ Page({ var q_data = res.data.data; //--存储商品优惠的内容-- cart_item.quan_youhui_list = q_data; - for (var k in q_data) - quan_price += q_data[k].WareCashSum; + for (var k in q_data){ + quan_price += q_data[k].WareCashSum; + IsUserWare=q_data[k].IsUserWare; + if(!IsUserWare){ + quan_price=0; + break; + } + + } + } }) + + if(!IsUserWare){ + + wx.showToast({ + title: '优惠券使用对象的订单金额未满足', + icon: 'none', + duration: 1000, + }); + th.setData({ submit: 0 }); + var txt='using_quan['+pickid+']'; + th.setData({[txt]:null}); + return false; + } + if(cart_item.quan_youhui_list){ for (var kk in cart_item.quan_youhui_list) { var you_item = cart_item.quan_youhui_list[kk]; @@ -5559,7 +5584,7 @@ Page({ th.data.ckeck_quan_price = good.offline_price; //如果有线下取价,就用线下价 } //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券-- - if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1) { + if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1 && th.data.check_quan_ware_list) { var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; var url = "/api/weshop/couponList/getUseCouponList"; app.request.promiseGet(url0, { 1: 1 }).then(res => { diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 57a46ac..c934760 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -614,7 +614,7 @@ - + diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index a818400..2216961 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -42,6 +42,7 @@ Page({ fil_brand_state:0, fil_price_state:0, limit_num:0, + gr_fir:0, //分组第一次 }, onLoad: function(t) { @@ -83,8 +84,8 @@ Page({ if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; } - if (0 != t.group_id && t.group_id != undefined) { url += "&group_id=" + t.group_id; } - if (0 != t.gid && t.gid != undefined) { url += "&group_id=" + t.gid; } + if (0 != t.group_id && t.group_id != undefined) { url += "&group_id=" + t.group_id; this.data.gr_fir=1; } + if (0 != t.gid && t.gid != undefined) { url += "&group_id=" + t.gid; this.data.gr_fir=1; } if (0 != t.max_price && t.max_price != undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price; } @@ -306,11 +307,14 @@ Page({ var user_id=getApp().globalData.user_id; if(!user_id) user_id=0; - //不是商品分组的,不是默认排序的 - // if(t.indexOf("group_id")==-1 ){ - t += "&orderField=" + e.data.tabname; - t += "&orderType=" + e.data.adname; - // } + + //不是商品分组的,不是默认排序的 + if (t.indexOf("group_id") == -1 || !this.data.gr_fir) { + t += "&orderField=" + e.data.tabname; + t += "&orderType=" + e.data.adname; + } + this.data.gr_fir=0; + t +="&page=" + e.data.currentPage; wx.showLoading({}); 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; diff --git a/pages/user/my_service/i_service.js b/pages/user/my_service/i_service.js index 54d868b..74d2102 100644 --- a/pages/user/my_service/i_service.js +++ b/pages/user/my_service/i_service.js @@ -164,8 +164,13 @@ Page({ var dd = d.getDate(); if (dd < 10) dd = "0" + dd; var fm = [d.getFullYear(), m, dd].join('-'); - if (isFull == 1) - fm = fm + ' ' + [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') + if (isFull == 1){ + var H=d.getHours();if(H<10) H="0"+H; + var I=d.getMinutes();if(I<10) I="0"+I; + var S=d.getSeconds();if(S<10) S="0"+S; + fm = fm + ' ' + [H, I, S].join(':') + } + return fm; }, //跳转到首页