diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js
index a3925bc..8cd20d8 100644
--- a/packageC/pages/presell/cart/cart.js
+++ b/packageC/pages/presell/cart/cart.js
@@ -648,7 +648,7 @@ Page({
},
- async calculatePrice2() {
+ async calculatePrice2() {
var th = this;
if (!this.data.pre_arr) return false;
th.setData({ show_submit: 0,disabled_btn:0})
@@ -1990,57 +1990,7 @@ Page({
//-----------当地址不为空,且是物流时,计算物流费用----------
if (th.data.user_addr != null) {
- //看是不是有调用过包邮券,如果活动可以使用优化券的情况下
-
-
- //--------------开始计算物流------------------
- var shipping_price =0;
- var lon=0;var lat=0;
- //-- 获取距离 --
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
- is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
- }).then(res=>{
- if(res.data.code==0){
- var data= JSON.parse(res.data.data);
- if(data.status==0){
- lon=data.result.location.lng;
- lat=data.result.location.lat;
- }
- }
- })
-
-
- var gd_w = good['weight'] * good['buynum'];
- //-- 获取距离 --
- var req_data = {
- store_id: os.stoid,
- order_amount: allpice,
- lon: lon, lat: lat,
- pickup_id: bn_pick,
- goods_weight: gd_w
- }
-
- var is_next=1;
- //获取同城配送参数
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
- is_json: 1,
- data: req_data
- }).then(res => {
- if (res.data.code == 0) {
- shipping_price= res.data.data;
- }else{
- is_next=0;
- wx.showToast({
- title: res.data.msg, icon: 'none', duration: 2000
- })
- }
- })
- if(!is_next){
- th.setData({show_submit:1,disabled_btn:1})
- return false
- }
- exp_price = parseFloat(shipping_price).toFixed(2);
- th.wuliu_next(allpice, quan_price, exp_price);
+ th.wuliu_next(allpice, quan_price, 0);
} else {
wx.showToast({
title: '请先选择收货地址', icon: 'none', duration: 2000
@@ -2060,7 +2010,7 @@ Page({
if (o_condition < 0) o_condition = 0;
//如果同意参与订单优惠
if (o_condition > 0 && this.data.pre_arr.is_useorderyh) {
- th.check_is_order_prom(o_condition, function (ord_price) {
+ th.check_is_order_prom(o_condition,async function (ord_price) {
var bn_pick = th.data.pickup.pickup_id
var order_prom_amount = 0;
var order_prom_id = 0;
@@ -2095,9 +2045,59 @@ Page({
th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
}
+ if(th.data.exp_type == 2) {
+ var good = th.data.goods;
+ //--------------开始计算物流------------------
+ var shipping_price = 0;
+ var lon = 0;
+ var lat = 0;
+ //-- 获取距离 --
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
+ is_json: 1, data: {address: th.data.user_addr.more_address + th.data.user_addr.address}
+ }).then(res => {
+ if (res.data.code == 0) {
+ var data = JSON.parse(res.data.data);
+ if (data.status == 0) {
+ lon = data.result.location.lng;
+ lat = data.result.location.lat;
+ }
+ }
+ })
+ var gd_w = good['weight'] * good['buynum'];
+ //-- 获取距离 --
+ var req_data = {
+ store_id: os.stoid,
+ order_amount: parseFloat(ord_price),
+ lon: lon, lat: lat,
+ pickup_id: bn_pick,
+ goods_weight: gd_w
+ }
+
+ var is_next = 1;
+ //获取同城配送参数
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
+ is_json: 1,
+ data: req_data
+ }).then(res => {
+ if (res.data.code == 0) {
+ shipping_price = res.data.data;
+ } else {
+ is_next = 0;
+ wx.showToast({
+ title: res.data.msg, icon: 'none', duration: 2000
+ })
+ }
+ })
+ if (!is_next) {
+ th.setData({show_submit: 1, disabled_btn: 1})
+ return false
+ }
+ exp_price = parseFloat(shipping_price).toFixed(2);
+ }
ord_price = parseFloat(ord_price) - parseFloat(th.data.presell.presell_deposit);
if (ord_price < 0) ord_price = 0;
+
th.setData({ exp_price: exp_price, order_m: ord_price + parseFloat(exp_price), show_submit: 1, })
})
diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js
index aa27f3f..35ef82c 100644
--- a/packageC/pages/presell/cart/cart2.js
+++ b/packageC/pages/presell/cart/cart2.js
@@ -826,56 +826,10 @@ Page({
//--看一下有没有订单优惠--
var o_condition = parseFloat(order_m);
- //判断是否同城配送,而且没有调用过
- if(th.data.bn_exp_type==2 && th.data.user_addr) {
-
- var lon=0;var lat=0;
- //-- 获取距离 --
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
- is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
- }).then(res=>{
- if(res.data.code==0){
- var data= JSON.parse(res.data.data);
- if(data.status==0){
- lon=data.result.location.lng;
- lat=data.result.location.lat;
- }
- }
- })
-
-
- var gd_w = good['weight'] * good['buynum'];
- //-- 获取距离 --
- var req_data = {
- store_id: os.stoid,
- order_amount: order_m,
- lon: lon, lat: lat,
- pickup_id: bn_pick,
- goods_weight: gd_w
- }
-
- var is_next=1;
- //获取同城配送参数
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
- is_json: 1,
- data: req_data
- }).then(res => {
- if (res.data.code == 0) {
- var wl_txt = "formData.shipping_price";
- th.setData({ [wl_txt]: res.data.data, })
- }else{
- is_next=0;
- wx.showToast({
- title: res.data.msg, icon: 'none', duration: 2000
- })
- }
- })
- if(!is_next) return false
- }
if (o_condition > 0 && th.data.act.is_useorderyh) {
- th.check_is_order_prom(o_condition, function () {
+ th.check_is_order_prom(o_condition, async function () {
var order_prom_amount = 0;
var order_prom_id = 0;
if (th.data.order_prom[th.data.bn_pick]) {
@@ -907,6 +861,55 @@ Page({
th.setData({ [order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount })
}
+ //判断是否同城配送,而且没有调用过
+ if(th.data.bn_exp_type==2 && th.data.user_addr) {
+
+ var lon=0;var lat=0;
+ //-- 获取距离 --
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
+ is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
+ }).then(res=>{
+ if(res.data.code==0){
+ var data= JSON.parse(res.data.data);
+ if(data.status==0){
+ lon=data.result.location.lng;
+ lat=data.result.location.lat;
+ }
+ }
+ })
+
+
+ var gd_w = good['weight'] * good['buynum'];
+ //-- 获取距离 --
+ var req_data = {
+ store_id: os.stoid,
+ order_amount: parseFloat(order_m),
+ lon: lon, lat: lat,
+ pickup_id: bn_pick,
+ goods_weight: gd_w
+ }
+
+ var is_next=1;
+ //获取同城配送参数
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
+ is_json: 1,
+ data: req_data
+ }).then(res => {
+ if (res.data.code == 0) {
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: res.data.data, })
+ }else{
+ is_next=0;
+ wx.showToast({
+ title: res.data.msg, icon: 'none', duration: 2000
+ })
+ }
+ })
+ if(!is_next) return false
+ }
+
+
+
total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
@@ -962,6 +965,52 @@ Page({
var order_prom_txt2 = "formData.order_prom_amount";
th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
+
+ //判断是否同城配送,而且没有调用过
+ if(th.data.bn_exp_type==2 && th.data.user_addr) {
+ var lon=0;var lat=0;
+ //-- 获取距离 --
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
+ is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
+ }).then(res=>{
+ if(res.data.code==0){
+ var data= JSON.parse(res.data.data);
+ if(data.status==0){
+ lon=data.result.location.lng;
+ lat=data.result.location.lat;
+ }
+ }
+ })
+
+ var gd_w = good['weight'] * good['buynum'];
+ //-- 获取距离 --
+ var req_data = {
+ store_id: os.stoid,
+ order_amount:parseFloat(order_m),
+ lon: lon, lat: lat,
+ pickup_id: bn_pick,
+ goods_weight: gd_w
+ }
+
+ var is_next=1;
+ //获取同城配送参数
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
+ is_json: 1,
+ data: req_data
+ }).then(res => {
+ if (res.data.code == 0) {
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: res.data.data, })
+ }else{
+ is_next=0;
+ wx.showToast({
+ title: res.data.msg, icon: 'none', duration: 2000
+ })
+ }
+ })
+ if(!is_next) return false
+ }
+
total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
var atxt = "formData.total_amount";
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index 1fe027b..a316a21 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -857,7 +857,7 @@ Page({
//-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 --
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){
@@ -1018,7 +1018,6 @@ Page({
if (gg.prom_type == 5) {
t.data.data.prom_id = gg.prom_id;
t.data.data.prom_type = 5;
- // console.log('xxxxxxxxxxxxxxxxxx', gg.is_coupon)
th.is_coupon = gg.is_coupon;
th.setData({
is_coupon: gg.is_coupon
@@ -1052,6 +1051,12 @@ Page({
if (dis_t > 0) {
distr_t = dis_t;
}
+
+ //-- 如果有一件代发的商品或者不是同城配送的配送 --
+ if(!narr[hi].show_same_city || narr[hi].whsle_id>0){
+ th.setData({show_same_city:0})
+ }
+
}
//自选的时候,系统配置了默认的配送方式是物流的时候
if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) {
@@ -1927,8 +1932,52 @@ Page({
t_o_condition=t_o_condition-whsle_goods_price;
}
- //-- 在选择到同城配送的时候 --
- if(c_arr[i].exp_type==2 && th.data.user_addr){
+
+
+ var order_m = 0;
+ //---判断是不是有订单优惠---
+ await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
+ data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
+ }).then(res => {
+ if (res.data.code == 0) {
+ var ord_prom = res.data.data;
+ //么有使用券,或者活动没有限制使用优惠券
+ if (quan_price <= 0 || !ord_prom.is_xz_yh) {
+ order_prom_id = ord_prom['id'];
+ switch (ord_prom['type']) {
+ case 0:
+ order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
+ order_prom_amount = (o_condition - order_m).toFixed(2);
+ break;
+ case 1:
+ //order_m = o_condition - ord_prom['expression'];//满额优惠金额
+ var bs=1;
+ if(ord_prom.is_bz){
+ bs=Math.floor(o_condition/ord_prom.money);
+ }
+ order_prom_amount = ord_prom['expression'];
+ break;
+ }
+ }
+ }
+ })
+
+ cart_item.order_prom_amount = 0;
+ //--订单优惠的显示--
+ if (order_prom_id > 0) {
+ cart_item.order_amount = (o_price - quan_price - order_prom_amount).toFixed(2);
+ cart_item.order_prom_id = order_prom_id;
+ cart_item.order_prom_amount = order_prom_amount;
+ }
+ coupon_price = quan_price;
+ if (cart_item.order_amount < 0) {
+ cart_item.order_amount = 0;
+ coupon_price = o_price;
+ }
+
+
+ //-- 在选择到同城配送的时候 --
+ if(c_arr[i].exp_type==2 && th.data.user_addr){
var gd_w=0;
for (let ib in c_arr[i].goods) {
@@ -1953,7 +2002,7 @@ Page({
var req_data={
- store_id:os.stoid, order_amount:t_o_condition,
+ store_id:os.stoid, order_amount: parseFloat(cart_item.order_amount),
lon:lon,lat:lat, pickup_id:c_arr[i].pickup_id, goods_weight:gd_w
}
var is_next=1;
@@ -1979,46 +2028,8 @@ Page({
}
- var order_m = 0;
- //---判断是不是有订单优惠---
- await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
- data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
- }).then(res => {
- if (res.data.code == 0) {
- var ord_prom = res.data.data;
- //么有使用券,或者活动没有限制使用优惠券
- if (quan_price <= 0 || !ord_prom.is_xz_yh) {
- order_prom_id = ord_prom['id'];
- switch (ord_prom['type']) {
- case 0:
- order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
- order_prom_amount = (o_condition - order_m).toFixed(2);
- break;
- case 1:
- //order_m = o_condition - ord_prom['expression'];//满额优惠金额
- var bs=1;
- if(ord_prom.is_bz){
- bs=Math.floor(o_condition/ord_prom.money);
- }
- order_prom_amount = ord_prom['expression'];
- break;
- }
- }
- }
- })
- cart_item.order_prom_amount = 0;
- //--订单优惠的显示--
- if (order_prom_id > 0) {
- cart_item.order_amount = (o_price - quan_price - order_prom_amount).toFixed(2);
- cart_item.order_prom_id = order_prom_id;
- cart_item.order_prom_amount = order_prom_amount;
- }
- coupon_price = quan_price;
- if (cart_item.order_amount < 0) {
- cart_item.order_amount = 0;
- coupon_price = o_price;
- }
+
cart_item.total_amount = parseFloat(cart_item.total_amount) + parseFloat(cart_item.shipping_price); //总金额
cart_item.order_amount = parseFloat(cart_item.order_amount) + parseFloat(cart_item.shipping_price); //总金额
@@ -2424,65 +2435,9 @@ Page({
var o_condition = parseFloat(order_m);
if(th.data.bn_goods.whsle_id>0){
o_condition=0;
- }else{
-
- //判断是否同城配送,而且没有调用过
- if(th.data.bn_exp_type==2 && th.data.user_addr) {
- var gd_w = 0, lon = 0, lat = 0;
- for (let ib in gd_arr_list) {
- let item_b = gd_arr_list[ib];
- gd_w += item_b['weight'] * item_b['buynum'];
- }
-
- //-- 获取距离 --
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
- is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
- }).then(res=>{
- if(res.data.code==0){
- var data= JSON.parse(res.data.data);
- if(data.status==0){
- lon=data.result.location.lng;
- lat=data.result.location.lat;
- }
- }
- })
-
- var req_data = {
- store_id: os.stoid, order_amount: o_condition,
- lon: lon, lat: lat, pickup_id: bn_pick,goods_weight: gd_w
- }
-
- var is_next=1;
-
- //获取同城配送参数
- await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
- is_json: 1,data: req_data
- }).then(res => {
- if (res.data.code == 0) {
- var wl_txt = "formData.shipping_price";
- th.setData({ [wl_txt]: res.data.data, })
-
- }else{
- is_next=0;
- if(qfunc){
- qfunc();
- }else{
- wx.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 2000
- })
- }
-
- }
- })
- if(!is_next) return false
- }
-
}
-
if (o_condition > 0) {
- th.check_is_order_prom(o_condition, function () {
+ th.check_is_order_prom(o_condition,async function () {
var order_prom_amount = 0;
var order_prom_id = 0;
if (th.data.order_prom[th.data.bn_pick] && th.data.order_prom[th.data.bn_pick]['money'] <= o_condition) {
@@ -2517,6 +2472,60 @@ Page({
th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
}
+ //判断是否同城配送,而且没有调用过
+ if(th.data.bn_exp_type==2 && th.data.user_addr) {
+ var gd_w = 0, lon = 0, lat = 0;
+ for (let ib in gd_arr_list) {
+ let item_b = gd_arr_list[ib];
+ gd_w += item_b['weight'] * item_b['buynum'];
+ }
+
+ //-- 获取距离 --
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
+ is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
+ }).then(res=>{
+ if(res.data.code==0){
+ var data= JSON.parse(res.data.data);
+ if(data.status==0){
+ lon=data.result.location.lng;
+ lat=data.result.location.lat;
+ }
+ }
+ })
+
+ var req_data = {
+ store_id: os.stoid, order_amount: o_condition,
+ lon: lon, lat: lat, pickup_id: bn_pick,goods_weight: gd_w
+ }
+
+ var is_next=1;
+
+ //获取同城配送参数
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
+ is_json: 1,data: req_data
+ }).then(res => {
+ if (res.data.code == 0) {
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: res.data.data, })
+
+ }else{
+ is_next=0;
+ if(qfunc){
+ qfunc();
+ }else{
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ }
+
+ }
+ })
+ if(!is_next) return false
+ }
+
+
total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
@@ -2583,6 +2592,59 @@ Page({
var order_prom_txt2 = "formData.order_prom_amount";
th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
+ //判断是否同城配送,而且没有调用过
+ if(th.data.bn_exp_type==2 && th.data.user_addr) {
+ var gd_w = 0, lon = 0, lat = 0;
+ for (let ib in gd_arr_list) {
+ let item_b = gd_arr_list[ib];
+ gd_w += item_b['weight'] * item_b['buynum'];
+ }
+
+ //-- 获取距离 --
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", {
+ is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address}
+ }).then(res=>{
+ if(res.data.code==0){
+ var data= JSON.parse(res.data.data);
+ if(data.status==0){
+ lon=data.result.location.lng;
+ lat=data.result.location.lat;
+ }
+ }
+ })
+
+ var req_data = {
+ store_id: os.stoid, order_amount: parseFloat(order_m),
+ lon: lon, lat: lat, pickup_id: bn_pick,goods_weight: gd_w
+ }
+
+ var is_next=1;
+
+ //获取同城配送参数
+ await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {
+ is_json: 1,data: req_data
+ }).then(res => {
+ if (res.data.code == 0) {
+ var wl_txt = "formData.shipping_price";
+ th.setData({ [wl_txt]: res.data.data, })
+
+ }else{
+ is_next=0;
+ if(qfunc){
+ qfunc();
+ }else{
+ wx.showToast({
+ title: res.data.msg,
+ icon: 'none',
+ duration: 2000
+ })
+ }
+
+ }
+ })
+ if(!is_next) return false
+ }
+
total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price);
@@ -2682,6 +2744,10 @@ Page({
//--------------------提交订单-----------------------
async submit_func() {
+
+ if(this.data.is_summit_ing) return false;
+ this.data.is_summit_ing = 1;
+
var th = this, pdata = new Array();
var ff = true;
//------------立即购买-------------
@@ -3281,6 +3347,7 @@ Page({
wx.showLoading({ title: "加载中" });
+ th.setData({ submit: 1,})
wx.request({
url: oo.url + '/api/weshop/order/createWxdOrder',
data: str,
@@ -3293,7 +3360,7 @@ Page({
if (res.statusCode == 200) {
var data = res.data;
if (data.code == 0) {
- console.log(th.data.is_b_now);
+ th.setData({ submit: 1,})
//如果是购物车结算,还要删除购物车
if (th.data.is_b_now == 0) {
console.log(th.data.cartlist_y);
@@ -3383,24 +3450,31 @@ Page({
}
})
return;
+ }else{
+ if (msg.length > 13) {
+ msg = msg.slice(0, 13) + "\r\n" + msg.slice(13);
+ }
+ getApp().confirmBox(msg);
+ th.data.is_summit_ing = 0; //是否提交中
+ th.setData({
+ submit: 0,
+ })
}
- if (msg.length > 13) {
- msg = msg.slice(0, 13) + "\r\n" + msg.slice(13);
- }
- getApp().confirmBox(msg);
- th.data.is_summit_ing = 0; //是否提交中
+
+
}
} else {
th.data.is_summit_ing = 0; //是否提交中
console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
+ th.setData({
+ submit: 0,
+ })
}
},
fail: function () {
th.data.is_summit_ing = 0;
wx.hideLoading();
console.log("index.js wx.request CheckCallUser fail");
- },
- complete: function () {
th.setData({
submit: 0,
})
@@ -3917,6 +3991,7 @@ Page({
var th = this;
+ var old_quan=null;
if (isby == 1) {
using_quan[pickid] = {
coupon_no: item.no,
@@ -3927,13 +4002,16 @@ Page({
};
using_quan[pickid].isby = 1;
} else {
+ if(using_quan[pickid]) old_quan=using_quan[pickid];
using_quan[pickid] = { coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0 };
using_quan[pickid].isby = 0;
}
this.setData({ using_quan: using_quan });
if (th.data.is_b_now == 1) {
th.calculatePrice2(function () {
- using_quan[pickid]=null;
+
+ if(old_quan) using_quan[pickid]=old_quan;
+ else using_quan[pickid]=null;
th.setData({ using_quan: using_quan,submit:0 });
wx.showToast({
title: "不能使用优惠券,同城起送价不足",
@@ -3944,7 +4022,8 @@ Page({
});
} else {
th.calculatePrice(function () {
- using_quan[pickid]=null;
+ if(old_quan) using_quan[pickid]=old_quan;
+ else using_quan[pickid]=null;
th.setData({ using_quan: using_quan ,submit:0 });
wx.showToast({
title: "不能使用优惠券,同城起送价不足",
@@ -4792,15 +4871,9 @@ Page({
tmplIds: [template_id],
success(res) {
func();
- th.setData({
- submit: 0,
- })
},
fail(res) {
func();
- th.setData({
- submit: 0,
- })
}
})
diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js
index 55eed5e..b9ae5a8 100644
--- a/pages/cart/cart2_inte/cart2_inte.js
+++ b/pages/cart/cart2_inte/cart2_inte.js
@@ -428,7 +428,7 @@ Page({
calculatePrice2:async function () {
var th = this, good = this.data.bn_goods;
- this.setData({show_submit:0})
+ this.setData({submit:1})
wx.showLoading({ title: "处理中.", mask:true })
//-----------计算商品总价--------------
var allpice = good.shop_price * good.buynum;
@@ -544,7 +544,6 @@ Page({
wx.showToast({
title: "计算物流错误", icon: 'none',duration: 2000
})
- th.setData({ show_submit:0 });
wx.hideLoading();
return false;
}
@@ -637,14 +636,14 @@ Page({
if (th.data.bn_use_money == 1) {
if (amoney > order_m) {
order_m = order_m.toFixed(2);
- th.setData({ [txt]: order_m, [txt2]: 0, [txt4]: all_integral, show_submit: 1 })
+ th.setData({ [txt]: order_m, [txt2]: 0, [txt4]: all_integral, show_submit: 1,submit:0 })
} else {
order_m = parseFloat(order_m - amoney);
order_m = order_m.toFixed(2);
- th.setData({ [txt]: amoney, [txt2]: order_m, [txt4]: all_integral, show_submit: 1 })
+ th.setData({ [txt]: amoney, [txt2]: order_m, [txt4]: all_integral, show_submit: 1,submit:0 })
}
} else {
- th.setData({ [txt]: 0, [txt2]: order_m, [txt4]: all_integral, show_submit: 1 })
+ th.setData({ [txt]: 0, [txt2]: order_m, [txt4]: all_integral, show_submit: 1,submit:0})
}
wx.hideLoading();
diff --git a/pages/cart/cart2_inte/cart2_inte.wxml b/pages/cart/cart2_inte/cart2_inte.wxml
index b9759b6..2c81f9a 100644
--- a/pages/cart/cart2_inte/cart2_inte.wxml
+++ b/pages/cart/cart2_inte/cart2_inte.wxml
@@ -165,7 +165,7 @@
应付金额:¥{{formData.order_amount}}
应付积分:{{formData.integral}}积分
-
+