Commit 598a85f7b9da7180dd75e1334faf04e1c98393c0
1 parent
eabd67f5
优化起订价优惠
Showing
4 changed files
with
34 additions
and
26 deletions
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml
@@ -226,7 +226,7 @@ | @@ -226,7 +226,7 @@ | ||
226 | <view class="payable"><text class="co-red fs24">{{sameCityExp_info}}</text></view> | 226 | <view class="payable"><text class="co-red fs24">{{sameCityExp_info}}</text></view> |
227 | <!-- <view class="co-red big"></view> --> | 227 | <!-- <view class="co-red big"></view> --> |
228 | </view> | 228 | </view> |
229 | - <button wx:if="{{sameCityExp_off==2}}" class="tips-btn" catchtap="qcd">去凑单</button> | 229 | + <!-- <button wx:if="{{sameCityExp_off==2}}" class="tips-btn" catchtap="qcd">去凑单</button> --> |
230 | </block> | 230 | </block> |
231 | <block wx:else> | 231 | <block wx:else> |
232 | <view class="pay-amount"> | 232 | <view class="pay-amount"> |
packageC/pages/presell/cart/cart.js
@@ -2612,10 +2612,14 @@ Page({ | @@ -2612,10 +2612,14 @@ Page({ | ||
2612 | } | 2612 | } |
2613 | }) | 2613 | }) |
2614 | var gd_w = good['weight'] * good['buynum']; | 2614 | var gd_w = good['weight'] * good['buynum']; |
2615 | + //这个不是取尾款而是取总金额 | ||
2616 | + let order_amount = parseFloat(o_condition); | ||
2617 | + // var o_condition1 = parseFloat(o_condition); | ||
2618 | + if (order_amount < 0) order_amount = 0; | ||
2615 | //-- 获取距离 -- | 2619 | //-- 获取距离 -- |
2616 | var req_data = { | 2620 | var req_data = { |
2617 | store_id: os.stoid, | 2621 | store_id: os.stoid, |
2618 | - order_amount: parseFloat(o_condition1), | 2622 | + order_amount: parseFloat(order_amount), |
2619 | lon: lon, lat: lat, | 2623 | lon: lon, lat: lat, |
2620 | pickup_id: bn_pick, | 2624 | pickup_id: bn_pick, |
2621 | goods_weight: gd_w, | 2625 | goods_weight: gd_w, |
packageC/pages/presell/cart/cart.wxml
@@ -396,7 +396,7 @@ | @@ -396,7 +396,7 @@ | ||
396 | </view> | 396 | </view> |
397 | </view> | 397 | </view> |
398 | <!-- <button wx:if="{{no_start || is_end || is_complete}}" class="tips-btn gray">支付尾款</button> --> | 398 | <!-- <button wx:if="{{no_start || is_end || is_complete}}" class="tips-btn gray">支付尾款</button> --> |
399 | - <button wx:if="{{sameCityExp_off==2}}" class="tips-btn" catchtap="qcd">去凑单</button> | 399 | + <!-- <button wx:if="{{sameCityExp_off==2}}" class="tips-btn" catchtap="qcd">去凑单</button> --> |
400 | </block> | 400 | </block> |
401 | <block wx:else> | 401 | <block wx:else> |
402 | <view class="pay-amount" hidden="{{disabled_btn}}"> | 402 | <view class="pay-amount" hidden="{{disabled_btn}}"> |
packageE/pages/cart/cart2_pt/cart2_pt.js
@@ -1078,6 +1078,31 @@ Page({ | @@ -1078,6 +1078,31 @@ Page({ | ||
1078 | th.setData({ [wl_txt]: 0, }) | 1078 | th.setData({ [wl_txt]: 0, }) |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | + | ||
1082 | + | ||
1083 | + //-- 如果是订单优惠的时候,allpice要拿来减掉一些 -- | ||
1084 | + var order_prom_id=0; | ||
1085 | + var order_prom_amount=0; | ||
1086 | + if(ord_prom){ | ||
1087 | + order_prom_id = ord_prom['id']; | ||
1088 | + switch (ord_prom['type']) { | ||
1089 | + case 0: | ||
1090 | + allpice = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1091 | + order_prom_amount = (o_condition - allpice).toFixed(2); | ||
1092 | + break; | ||
1093 | + case 1: | ||
1094 | + //-- 如果有优惠促销倍减的时候 -- | ||
1095 | + var bs = 1; | ||
1096 | + if (ord_prom.is_bz) { | ||
1097 | + bs = Math.floor(o_condition / ord_prom.money); | ||
1098 | + } | ||
1099 | + allpice = o_condition - bs * ord_prom['expression'];//满额优惠金额 | ||
1100 | + order_prom_amount = ord_prom['expression']; | ||
1101 | + break; | ||
1102 | + } | ||
1103 | + } | ||
1104 | + | ||
1105 | + | ||
1081 | //判断是否同城配送,而且没有调用过 | 1106 | //判断是否同城配送,而且没有调用过 |
1082 | if (th.data.bn_exp_type == 2 && th.data.user_addr) { | 1107 | if (th.data.bn_exp_type == 2 && th.data.user_addr) { |
1083 | var lon = 0; | 1108 | var lon = 0; |
@@ -1118,7 +1143,7 @@ Page({ | @@ -1118,7 +1143,7 @@ Page({ | ||
1118 | th.setData({ | 1143 | th.setData({ |
1119 | sameCityExp_off:0, | 1144 | sameCityExp_off:0, |
1120 | sameCityExp_info:'' | 1145 | sameCityExp_info:'' |
1121 | - }) | 1146 | + }) |
1122 | } else { | 1147 | } else { |
1123 | if (res.data.code==-2) { //未达到起送价 | 1148 | if (res.data.code==-2) { //未达到起送价 |
1124 | th.setData({ | 1149 | th.setData({ |
@@ -1131,7 +1156,7 @@ Page({ | @@ -1131,7 +1156,7 @@ Page({ | ||
1131 | sameCityExp_info:res.data.msg | 1156 | sameCityExp_info:res.data.msg |
1132 | }) | 1157 | }) |
1133 | } | 1158 | } |
1134 | - is_next = 0; | 1159 | + // is_next = 0; |
1135 | wx.showToast({ | 1160 | wx.showToast({ |
1136 | title: res.data.msg, icon: 'none', duration: 2000 | 1161 | title: res.data.msg, icon: 'none', duration: 2000 |
1137 | }) | 1162 | }) |
@@ -1150,27 +1175,6 @@ Page({ | @@ -1150,27 +1175,6 @@ Page({ | ||
1150 | 1175 | ||
1151 | } | 1176 | } |
1152 | 1177 | ||
1153 | - //-- 如果是订单优惠的时候,allpice要拿来减掉一些 -- | ||
1154 | - var order_prom_id=0; | ||
1155 | - var order_prom_amount=0; | ||
1156 | - if(ord_prom){ | ||
1157 | - order_prom_id = ord_prom['id']; | ||
1158 | - switch (ord_prom['type']) { | ||
1159 | - case 0: | ||
1160 | - allpice = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | ||
1161 | - order_prom_amount = (o_condition - allpice).toFixed(2); | ||
1162 | - break; | ||
1163 | - case 1: | ||
1164 | - //-- 如果有优惠促销倍减的时候 -- | ||
1165 | - var bs = 1; | ||
1166 | - if (ord_prom.is_bz) { | ||
1167 | - bs = Math.floor(o_condition / ord_prom.money); | ||
1168 | - } | ||
1169 | - allpice = o_condition - bs * ord_prom['expression'];//满额优惠金额 | ||
1170 | - order_prom_amount = ord_prom['expression']; | ||
1171 | - break; | ||
1172 | - } | ||
1173 | - } | ||
1174 | 1178 | ||
1175 | //--订单优惠的显示-- | 1179 | //--订单优惠的显示-- |
1176 | var order_prom_txt1 = "formData.order_prom_id"; | 1180 | var order_prom_txt1 = "formData.order_prom_id"; |