From c59d6a69d352ddab921216b81711f448ba2e31b8 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sat, 28 May 2022 15:08:46 +0800 Subject: [PATCH] 一件代发的bug优化 --- pages/cart/cart2/cart2.js | 4 +++- pages/cart/cart_wk/cart_wk.js | 6 +++--- pages/togoin/togoin.js | 12 ++++++++++-- pages/togoin/togoin.wxml | 2 +- utils/util.js | 4 ++-- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index e9a5ec1..6298018 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1331,10 +1331,11 @@ Page({ //如果有限制使用优惠券,就要减掉参与的活动商品的钱 if (!item_map.is_xz_yh) q_conditin = o_price; } - + //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表----------- for (var j = 0; j < ord_goods.length; j++) { if (ord_goods[j].is_gift) continue; + if (ord_goods[j].whsle_id) continue; if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) { ord_goods[j].is_xz_yh = ord_goods[j].is_xz_yh ? ord_goods[j].is_xz_yh : item_map.is_xz_yh; ord_goods[j].is_past = item_map.is_past; @@ -3096,6 +3097,7 @@ Page({ //如果只有代发商品的时候 if(df_goods.length>0 && item.order_goods.length<=0){ item.order_goods=df_goods; + item.is_whsle=1; } pdata.push(item); } diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 7748cdc..6534faa 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -297,7 +297,7 @@ Page({ } else { var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; allpice = allpice.toFixed(2); - th.setData({ exp_price: 0, allpice: allpice }) + th.setData({ exp_price: 0, allpice: allpice,submit:0 }) } }, @@ -354,7 +354,7 @@ Page({ //如果有再计算价格的过程中,不能提交订单 - if(submit){ return false} + if(this.data.submit){ return false} //--物流支付时要有地址-- if (this.data.exp_type == 0 && this.data.user_addr == null) { @@ -486,7 +486,7 @@ Page({ //----计算物流的钱---- async calculate_wuliu() { //让按钮变灰色 - th.setData({submit:1}); + this.setData({submit:1}); var to = getApp(), th = this; //to.getwuliuprice(async function (rs) { var o_shipping_price = 0, goods_weight = -1, goods_piece = -1, good = th.data.goods; diff --git a/pages/togoin/togoin.js b/pages/togoin/togoin.js index 7fa1335..1a0d100 100644 --- a/pages/togoin/togoin.js +++ b/pages/togoin/togoin.js @@ -11,6 +11,7 @@ Page({ store_logo:'', first_leader:'', //-- 邀请人 -- config2:null, + sub:0 }, onLoad: function (options) { if (wx.getUserProfile) { @@ -232,8 +233,13 @@ Page({ } }) - }else{ + + this.setData({sub:1}); + wx.showLoading({ + title:'处理中.', + mask:true + }) this.zu_ce(dd); //调用注册的函数 } @@ -256,9 +262,11 @@ Page({ }, failStatus: function (t) { - return app.my_warnning("授权登入失败,请稍后再试!", 0, that); + th.setData({sub:0}); + return app.my_warnning("授权登入失败,请稍后再试!", 0, th); }, fail: function (t) { + th.setData({sub:0}); return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1; } }); diff --git a/pages/togoin/togoin.wxml b/pages/togoin/togoin.wxml index 7ec704c..8f14586 100644 --- a/pages/togoin/togoin.wxml +++ b/pages/togoin/togoin.wxml @@ -68,7 +68,7 @@ 暂不授权 - + diff --git a/utils/util.js b/utils/util.js index 39c9180..142ce60 100644 --- a/utils/util.js +++ b/utils/util.js @@ -685,8 +685,8 @@ module.exports = { if (e.data.code == 0 && e.data.data ) { // 提示框 wx.showModal({ - title: '注册邀请', - content: e.data.data.vipname+'邀请你成为会员?', + title: '邀请登陆', + content: e.data.data.vipname+'邀请你登录成为会员?', success: function (res) { if (res.confirm) { getApp().goto("/pages/togoin/togoin"); -- libgit2 0.21.4