diff --git a/packageC/pages/presell/cart/cart2_pre.js b/packageC/pages/presell/cart/cart2_pre.js index 2570fec..65071be 100644 --- a/packageC/pages/presell/cart/cart2_pre.js +++ b/packageC/pages/presell/cart/cart2_pre.js @@ -4,7 +4,7 @@ var os = t.globalData.setting; var regeneratorRuntime = require('../../../../utils/runtime.js'); var util_pay = require("../../../../utils/pay.js"); const t_pay = require("../../../../utils/pay2.js"); - + Page({ data: { url: t.globalData.setting.url, @@ -523,6 +523,10 @@ Page({ if (this.data.bn_goods.yck_off == 2) { this.setData({ [txt]: 1 }) } else if (this.data.bn_goods.yck_off == 1) { + // let atxt10 = "formData.prestore"; //预存金额 + // this.setData({ + // [atxt10]:0 + // }) this.setData({ [txt]: 2 }) } this.calculatePrice2()//计算金额 @@ -745,7 +749,7 @@ Page({ var atxt = "formData.total_amount"; th.setData({ [atxt]: total_m, }) var order_m = total_m; - + //预存金额使用参与计算 if (th.data.udata && th.data.udata.Balance > 0 && order_m * 1 > 0) { if (!th.data.bn_goods.keyid) { @@ -793,7 +797,7 @@ Page({ good.pre_json = cart_yc.pre_json let yct1 = 'bn_goods.yck_off'; let yct2 = 'bn_goods.yck'; - let yct3 = 'bn_goods.yckid'; + let yct3 = 'bn_goods.yckid'; let yct4 = 'bn_goods.pre_json'; th.setData({ [yct1]: good.yck_off, @@ -826,6 +830,22 @@ Page({ // all_yck_arr.push(yck) //真实预存款抵扣金额 // all_pre_json.push(good.pre_json) // all_prestore = parseFloat(all_prestore); //真实预存款抵扣金额总和 + }else{ + let yct1 = 'bn_goods.yck_off'; + let yct2 = 'bn_goods.yck'; + let yct3 = 'bn_goods.yckid'; + let yct4 = 'bn_goods.pre_json'; + let atxt10 = "formData.prestore"; //预存金额 + let atxt11 = "formData.pre_json"; //预存json + let atxt12 = "formData.all_yck_arr"; //预存真实抵扣列表 + th.setData({ + [yct2]: 0, + [yct3]: '', + [yct4]: '', + [atxt10]: 0, + [atxt11]: '', + [atxt12]: [], + }) } } } else { @@ -845,13 +865,13 @@ Page({ [atxt12]: [], }) } - + var txt = "formData.user_money"; var txt2 = "formData.order_amount"; //--------------如果使用余额--------------------- if (th.data.bn_use_money == 1 && th.data.yuer > 0) { - if (parseFloat(th.data.yuer) > total_m) { - th.setData({ [txt]: total_m, [txt2]: 0 }) + if (parseFloat(th.data.yuer) > order_m) { + th.setData({ [txt]: order_m, [txt2]: 0 }) } else { order_m = parseFloat(order_m) - parseFloat(th.data.yuer); order_m = order_m.toFixed(2);