diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 2aa8069..f6afe97 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -150,6 +150,8 @@ Page({ coll_prom:{}, //搭配活动存储 yh_is_xz_yh:{},//优惠促销优惠券使用开关 + same_ok:1, //同城配送的控制,默认ok + }, onLoad: function (t) { @@ -267,6 +269,9 @@ Page({ //先获取是否有关闭使用优惠券 getApp().getConfig2(function (ee) { var json_d = JSON.parse(ee.switch_list); + //测试强行写死,后面一定要删除 + json_d.pickupway=2; + th.data.json_d = json_d; th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 var is_default_logistics = json_d.is_default_logistics; @@ -1229,7 +1234,12 @@ Page({ return e.is_same_city != 1 || e.whsle_id > 0 }) if (!fd || fd.length == 0) { - arr[ik].show_same_city = 1; + arr[ik].show_same_city = 1; + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 2) { + arr[ik].exp_type=2; + th.setData({ is_all_zt: 0 }); + } + } } } @@ -1331,6 +1341,11 @@ Page({ et = 0; break; } + + if(th.data.show_same_city==1 && th.data.json_d.pickupway && th.data.json_d.pickupway == 2 ){ + et = 2; + } + var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; if (et == 0 && def_exp_code && !th.data.is_default_logistics) { @@ -2104,6 +2119,9 @@ Page({ }) //-- to.getwuliuprice(async function (rs) { -- + th.data.lon=0; + th.data.lat=0; + //是不是区域包邮 th.data.is_area_by = 0; //当不是区域不包邮的时候,没有不包邮商品的时候 @@ -2714,7 +2732,10 @@ Page({ } } }) - if (!is_next) return false + if (!is_next) { + th.setData({show_submit:1, submit: 0,same_ok:0 }) + return false + } } //预存金额使用参与计算 @@ -2938,6 +2959,10 @@ Page({ [atxt11]: all_pre_json, [atxt12]: all_yck_arr, }) + + th.data.lon=lon; + th.data.lat=lat; + th.data.order_prom_list_cart = c_arr; th.set_can_num(); wx.hideLoading(); @@ -3006,6 +3031,8 @@ Page({ var cut_price = 0; var allpice1 = allpice; + th.data.lon=0; + th.data.lat=0; if (good.prom_type == 3 && good.prom_price !== null) { cut_price = allpice - good.prom_price; @@ -3493,7 +3520,13 @@ Page({ } }) - if (!is_next) return false + if (!is_next){ + th.setData({show_submit:1,same_ok:0,submit: 0}) + return false + } + th.data.lon=lon; + th.data.lat=lat; + } @@ -3765,7 +3798,7 @@ Page({ var ff = true; //------------立即购买------------- if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) { - if (th.data.bn_exp_type == 0 && th.data.user_addr == null) { + if ( [0,2].indexOf(th.data.bn_exp_typ) == -1 && th.data.user_addr == null) { ff = false; getApp().my_warnning("请选择收货地址", 0, th); th.data.is_summit_ing = 0; @@ -3816,6 +3849,12 @@ Page({ item.use_commission = th.data.bn_goods.use_commission; } + if(th.data.lon && item.exp_type==2){ + item.lon=th.data.lon; + item.lat=th.data.lat; + } + + //获取立即购买的商品的信息 var gg = to.get_b_now(); //--商品的房间号-- @@ -3823,7 +3862,6 @@ Page({ item.room_ids = gg.room_id; } //群id - if(gg.groupchat_id && gg.groupchat_id!='undefined'){ item.groupchat_ids=gg.groupchat_id; } @@ -4117,6 +4155,11 @@ Page({ item.use_commission = t_item.can_usecommise; } + if(th.data.lon && item.exp_type==2){ + item.lon=th.data.lon; + item.lat=th.data.lat; + } + var order_prom_list = {}; //--判断有没有优惠活动-- if (t_item.order_prom_amount > 0) { @@ -6285,7 +6328,7 @@ Page({ setexptype2: function (e) { if(this.data.submit) return false; - this.setData({ submit: 1 }); + this.setData({ submit: 1,same_ok:1 }); if(this.data.all_collocation_list){ var bn_coll= this.selectComponent('#bn_coll'); @@ -6304,7 +6347,7 @@ Page({ setexptype_w2: function (e) { if(this.data.submit) return false; - this.setData({ submit: 1 }); + this.setData({ submit: 1,same_ok:1 }); for (let i = 0; i 应付金额:{{formData.order_amount}} - +