Commit 1bcb40140c1cb4d96e11c4bdb030e7c3f87a1ee3

Authored by yvan.ni
1 parent 31ea14fa

幸运购 和 阶梯团尾款

packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
@@ -1246,8 +1246,9 @@ Page({ @@ -1246,8 +1246,9 @@ Page({
1246 if(item.exp_type==2){ 1246 if(item.exp_type==2){
1247 item.lon=th.data.lon?th.data.lon:0; 1247 item.lon=th.data.lon?th.data.lon:0;
1248 item.lat=th.data.lat?th.data.lat:0; 1248 item.lat=th.data.lat?th.data.lat:0;
1249 - item.goods_weight=t_item.gd_w;  
1250 - item.samecity_order_amount=t_item.samecity_order_amount; 1249 + item.goods_weight=th.data.bn_gd_w;
  1250 + item.samecity_order_amount= th.data.bn_samecity_order_amount;
  1251 +
1251 } 1252 }
1252 1253
1253 //--判断有没有优惠活动-- 1254 //--判断有没有优惠活动--
pages/cart/cart_wk/cart_wk.js
@@ -106,10 +106,10 @@ Page({ @@ -106,10 +106,10 @@ Page({
106 } 106 }
107 th.getuser_addr(function (addr) { 107 th.getuser_addr(function (addr) {
108 if (addr == null || addr == undefined || addr.length == 0) { 108 if (addr == null || addr == undefined || addr.length == 0) {
109 - th.setData({ user_addr: null, enterAddressPage: 1, }); 109 + th.setData({ user_addr: null, enterAddressPage: 1,same_ok:1 });
110 } else { 110 } else {
111 th.setData({ 111 th.setData({
112 - user_addr: addr, enterAddressPage: 0, 112 + user_addr: addr, enterAddressPage: 0,same_ok:1
113 }); 113 });
114 } 114 }
115 115
@@ -653,7 +653,7 @@ Page({ @@ -653,7 +653,7 @@ Page({
653 th.jumpPaymentPage(th.data.order.order_sn, allmoney); 653 th.jumpPaymentPage(th.data.order.order_sn, allmoney);
654 },function (){ 654 },function (){
655 th.data.paying=0; 655 th.data.paying=0;
656 - getApp().my_warnning("支付失败", 0, th); 656 + //getApp().my_warnning("支付失败", 0, th);
657 }) 657 })
658 658
659 //var n = t.data.data; 659 //var n = t.data.data;
@@ -976,6 +976,11 @@ Page({ @@ -976,6 +976,11 @@ Page({
976 var good = th.data.goods; 976 var good = th.data.goods;
977 good.buynum=th.data.order.order_goods['goods_num']; 977 good.buynum=th.data.order.order_goods['goods_num'];
978 978
  979 +
  980 + var ord_prom = this.data.ord_prom;
  981 + var order_prom_id=0;
  982 + var order_prom_amount=0;
  983 +
979 //--全部金额-- 984 //--全部金额--
980 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; 985 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money;
981 //-----------当地址不为空,且是物流时,计算物流费用---------- 986 //-----------当地址不为空,且是物流时,计算物流费用----------
@@ -1025,13 +1030,50 @@ Page({ @@ -1025,13 +1030,50 @@ Page({
1025 return false 1030 return false
1026 } 1031 }
1027 1032
1028 - th.data.lon=lon; 1033 + //-- 计算一下订单促销 --
  1034 + if (ord_prom) {
  1035 + order_prom_id = ord_prom['id'];
  1036 + switch (ord_prom['type']) {
  1037 + case 0:
  1038 + allpice = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
  1039 + order_prom_amount = (o_condition - allpice).toFixed(2);
  1040 + break;
  1041 + case 1:
  1042 + //-- 如果有优惠促销倍减的时候 --
  1043 + var bs = 1;
  1044 + if (ord_prom.is_bz) {
  1045 + bs = Math.floor(o_condition / ord_prom.money);
  1046 + }
  1047 + allpice = o_condition - bs * ord_prom['expression'];//满额优惠金额
  1048 + order_prom_amount = ord_prom['expression'];
  1049 + break;
  1050 + }
  1051 + }
  1052 +
  1053 + //--订单优惠的显示--
  1054 + var order_prom_txt1 = "formData.order_prom_id";
  1055 + var order_prom_txt2 = "formData.order_prom_amount";
  1056 + if (order_prom_id > 0) {
  1057 + th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount})
  1058 + } else {
  1059 + th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0})
  1060 + }
  1061 +
  1062 +
  1063 +
  1064 + th.data.lon=lon;
1029 th.data.lat=lat; 1065 th.data.lat=lat;
1030 th.data.bn_gd_w=gd_w; 1066 th.data.bn_gd_w=gd_w;
1031 th.data.bn_samecity_order_amount=req_data.order_amount; 1067 th.data.bn_samecity_order_amount=req_data.order_amount;
1032 1068
1033 var exp_price = parseFloat(shipping_price).toFixed(2); 1069 var exp_price = parseFloat(shipping_price).toFixed(2);
  1070 +
1034 allpice = parseFloat(exp_price) + parseFloat(allpice); 1071 allpice = parseFloat(exp_price) + parseFloat(allpice);
  1072 +
  1073 +
  1074 +
  1075 +
  1076 +
1035 if(th.data.bn_use_commission){ 1077 if(th.data.bn_use_commission){
1036 allpice-=th.data.goods.use_commission; 1078 allpice-=th.data.goods.use_commission;
1037 } 1079 }
@@ -1045,7 +1087,39 @@ Page({ @@ -1045,7 +1087,39 @@ Page({
1045 1087
1046 1088
1047 } else { 1089 } else {
1048 - var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; 1090 +
  1091 + var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money;
  1092 +
  1093 + //-- 计算一下订单促销 --
  1094 + if (ord_prom) {
  1095 + order_prom_id = ord_prom['id'];
  1096 + switch (ord_prom['type']) {
  1097 + case 0:
  1098 + allpice = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
  1099 + order_prom_amount = (o_condition - allpice).toFixed(2);
  1100 + break;
  1101 + case 1:
  1102 + //-- 如果有优惠促销倍减的时候 --
  1103 + var bs = 1;
  1104 + if (ord_prom.is_bz) {
  1105 + bs = Math.floor(o_condition / ord_prom.money);
  1106 + }
  1107 + allpice = o_condition - bs * ord_prom['expression'];//满额优惠金额
  1108 + order_prom_amount = ord_prom['expression'];
  1109 + break;
  1110 + }
  1111 + }
  1112 +
  1113 + //--订单优惠的显示--
  1114 + var order_prom_txt1 = "formData.order_prom_id";
  1115 + var order_prom_txt2 = "formData.order_prom_amount";
  1116 + if (order_prom_id > 0) {
  1117 + th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount})
  1118 + } else {
  1119 + th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0})
  1120 + }
  1121 +
  1122 +
1049 1123
1050 if(th.data.bn_use_commission){ 1124 if(th.data.bn_use_commission){
1051 allpice-=th.data.goods.use_commission; 1125 allpice-=th.data.goods.use_commission;