diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index a8a3b1e..811eae6 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -334,8 +334,11 @@ Page({ //--------立即支付---------- async jumpToCart4(e) { - - var th=this; + + if(this.data.paying) return false; + this.setData({paying:1}); + + var th=this; if(this.data.optionIsGoup) wx.navigateTo({ url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true" @@ -353,6 +356,7 @@ Page({ title: '提示', content: '线下取价功能已经关闭或者过期!' }); + th.setData({paying:0}); return false; } @@ -385,9 +389,10 @@ Page({ var buyed_mum2=goodsbuynum+good.goods_num; if (buyed_mum2 > limit && limit > 0) { - var content=gg.goods_name+'购买数量超出商品限购,请取消订单'; - th.toast(content); - return false; + var content=gg.goods_name+'购买数量超出商品限购,请取消订单'; + th.toast(content); + th.setData({paying:0}); + return false; } //当是组合优惠的时候 if(good.prom_type==7){ @@ -421,7 +426,8 @@ Page({ if (!isok){ var content=gg.goods_name+'活动已经结束,请取消订单'; th.toast(content); - return false; + th.setData({paying:0}); + return false; } var url1 = "/api/weshop/prom/zhbuyGoods/page"; @@ -450,6 +456,7 @@ Page({ var content= good['goods_name']+"超出活动限购\n"; th.toast(content); + th.setData({paying:0}); return false; } } @@ -493,6 +500,7 @@ Page({ var content = good.goods_name + '未找到活动,请取消订单重新购买' th.toast(content); + th.setData({paying:0}); p_ok = 0; } }) @@ -522,7 +530,9 @@ Page({ }) } - if (!p_ok) return false; + if (!p_ok){ + th.setData({paying:0});return false; + } } //商品的普通购买 ,不要进行判断 @@ -530,7 +540,8 @@ Page({ if(gg.prom_type!=good.prom_type && gg.prom_type>0) { var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; th.toast(content); - return false; + th.setData({paying:0}); + return false; } }else{ if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4) @@ -581,9 +592,10 @@ Page({ var t_now=ut.gettimestamp(); if(prom.is_end==0 && prom.start_timet_now){ - var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; - th.toast(content); - return false; + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; + th.toast(content); + th.setData({paying:0}); + return false; } } }else{ @@ -602,7 +614,9 @@ Page({ } } }) - if(!t_ok) return false; + if(!t_ok) { + th.setData({paying:0});return false; + } } //-- 如果有参加线下取价 -- @@ -626,7 +640,8 @@ Page({ var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买22'; th.toast(content); - return false; + th.setData({paying:0}); + return false; } } @@ -637,17 +652,18 @@ Page({ ob=obj; }) if(ob.code==-1){ - var content=gg.goods_name+'门店库存不足,请取消订单'; th.toast(content); - return false; + th.setData({paying:0}); + return false; } }else{ if(good.goods_num>store_count){ - var content=gg.goods_name+'商品的库存不足,请取消订单'; - th.toast(content); + var content=gg.goods_name+'商品的库存不足,请取消订单'; + th.toast(content); + th.setData({paying:0}); return false; } @@ -703,41 +719,46 @@ Page({ var content=goodsinfo.goods_name+'商品的活动已经结束,请取消订单重新购买'; th.toast(content); + th.setData({paying:0}); return false; } buyed_mum2=promgoodsbuynum+good.goods_num; if (buyed_mum2 > prom.buy_limit && prom.buy_limit > 0) { - - var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单重新购买'; - th.toast(content); - return false; + var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单重新购买'; + th.toast(content); + th.setData({paying:0}); + return false; } //看一下会员的秒杀价格是不是发生了变化 if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){ var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; th.toast(content); + th.setData({paying:0}); return false; } //看一下会员的团购价格是不是发生了变化 if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){ - var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; - th.toast(content); + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; + th.toast(content); + th.setData({paying:0}); return false; } if(goodsinfo.prom_type==4){ if (good.goods_num > prom.limitqty-prom.buy_num) { - var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单'; - th.toast(content); - return false; + var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单'; + th.toast(content); + th.setData({paying:0}); + return false; } }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { if(order.add_time+5*60 支付尾款 - + diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index 33661b6..ea0e942 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -485,6 +485,9 @@ Page({ /*----------跳转支付-----------*/ async jumpToCart4(t) { + if(this.data.paying) return false; + this.setData({paying:1}); + var o_index = t.currentTarget.dataset.idx; var e = this.data.orderList[o_index]; var th = this; @@ -506,6 +509,7 @@ Page({ if (knum <= 0) { getApp().confirmBox("库存为0,支付失败"); + th.setData({paying:0}); return false; } @@ -520,6 +524,7 @@ Page({ title: '提示', content: '线下取价功能已经关闭或者过期!' }); + th.setData({paying:0}); return false; } @@ -553,6 +558,7 @@ Page({ if (buyed_mum2 > limit && limit > 0) { var content = gg.goods_name + '购买数量超出商品限购,请取消订单'; th.toast(content); + th.setData({paying:0}); return false; } //当是组合优惠的时候 @@ -587,6 +593,7 @@ Page({ if (!isok) { var content = gg.goods_name + '活动已经结束,请取消订单'; th.toast(content); + th.setData({paying:0}); return false; } @@ -613,6 +620,7 @@ Page({ if (good.goods_num + promgoodsbuynum > good['buyqty']) { var content = good['goods_name'] + "超出活动限购\n"; th.toast(content); + th.setData({paying:0}); return false; } } @@ -650,12 +658,14 @@ Page({ if(good.goods_num>presellList.presell_sumqty-presellList.buy_goodnum){ var content = good.goods_name + '购买数量超出商品库存,请取消订单'; th.toast(content); + th.setData({paying:0}); return false; } var buyed_mum3 = promgoodsbuynum + good.goods_num; if (buyed_mum3 > presellList.vip_butyqty && presellList.vip_butyqty > 0) { var content = good.goods_name + '购买数量超出商品限购,请取消订单'; th.toast(content); + th.setData({paying:0}); return false; } @@ -729,7 +739,10 @@ Page({ }) } - if (!p_ok) return false; + if (!p_ok){ + th.setData({paying:0}); + return false; + } } //商品的普通购买 ,不要进行判断 @@ -738,6 +751,7 @@ Page({ if (gg.prom_type != good.prom_type && gg.prom_type>0) { var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; th.toast(content); + th.setData({paying:0}); return false; } @@ -790,6 +804,7 @@ Page({ var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; th.toast(content); + th.setData({paying:0}); return false; } } @@ -808,7 +823,9 @@ Page({ } } }) - if (!t_ok) return false; + if (!t_ok){ + th.setData({paying:0}); return false; + } } //-- 如果有参加线下取价 -- if (good.offline_cut > 0) wlist += encodeURIComponent(gg.erpwareid) + ","; @@ -832,6 +849,7 @@ Page({ var content = gg.goods_name + '商品的价格发生了变化,请取消订单重新购买1' th.toast(content); + th.setData({paying:0}); return false; } } @@ -846,6 +864,7 @@ Page({ var content = gg.goods_name + '门店库存不足,请取消订单'; th.toast(content); + th.setData({paying:0}); return false; } @@ -854,6 +873,7 @@ Page({ var content = gg.goods_name + '商品的库存不足,请取消订单'; th.toast(content); + th.setData({paying:0}); return false; } @@ -905,6 +925,7 @@ Page({ if (prom.is_end == 1 && prom.end_time < now) { var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单' th.toast(content); + th.setData({paying:0}); return false; } @@ -913,6 +934,7 @@ Page({ var content = goodsinfo.goods_name + '购买数量超出商品活动限购,请取消订单' th.toast(content); + th.setData({paying:0}); return false; } @@ -920,6 +942,7 @@ Page({ if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){ var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; th.toast(content); + th.setData({paying:0}); return false; } @@ -927,6 +950,7 @@ Page({ if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){ var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; th.toast(content); + th.setData({paying:0}); return false; } @@ -935,12 +959,14 @@ Page({ var content = goodsinfo.goods_name + '购买数量超出商品活动库存,请取消订单' th.toast(content); + th.setData({paying:0}); return false; } } else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { if(order.add_time+5*60支付尾款 - 立即支付 + + 支付中 + 立即支付 +