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 73e19d9..793680d 100644
--- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
+++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
@@ -782,113 +782,122 @@ Page({
//-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
- if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type !=
+ if (th.data.user_addr != null && th.data.bn_exp_type == 0 && (th.data.kt_type !=
3 || th.data.bn_goods.is_normal == 1)) {
- var user_addr = th.data.user_addr;
- var req_d = {
- province: user_addr.province, city: user_addr.city, district: user_addr.district,
- wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid
- }
-
- //-- 判断包邮 --
- var back_data = null;
- if(!ord_prom || ord_prom.is_post_temp) {
- if (th.data.act.is_post_temp ) {
- await getApp().request.promisePost("/api/weshop/order/areaFreight", {
- is_json: 1, data: req_d
- }).then(rs => {
- if (rs.data.code == 0) back_data = rs.data.data;
- });
- }
- }
+ if(good.is_free_shipping){
+ var wl_txt = "formData.shipping_price";
+ th.setData({
+ [wl_txt]: 0,
+ })
- var gd_arr_list = [];
- gd_arr_list.push(good);
- var cut_good_weight = 0;
- for (let i in gd_arr_list) {
- let item = gd_arr_list[i];
+ }else{
- if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
+ var user_addr = th.data.user_addr;
+ var req_d = {
+ province: user_addr.province, city: user_addr.city, district: user_addr.district,
+ wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid
+ }
- if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
- if (goods_weight < 0) goods_weight = 0;
- goods_weight += item['weight'] * item['buynum'];
- cut_good_weight += item['weight'] * item['buynum'];
- }
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ //-- 判断包邮 --
+ var back_data = null;
+ if(!ord_prom || ord_prom.is_post_temp) {
+ if (th.data.act.is_post_temp ) {
+ await getApp().request.promisePost("/api/weshop/order/areaFreight", {
+ is_json: 1, data: req_d
+ }).then(rs => {
+ if (rs.data.code == 0) back_data = rs.data.data;
+ });
}
- continue;
}
- switch (item['exp_sum_type']) {
- case 1:
- //统一运费
- o_shipping_price += item['uniform_exp_sum'];
- break;
- case 2:
- if (goods_weight < 0) goods_weight = 0;
- //累积商品重量 每种商品的重量 * 数量
- goods_weight += item['weight'] * item['buynum'];
+ var gd_arr_list = [];
+ gd_arr_list.push(good);
+ var cut_good_weight = 0;
+ for (let i in gd_arr_list) {
+ let item = gd_arr_list[i];
- if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
+ if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
+
+ if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
+ if (goods_weight < 0) goods_weight = 0;
+ goods_weight += item['weight'] * item['buynum'];
cut_good_weight += item['weight'] * item['buynum'];
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
- }
}
- break;
- case 3:
- if (goods_piece < 0) goods_piece = 0;
- //累积商品数量
- goods_piece += item['buynum'];
- break;
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
+ continue;
+ }
+
+ switch (item['exp_sum_type']) {
+ case 1:
+ //统一运费
+ o_shipping_price += item['uniform_exp_sum'];
+ break;
+ case 2:
+ if (goods_weight < 0) goods_weight = 0;
+ //累积商品重量 每种商品的重量 * 数量
+ goods_weight += item['weight'] * item['buynum'];
+
+ if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
+ cut_good_weight += item['weight'] * item['buynum'];
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
+ }
+ break;
+ case 3:
+ if (goods_piece < 0) goods_piece = 0;
+ //累积商品数量
+ goods_piece += item['buynum'];
+ break;
+ }
}
- }
- //如果是正值的时候
- if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
- else out_of_weight = -back_data.weight_free * 1000;
-
- var code = th.data.wu_arr[th.data.index].code;
- var shipping_price = 0;
- // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
- // goods_piece, th.data.user_addr, back_data,rs);
-
- var w_data = {
- store_id: os.stoid, code: code,
- o_shipping_price: o_shipping_price,
- goods_weight: goods_weight,
- out_of_weight: out_of_weight, goods_piece: goods_piece,
- user_addr_province: th.data.user_addr.province,
- user_addr_city: th.data.user_addr.city,
- user_addr_district: th.data.user_addr.district,
- is_by_all: back_data && back_data.is_by_all ? 1 : 0,
- no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0,
- }
+ //如果是正值的时候
+ if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
+ else out_of_weight = -back_data.weight_free * 1000;
+
+ var code = th.data.wu_arr[th.data.index].code;
+ var shipping_price = 0;
+ // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
+ // goods_piece, th.data.user_addr, back_data,rs);
+
+ var w_data = {
+ store_id: os.stoid, code: code,
+ o_shipping_price: o_shipping_price,
+ goods_weight: goods_weight,
+ out_of_weight: out_of_weight, goods_piece: goods_piece,
+ user_addr_province: th.data.user_addr.province,
+ user_addr_city: th.data.user_addr.city,
+ user_addr_district: th.data.user_addr.district,
+ is_by_all: back_data && back_data.is_by_all ? 1 : 0,
+ no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0,
+ }
- var is_ok = 0;
- await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', { data: w_data, is_json: 1 }).then(res => {
- if (res.data.code == 0) {
- shipping_price = res.data.data; is_ok = 1;
+ var is_ok = 0;
+ await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', { data: w_data, is_json: 1 }).then(res => {
+ if (res.data.code == 0) {
+ shipping_price = res.data.data; is_ok = 1;
+ }
+ })
+ if (!is_ok) {
+ wx.hideLoading();
+ wx.showToast({
+ title: "计算物流错误", icon: 'none', duration: 2000
+ })
+ return false;
}
- })
- if (!is_ok) {
- wx.hideLoading();
- wx.showToast({
- title: "计算物流错误", icon: 'none', duration: 2000
+
+ shipping_price = parseFloat(shipping_price).toFixed(2);
+ var wl_txt = "formData.shipping_price";
+ th.setData({
+ [wl_txt]: shipping_price,
})
- return false;
}
- shipping_price = parseFloat(shipping_price).toFixed(2);
- var wl_txt = "formData.shipping_price";
- th.setData({
- [wl_txt]: shipping_price,
- })
-
} else if (th.data.bn_exp_type == 1) {
var wl_txt = "formData.shipping_price";
th.setData({
diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js
index 88ccb11..bd07a8e 100644
--- a/packageC/pages/presell/cart/cart2.js
+++ b/packageC/pages/presell/cart/cart2.js
@@ -703,9 +703,6 @@ Page({
allpice = good.offline_price * good.buynum;
}
-
-
-
var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
var out_of_weight = null; //超出多少重量
@@ -758,7 +755,7 @@ Page({
}
//-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
- if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1) {
+ if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1) {
//看是不是有调用过包邮券
if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) {
var condition = allpice - cut_price - quan_price;
@@ -791,118 +788,127 @@ Page({
}
var shipping_price =0;
- //-- 在没有使用包邮券的时候 --
- if(!quan_no || !th.data.using_quan[bn_pick].isby) {
-
- var gd_arr_list = [];
- gd_arr_list.push(good);
- if (th.data.buy_now_gift_goods) {
- gd_arr_list = [...gd_arr_list, ...th.data.buy_now_gift_goods];
- }
+ if(good.is_free_shipping == 0 ) {
+ //-- 在没有使用包邮券的时候 --
+ if (!quan_no || !th.data.using_quan[bn_pick].isby) {
+
+ var gd_arr_list = [];
+ gd_arr_list.push(good);
+ if (th.data.buy_now_gift_goods) {
+ gd_arr_list = [...gd_arr_list, ...th.data.buy_now_gift_goods];
+ }
- var user_addr=th.data.user_addr;
- var req_d = {
- province: user_addr.province, city: user_addr.city, district: user_addr.district,
- wuliu: parseFloat(parseFloat(allpice) - cut_price - quan_price).toFixed(2), store_id: os.stoid
- }
- var back_data = null;
-
- if(!ord_prom || ord_prom.is_post_temp) {
- if (th.data.act.is_post_temp){
- await getApp().request.promisePost("/api/weshop/order/areaFreight", {
- is_json: 1, data: req_d
- }).then(rs => {
- if (rs.data.code == 0) back_data = rs.data.data;
- });
+ var user_addr = th.data.user_addr;
+ var req_d = {
+ province: user_addr.province,
+ city: user_addr.city,
+ district: user_addr.district,
+ wuliu: parseFloat(parseFloat(allpice) - cut_price - quan_price).toFixed(2),
+ store_id: os.stoid
+ }
+ var back_data = null;
+
+ if (!ord_prom || ord_prom.is_post_temp) {
+ if (th.data.act.is_post_temp) {
+ await getApp().request.promisePost("/api/weshop/order/areaFreight", {
+ is_json: 1, data: req_d
+ }).then(rs => {
+ if (rs.data.code == 0) back_data = rs.data.data;
+ });
+ }
}
- }
- var cut_good_weight = 0;
- for (let i in gd_arr_list) {
- let item = gd_arr_list[i];
-
- if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
+ var cut_good_weight = 0;
+ for (let i in gd_arr_list) {
+ let item = gd_arr_list[i];
- if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
- if (goods_weight < 0) goods_weight = 0;
- cut_good_weight += item['weight'] * item['buynum'];
- goods_weight += item['weight'] * item['buynum'];
+ if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
+ if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
+ if (goods_weight < 0) goods_weight = 0;
+ cut_good_weight += item['weight'] * item['buynum'];
+ goods_weight += item['weight'] * item['buynum'];
+
+ }
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
+ continue;
}
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
- }
- continue;
- }
- switch (item['exp_sum_type']) {
- case 1:
- //统一运费
- o_shipping_price += item['uniform_exp_sum'];
- break;
- case 2:
- if (goods_weight < 0) goods_weight = 0;
- //累积商品重量 每种商品的重量 * 数量
- goods_weight += item['weight'] * item['buynum'];
-
- if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
- cut_good_weight += item['weight'] * item['buynum'];
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ switch (item['exp_sum_type']) {
+ case 1:
+ //统一运费
+ o_shipping_price += item['uniform_exp_sum'];
+ break;
+ case 2:
+ if (goods_weight < 0) goods_weight = 0;
+ //累积商品重量 每种商品的重量 * 数量
+ goods_weight += item['weight'] * item['buynum'];
+
+ if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
+ cut_good_weight += item['weight'] * item['buynum'];
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
}
- }
- break;
- case 3:
- if (goods_piece < 0) goods_piece = 0;
- //累积商品数量
- goods_piece += item['buynum'];
- break;
+ break;
+ case 3:
+ if (goods_piece < 0) goods_piece = 0;
+ //累积商品数量
+ goods_piece += item['buynum'];
+ break;
+ }
}
- }
-
- //如果是正值的时候
- if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
- else out_of_weight = -back_data.weight_free * 1000;
-
-
- var code = "";
- if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
-
- //--------------开始计算物流------------------
- var shipping_price =0;
- // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
- // goods_piece, th.data.user_addr, back_data, rs);
- var w_data={
- store_id:os.stoid, code:code,
- o_shipping_price:o_shipping_price,
- goods_weight:goods_weight,
- out_of_weight:out_of_weight,goods_piece:goods_piece,
- user_addr_province:th.data.user_addr.province,
- user_addr_city:th.data.user_addr.city,
- user_addr_district:th.data.user_addr.district,
- is_by_all:back_data && back_data.is_by_all?1:0,
- no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
- }
- var is_ok=0;
- await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
- if(res.data.code==0){
- shipping_price=res.data.data; is_ok=1;
+ //如果是正值的时候
+ if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
+ else out_of_weight = -back_data.weight_free * 1000;
+
+
+ var code = "";
+ if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
+
+ //--------------开始计算物流------------------
+ var shipping_price = 0;
+ // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
+ // goods_piece, th.data.user_addr, back_data, rs);
+ var w_data = {
+ store_id: os.stoid, code: code,
+ o_shipping_price: o_shipping_price,
+ goods_weight: goods_weight,
+ out_of_weight: out_of_weight, goods_piece: goods_piece,
+ user_addr_province: th.data.user_addr.province,
+ user_addr_city: th.data.user_addr.city,
+ user_addr_district: th.data.user_addr.district,
+ is_by_all: back_data && back_data.is_by_all ? 1 : 0,
+ no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0,
}
- })
- if(!is_ok){
- wx.hideLoading();
- wx.showToast({
- title: "计算物流错误", icon: 'none',duration: 2000
+
+ var is_ok = 0;
+ await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {
+ data: w_data,
+ is_json: 1
+ }).then(res => {
+ if (res.data.code == 0) {
+ shipping_price = res.data.data;
+ is_ok = 1;
+ }
})
- //th.setData({ show_submit:0 });
+ if (!is_ok) {
+ wx.hideLoading();
+ wx.showToast({
+ title: "计算物流错误", icon: 'none', duration: 2000
+ })
+ //th.setData({ show_submit:0 });
- return false;
- }
+ return false;
+ }
- if (shipping_price <= 0) {
- th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券
+ if (shipping_price <= 0) {
+ th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券
+ }
}
}
diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js
index 8149ad3..532e9bc 100644
--- a/packageE/pages/cart/cart2/cart2.js
+++ b/packageE/pages/cart/cart2/cart2.js
@@ -4833,7 +4833,8 @@ Page({
}
//判断有没有默认的物流地址值
- if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) {
+ if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics && !th.data.get_exp_ing) {
+ th.data.get_exp_ing=1;
var wu_arr = this.data.wu_arr;
if (wu_arr != null && wu_arr != "") {
for (var i = 0; i < wu_arr.length; i++) {
@@ -4872,7 +4873,8 @@ Page({
}
//判断有没有默认的物流地址值
- if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) {
+ if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics && !th.data.get_exp_ing) {
+ th.data.get_exp_ing=1;
var wu_arr = this.data.wu_arr;
if (wu_arr != null && wu_arr != "") {
for (var i = 0; i < wu_arr.length; i++) {
diff --git a/packageE/pages/cart/cart2_inte/cart2_inte.js b/packageE/pages/cart/cart2_inte/cart2_inte.js
index 683327e..0205213 100644
--- a/packageE/pages/cart/cart2_inte/cart2_inte.js
+++ b/packageE/pages/cart/cart2_inte/cart2_inte.js
@@ -199,11 +199,11 @@ Page({
if (th.data.is_b_now == 1) {
if (th.data.bn_goods) {
th.setData({ add_back: 1,same_ok:1 });
- th.calculatePrice2();
}
}
+ th.calculatePrice2();
} else {
- th.setData({ user_addr: ie,show_submit:0 });
+ th.setData({ user_addr: ie });
}
var going = 0;
@@ -679,122 +679,126 @@ Page({
}
}
-
-
//to.getwuliuprice(async function (rs) {
-
var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
var out_of_weight = null; //超出多少重量
//-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
- if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1 && !th.data.inv_is_post) {
-
- var user_addr=th.data.user_addr;
- var req_d = {
- province: user_addr.province, city: user_addr.city, district: user_addr.district,
- wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid
- }
- var back_data = null;
- //判断是不是包邮模板,bn_is_post_temp 和 订单优惠的包邮模板一起控制
- if (th.data.bn_is_post_temp && (!ord_prom || is_ord_prom_post)) {
- await getApp().request.promisePost("/api/weshop/order/areaFreight", {
- is_json: 1, data: req_d
- }).then(rs => {
- if (rs.data.code == 0) back_data = rs.data.data;
- });
- }
+ if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1 && !th.data.inv_is_post) {
+
+ if(good.is_free_shipping){
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: 0 })
+ }else{
+ var user_addr=th.data.user_addr;
+ var req_d = {
+ province: user_addr.province, city: user_addr.city, district: user_addr.district,
+ wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid
+ }
+ var back_data = null;
+ //判断是不是包邮模板,bn_is_post_temp 和 订单优惠的包邮模板一起控制
+ if (th.data.bn_is_post_temp && (!ord_prom || is_ord_prom_post)) {
+ await getApp().request.promisePost("/api/weshop/order/areaFreight", {
+ is_json: 1, data: req_d
+ }).then(rs => {
+ if (rs.data.code == 0) back_data = rs.data.data;
+ });
+ }
- var gd_arr_list = [];
- gd_arr_list.push(good);
- var cut_good_weight = 0;
- for (let i in gd_arr_list) {
- let item = gd_arr_list[i];
+ var gd_arr_list = [];
+ gd_arr_list.push(good);
+ var cut_good_weight = 0;
+ for (let i in gd_arr_list) {
+ let item = gd_arr_list[i];
- if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1) ) {
+ if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1) ) {
- if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
- if (goods_weight < 0) goods_weight = 0;
- goods_weight += item['weight'] * item['buynum'];
- cut_good_weight += item['weight'] * item['buynum'];
- }
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
+ if (goods_weight < 0) goods_weight = 0;
+ goods_weight += item['weight'] * item['buynum'];
+ cut_good_weight += item['weight'] * item['buynum'];
+ }
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
+ continue;
}
- continue;
- }
-
- switch (item['exp_sum_type']) {
- case 1:
- //统一运费
- o_shipping_price += item['uniform_exp_sum'];
- break;
- case 2:
- if (goods_weight < 0) goods_weight = 0;
- //累积商品重量 每种商品的重量 * 数量
- goods_weight += item['weight'] * item['buynum'];
- if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
- cut_good_weight += item['weight'] * item['buynum'];
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ switch (item['exp_sum_type']) {
+ case 1:
+ //统一运费
+ o_shipping_price += item['uniform_exp_sum'];
+ break;
+ case 2:
+ if (goods_weight < 0) goods_weight = 0;
+ //累积商品重量 每种商品的重量 * 数量
+ goods_weight += item['weight'] * item['buynum'];
+
+ if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
+ cut_good_weight += item['weight'] * item['buynum'];
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
}
- }
- break;
- case 3:
- if (goods_piece < 0) goods_piece = 0;
- //累积商品数量
- goods_piece += item['buynum'];
- break;
+ break;
+ case 3:
+ if (goods_piece < 0) goods_piece = 0;
+ //累积商品数量
+ goods_piece += item['buynum'];
+ break;
+ }
}
- }
- //如果是正值的时候
- if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
- else out_of_weight = -back_data.weight_free * 1000;
-
- var code = "";
- if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
- //--------------开始计算物流------------------
- var shipping_price=0;
- // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
- // goods_piece, th.data.user_addr, back_data, rs);
-
- var w_data={
- store_id:os.stoid, code:code,
- o_shipping_price:o_shipping_price,
- goods_weight:goods_weight,
- out_of_weight:out_of_weight,goods_piece:goods_piece,
- user_addr_province:th.data.user_addr.province,
- user_addr_city:th.data.user_addr.city,
- user_addr_district:th.data.user_addr.district,
- is_by_all:back_data && back_data.is_by_all?1:0,
- no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
- }
-
- var is_ok=0;
- await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
- if(res.data.code==0){
- shipping_price=res.data.data; is_ok=1;
+ //如果是正值的时候
+ if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
+ else out_of_weight = -back_data.weight_free * 1000;
+
+ var code = "";
+ if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
+ //--------------开始计算物流------------------
+ var shipping_price=0;
+ // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
+ // goods_piece, th.data.user_addr, back_data, rs);
+
+ var w_data={
+ store_id:os.stoid, code:code,
+ o_shipping_price:o_shipping_price,
+ goods_weight:goods_weight,
+ out_of_weight:out_of_weight,goods_piece:goods_piece,
+ user_addr_province:th.data.user_addr.province,
+ user_addr_city:th.data.user_addr.city,
+ user_addr_district:th.data.user_addr.district,
+ is_by_all:back_data && back_data.is_by_all?1:0,
+ no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
}
- })
- if(!is_ok){
- wx.hideLoading();
- wx.showToast({
- title: "计算物流错误", icon: 'none',duration: 2000
+ var is_ok=0;
+ await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
+ if(res.data.code==0){
+ shipping_price=res.data.data; is_ok=1;
+ }
})
- return false;
- }
+ if(!is_ok){
+ wx.hideLoading();
+ wx.showToast({
+ title: "计算物流错误", icon: 'none',duration: 2000
+ })
+
+ return false;
+ }
+
+ if (shipping_price <= 0) {
+ th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券
+ }
- if (shipping_price <= 0) {
- th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券
+ shipping_price = parseFloat(shipping_price).toFixed(2);
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: shipping_price, })
}
- shipping_price = parseFloat(shipping_price).toFixed(2);
- var wl_txt = "formData.shipping_price";
- th.setData({ [wl_txt]: shipping_price, })
+
} else if(th.data.bn_exp_type == 1 ) {
var wl_txt = "formData.shipping_price";
@@ -1462,7 +1466,8 @@ Page({
}
//判断有没有默认的物流地址值
- if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics) {
+ if (def_exp_code != "" && def_exp_code != null && def_exp_code != undefined && !th.data.is_default_logistics && !th.data.get_exp_ing) {
+ th.data.get_exp_ing=1;
var wu_arr = this.data.wu_arr;
if (wu_arr != null && wu_arr != "") {
for (var i = 0; i < wu_arr.length; i++) {
diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
index e70a4b3..f76fa56 100644
--- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
+++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
@@ -827,7 +827,7 @@ Page({
var th = this;
var nav_b = th.selectComponent("#nav_b"); //组件的id
nav_b.close_box();
- nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy");
+ nav_b.set_name("礼包", "/packageE/pages/user/monthgiftbag/monthgiftbag");
},
//--- 分享设置 --
diff --git a/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js b/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js
index c7e8fd9..ffeaf1c 100644
--- a/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js
+++ b/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js
@@ -635,7 +635,7 @@ Page({
var th = this;
var nav_b = th.selectComponent("#nav_b"); //组件的id
nav_b.close_box();
- nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy");
+ nav_b.set_name("礼包", "/packageE/pages/user/monthgiftbag/monthgiftbag");
},
//--- 分享设置 --
diff --git a/packageE/pages/user/monthgiftbag/monthgiftbag.wxml b/packageE/pages/user/monthgiftbag/monthgiftbag.wxml
index 708a8c4..1ea2a8a 100644
--- a/packageE/pages/user/monthgiftbag/monthgiftbag.wxml
+++ b/packageE/pages/user/monthgiftbag/monthgiftbag.wxml
@@ -108,7 +108,7 @@
当前暂无礼包
diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js
index cbc7a44..bb906d7 100644
--- a/pages/cart/cart2_pt/cart2_pt.js
+++ b/pages/cart/cart2_pt/cart2_pt.js
@@ -701,117 +701,121 @@ Page({
}
//-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
- if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) {
-
- var user_addr = th.data.user_addr;
- var req_d = {
- province: user_addr.province, city: user_addr.city, district: user_addr.district,
- wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid
- }
- var back_data = null;
-
- if(!ord_prom || ord_prom.is_post_temp) {
- if (th.data.bn_is_post_temp || th.data.bn_goods.is_normal == 1) {
- await getApp().request.promisePost("/api/weshop/order/areaFreight", {
- is_json: 1, data: req_d
- }).then(rs => {
- if (rs.data.code == 0) back_data = rs.data.data;
- });
- }
- }
-
- var gd_arr_list = [];
- gd_arr_list.push(good);
- var cut_good_weight = 0;
- for (let i in gd_arr_list) {
- let item = gd_arr_list[i];
+ if (th.data.user_addr != null && th.data.bn_exp_type == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) {
+
+ if(good.is_free_shipping){
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: 0 })
+ }else{
+ var user_addr = th.data.user_addr;
+ var req_d = {
+ province: user_addr.province, city: user_addr.city, district: user_addr.district,
+ wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid
+ }
+ var back_data = null;
+
+ if(!ord_prom || ord_prom.is_post_temp) {
+ if (th.data.bn_is_post_temp || th.data.bn_goods.is_normal == 1) {
+ await getApp().request.promisePost("/api/weshop/order/areaFreight", {
+ is_json: 1, data: req_d
+ }).then(rs => {
+ if (rs.data.code == 0) back_data = rs.data.data;
+ });
+ }
+ }
- if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
+ var gd_arr_list = [];
+ gd_arr_list.push(good);
+ var cut_good_weight = 0;
+ for (let i in gd_arr_list) {
+ let item = gd_arr_list[i];
- if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
- if (goods_weight < 0) goods_weight = 0;
- cut_good_weight += item['weight'] * item['buynum'];
- goods_weight += item['weight'] * item['buynum'];
- }
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
- }
- continue;
- }
+ if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
- switch (item['exp_sum_type']) {
- case 1:
- //统一运费
- o_shipping_price += item['uniform_exp_sum'];
- break;
- case 2:
- if (goods_weight < 0) goods_weight = 0;
- //累积商品重量 每种商品的重量 * 数量
- goods_weight += item['weight'] * item['buynum'];
-
- if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
- cut_good_weight += item['weight'] * item['buynum'];
- if (back_data.weight_free > 0) {
- out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
- }
- }
- break;
- case 3:
- if (goods_piece < 0) goods_piece = 0;
- //累积商品数量
- goods_piece += item['buynum'];
- break;
- }
- }
+ if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) {
+ if (goods_weight < 0) goods_weight = 0;
+ cut_good_weight += item['weight'] * item['buynum'];
+ goods_weight += item['weight'] * item['buynum'];
+ }
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
+ continue;
+ }
- //如果是正值的时候
- if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
- else out_of_weight = -back_data.weight_free * 1000;
+ switch (item['exp_sum_type']) {
+ case 1:
+ //统一运费
+ o_shipping_price += item['uniform_exp_sum'];
+ break;
+ case 2:
+ if (goods_weight < 0) goods_weight = 0;
+ //累积商品重量 每种商品的重量 * 数量
+ goods_weight += item['weight'] * item['buynum'];
+
+ if (back_data && back_data.is_by_all && !back_data.no_free_goods) {
+ cut_good_weight += item['weight'] * item['buynum'];
+ if (back_data.weight_free > 0) {
+ out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
+ }
+ }
+ break;
+ case 3:
+ if (goods_piece < 0) goods_piece = 0;
+ //累积商品数量
+ goods_piece += item['buynum'];
+ break;
+ }
+ }
+ //如果是正值的时候
+ if (out_of_weight >= 0) out_of_weight = -cut_good_weight;
+ else out_of_weight = -back_data.weight_free * 1000;
- var code = th.data.wu_arr[th.data.index].code;
- //--------------开始计算物流------------------
- var shipping_price = 0;
- // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
- // goods_piece, th.data.user_addr, back_data, rs);
+ var code = th.data.wu_arr[th.data.index].code;
- var w_data = {
- store_id: os.stoid, code: code,
- o_shipping_price: o_shipping_price,
- goods_weight: goods_weight,
- out_of_weight: out_of_weight, goods_piece: goods_piece,
- user_addr_province: th.data.user_addr.province,
- user_addr_city: th.data.user_addr.city,
- user_addr_district: th.data.user_addr.district,
- is_by_all: back_data && back_data.is_by_all ? 1 : 0,
- no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0,
- }
+ //--------------开始计算物流------------------
+ var shipping_price = 0;
+ // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
+ // goods_piece, th.data.user_addr, back_data, rs);
- var is_ok = 0;
- await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {
- data: w_data,
- is_json: 1
- }).then(res => {
- if (res.data.code == 0) {
- shipping_price = res.data.data;
- is_ok = 1;
- }
- })
- if (!is_ok) {
- wx.hideLoading();
- wx.showToast({
- title: "计算物流错误", icon: 'none', duration: 2000
- })
- //th.setData({ show_submit:0 });
+ var w_data = {
+ store_id: os.stoid, code: code,
+ o_shipping_price: o_shipping_price,
+ goods_weight: goods_weight,
+ out_of_weight: out_of_weight, goods_piece: goods_piece,
+ user_addr_province: th.data.user_addr.province,
+ user_addr_city: th.data.user_addr.city,
+ user_addr_district: th.data.user_addr.district,
+ is_by_all: back_data && back_data.is_by_all ? 1 : 0,
+ no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0,
+ }
- return false;
- }
+ var is_ok = 0;
+ await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {
+ data: w_data,
+ is_json: 1
+ }).then(res => {
+ if (res.data.code == 0) {
+ shipping_price = res.data.data;
+ is_ok = 1;
+ }
+ })
+ if (!is_ok) {
+ wx.hideLoading();
+ wx.showToast({
+ title: "计算物流错误", icon: 'none', duration: 2000
+ })
+ //th.setData({ show_submit:0 });
- shipping_price = parseFloat(shipping_price).toFixed(2);
- var wl_txt = "formData.shipping_price";
- th.setData({ [wl_txt]: shipping_price, })
+ return false;
+ }
+ shipping_price = parseFloat(shipping_price).toFixed(2);
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: shipping_price, })
+ }
} else if (th.data.bn_exp_type == 1) {
var wl_txt = "formData.shipping_price";
th.setData({ [wl_txt]: 0, })