Commit 5b1c7561d2b01d6806954bcd13266a638f1921ce

Authored by WXD-SEASON\season
2 parents 4ba89afd 77a7c728

Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa

packageC/pages/presell/cart/cart2_pre.js
@@ -4,7 +4,7 @@ var os = t.globalData.setting; @@ -4,7 +4,7 @@ var os = t.globalData.setting;
4 var regeneratorRuntime = require('../../../../utils/runtime.js'); 4 var regeneratorRuntime = require('../../../../utils/runtime.js');
5 var util_pay = require("../../../../utils/pay.js"); 5 var util_pay = require("../../../../utils/pay.js");
6 const t_pay = require("../../../../utils/pay2.js"); 6 const t_pay = require("../../../../utils/pay2.js");
7 - 7 +
8 Page({ 8 Page({
9 data: { 9 data: {
10 url: t.globalData.setting.url, 10 url: t.globalData.setting.url,
@@ -523,6 +523,10 @@ Page({ @@ -523,6 +523,10 @@ Page({
523 if (this.data.bn_goods.yck_off == 2) { 523 if (this.data.bn_goods.yck_off == 2) {
524 this.setData({ [txt]: 1 }) 524 this.setData({ [txt]: 1 })
525 } else if (this.data.bn_goods.yck_off == 1) { 525 } else if (this.data.bn_goods.yck_off == 1) {
  526 + // let atxt10 = "formData.prestore"; //预存金额
  527 + // this.setData({
  528 + // [atxt10]:0
  529 + // })
526 this.setData({ [txt]: 2 }) 530 this.setData({ [txt]: 2 })
527 } 531 }
528 this.calculatePrice2()//计算金额 532 this.calculatePrice2()//计算金额
@@ -745,7 +749,7 @@ Page({ @@ -745,7 +749,7 @@ Page({
745 var atxt = "formData.total_amount"; 749 var atxt = "formData.total_amount";
746 th.setData({ [atxt]: total_m, }) 750 th.setData({ [atxt]: total_m, })
747 var order_m = total_m; 751 var order_m = total_m;
748 - 752 +
749 //预存金额使用参与计算 753 //预存金额使用参与计算
750 if (th.data.udata && th.data.udata.Balance > 0 && order_m * 1 > 0) { 754 if (th.data.udata && th.data.udata.Balance > 0 && order_m * 1 > 0) {
751 if (!th.data.bn_goods.keyid) { 755 if (!th.data.bn_goods.keyid) {
@@ -793,7 +797,7 @@ Page({ @@ -793,7 +797,7 @@ Page({
793 good.pre_json = cart_yc.pre_json 797 good.pre_json = cart_yc.pre_json
794 let yct1 = 'bn_goods.yck_off'; 798 let yct1 = 'bn_goods.yck_off';
795 let yct2 = 'bn_goods.yck'; 799 let yct2 = 'bn_goods.yck';
796 - let yct3 = 'bn_goods.yckid'; 800 + let yct3 = 'bn_goods.yckid';
797 let yct4 = 'bn_goods.pre_json'; 801 let yct4 = 'bn_goods.pre_json';
798 th.setData({ 802 th.setData({
799 [yct1]: good.yck_off, 803 [yct1]: good.yck_off,
@@ -826,6 +830,22 @@ Page({ @@ -826,6 +830,22 @@ Page({
826 // all_yck_arr.push(yck) //真实预存款抵扣金额 830 // all_yck_arr.push(yck) //真实预存款抵扣金额
827 // all_pre_json.push(good.pre_json) 831 // all_pre_json.push(good.pre_json)
828 // all_prestore = parseFloat(all_prestore); //真实预存款抵扣金额总和 832 // all_prestore = parseFloat(all_prestore); //真实预存款抵扣金额总和
  833 + }else{
  834 + let yct1 = 'bn_goods.yck_off';
  835 + let yct2 = 'bn_goods.yck';
  836 + let yct3 = 'bn_goods.yckid';
  837 + let yct4 = 'bn_goods.pre_json';
  838 + let atxt10 = "formData.prestore"; //预存金额
  839 + let atxt11 = "formData.pre_json"; //预存json
  840 + let atxt12 = "formData.all_yck_arr"; //预存真实抵扣列表
  841 + th.setData({
  842 + [yct2]: 0,
  843 + [yct3]: '',
  844 + [yct4]: '',
  845 + [atxt10]: 0,
  846 + [atxt11]: '',
  847 + [atxt12]: [],
  848 + })
829 } 849 }
830 } 850 }
831 } else { 851 } else {
@@ -845,13 +865,13 @@ Page({ @@ -845,13 +865,13 @@ Page({
845 [atxt12]: [], 865 [atxt12]: [],
846 }) 866 })
847 } 867 }
848 - 868 +
849 var txt = "formData.user_money"; 869 var txt = "formData.user_money";
850 var txt2 = "formData.order_amount"; 870 var txt2 = "formData.order_amount";
851 //--------------如果使用余额--------------------- 871 //--------------如果使用余额---------------------
852 if (th.data.bn_use_money == 1 && th.data.yuer > 0) { 872 if (th.data.bn_use_money == 1 && th.data.yuer > 0) {
853 - if (parseFloat(th.data.yuer) > total_m) {  
854 - th.setData({ [txt]: total_m, [txt2]: 0 }) 873 + if (parseFloat(th.data.yuer) > order_m) {
  874 + th.setData({ [txt]: order_m, [txt2]: 0 })
855 } else { 875 } else {
856 order_m = parseFloat(order_m) - parseFloat(th.data.yuer); 876 order_m = parseFloat(order_m) - parseFloat(th.data.yuer);
857 order_m = order_m.toFixed(2); 877 order_m = order_m.toFixed(2);