From 4d8f40827fcb33e29f713eec63d93c66ad756937 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Tue, 23 May 2023 15:35:38 +0800 Subject: [PATCH] 同城配送的优化 --- packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js | 20 +++++++++++++++----- packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml | 2 +- packageC/pages/payForAnother/payForAnother.js | 4 ++-- packageC/pages/presell/cart/cart.js | 4 ++-- packageC/pages/presell/cart/cart2.js | 4 ++-- packageC/pages/presell/cart/cart2_pre.js | 2 +- packageE/pages/cart/cart2/cart2.js | 4 ++-- packageE/pages/cart/cart2_inte/cart2_inte.js | 4 ++-- pages/cart/cart2_pt/cart2_pt.js | 2 +- 9 files changed, 28 insertions(+), 18 deletions(-) diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js index b016765..cec5617 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -76,6 +76,8 @@ Page({ card_cut_price: null, //减价多少钱 is_pre_cut:0, //是否可以使用预存 0是不可以1的可以 act:null, //幸运购的活动 + + same_ok:1, //同城配送的控制,默认ok }, onLoad: function (t) { @@ -381,13 +383,13 @@ Page({ var gg = th.data.postdata; //调用商品 a.get("/api/weshop/goods/get/" + oo.stoid + "/" + gg.goods_id, { - success: function (t) { + success: async function (t) { var gd = t.data.data; if (!gd) return false; //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- if (gd.is_same_city && th.data.is_same_city && gd.whsle_id <= 0) { - getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + gg.pick_id, {}).then(res => { + await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + gg.pick_id, {}).then(res => { if (res.data.code == 0) { var pk = res.data.data; if (pk && pk.is_same_city) { @@ -445,6 +447,11 @@ Page({ break; } + if(th.data.show_same_city==1 && th.data.json_d.pickupway && th.data.json_d.pickupway == 2 ){ + et = 2; + } + + t.data.data.shop_price = gg.goods_price; //--如果是普通购买的时候-- if (gg.is_normal == 1) { @@ -615,7 +622,7 @@ Page({ }); if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { th.setData({ - add_back: 1 + add_back: 1,same_ok:1 }); if (this.data.bn_goods) th.calculatePrice2(); } @@ -933,7 +940,10 @@ Page({ }) } }) - if (!is_next) return false + if (!is_next){ + th.setData({is_show_sub:1,sub:0,same_ok:0 }) + return false + } th.data.lon=lon; th.data.lat=lat; @@ -1596,7 +1606,7 @@ Page({ var th = this; var ty = t.currentTarget.dataset.t; th.setData({ - bn_exp_type: ty + bn_exp_type: ty,same_ok:1 }); //当物流为空的时候。 if (ty == 0 && th.data.wu_arr == null) { diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml index 11dc720..f7c9a30 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml @@ -204,7 +204,7 @@ 应付金额:¥{{formData.order_amount}} - + diff --git a/packageC/pages/payForAnother/payForAnother.js b/packageC/pages/payForAnother/payForAnother.js index 02ccc3d..0391023 100644 --- a/packageC/pages/payForAnother/payForAnother.js +++ b/packageC/pages/payForAnother/payForAnother.js @@ -204,12 +204,12 @@ Page({ th.setData({user_addr: ie}); if (th.data.is_b_now == 1) { if (th.data.bn_goods) { - th.setData({add_back: 1}); + th.setData({add_back: 1,same_ok:1}); //th.calculatePrice2(); } } else { if (th.data.cartlist) { - th.setData({add_back: 1}); + th.setData({add_back: 1,same_ok:1}); //th.calculatePrice(); } } diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index ac6cd61..131e5fb 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -119,7 +119,7 @@ Page({ order_prom_amount:0, paying:0, - same_ok:1 + same_ok:1 //同城配送按钮控制 }, onLoad: function (t) { @@ -194,7 +194,7 @@ Page({ //更换地址回来要重新调用计算价钱的接口 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { th.setData({ user_addr: ie }); - th.setData({ add_back: 1 }); + th.setData({ add_back: 1,same_ok:1 }); th.calculatePrice2(); } else { th.setData({ user_addr: ie }); diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js index 8f2d83d..45e0bb8 100644 --- a/packageC/pages/presell/cart/cart2.js +++ b/packageC/pages/presell/cart/cart2.js @@ -129,7 +129,7 @@ Page({ dis_config:null, bn_use_commission:0, //是不是使用佣金 - same_ok:1 + same_ok:1 //同城配送按钮控制 }, onLoad: function (t) { @@ -206,7 +206,7 @@ Page({ th.setData({ user_addr: ie }); if (th.data.is_b_now == 1) { if (th.data.bn_goods) { - th.setData({ add_back: 1 }); + th.setData({ add_back: 1,same_ok:1 }); //th.calculatePrice2(); } } else { diff --git a/packageC/pages/presell/cart/cart2_pre.js b/packageC/pages/presell/cart/cart2_pre.js index 1dcef3f..76bf4b8 100644 --- a/packageC/pages/presell/cart/cart2_pre.js +++ b/packageC/pages/presell/cart/cart2_pre.js @@ -266,7 +266,7 @@ Page({ //更换地址回来要重新调用计算价钱的接口 th.setData({ user_addr: ie }); if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { - th.setData({ add_back: 1 }); + th.setData({ add_back: 1,same_ok: 1 }); if (th.data.bn_goods) th.calculatePrice2(); } }) diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 5818889..6737b83 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -243,12 +243,12 @@ Page({ th.setData({ user_addr: ie }); if (th.data.is_b_now == 1) { if (th.data.bn_goods) { - th.setData({ add_back: 1 }); + th.setData({ add_back: 1,same_ok:1 }); //th.calculatePrice2(); } } else { if (th.data.cartlist) { - th.setData({ add_back: 1 }); + th.setData({ add_back: 1,same_ok:1 }); //th.calculatePrice(); } } diff --git a/packageE/pages/cart/cart2_inte/cart2_inte.js b/packageE/pages/cart/cart2_inte/cart2_inte.js index 70c0dbc..203a426 100644 --- a/packageE/pages/cart/cart2_inte/cart2_inte.js +++ b/packageE/pages/cart/cart2_inte/cart2_inte.js @@ -198,7 +198,7 @@ Page({ th.setData({ user_addr: ie }); if (th.data.is_b_now == 1) { if (th.data.bn_goods) { - th.setData({ add_back: 1 }); + th.setData({ add_back: 1,same_ok:1 }); th.calculatePrice2(); } } @@ -996,7 +996,7 @@ Page({ } }) if(!is_next){ - th.setData({show_submit:1, submit: 0,same_ok:0 }) + th.setData({is_show_sub:1, submit: 0,same_ok:0 }) return false } diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 71cf5b0..22ed336 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -554,7 +554,7 @@ Page({ //更换地址回来要重新调用计算价钱的接口 th.setData({ user_addr: ie }); if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { - th.setData({ add_back: 1 }); + th.setData({ add_back: 1,same_ok:1 }); if (th.data.bn_goods) th.calculatePrice2(); } }) -- libgit2 0.21.4