jufubao-mall 2.0.93 → 2.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -54,8 +54,11 @@
|
|
|
54
54
|
<view style="display:flex;align-items:center">
|
|
55
55
|
<!-- <xd-unit :price="prod.sale_price" :isOld="false" color="#333" :iconSize="0.3" :fontSize="32"/> -->
|
|
56
56
|
<CusPrice :isPlus="is_plus_site" :type="order" :showPrice="prod.show_prices"></CusPrice>
|
|
57
|
+
<view style="font-size: 28rpx;color:#999;margin-left: 16rpx;">{{prod['product_num'] ? 'x': ''}} {{prod['product_num']}}</view>
|
|
58
|
+
</view>
|
|
59
|
+
<view v-if="prod['paid_amount'] && prod['paid_amount'] > 0" class="coupon_paid">
|
|
60
|
+
实付: <xd-unit :price="prod['paid_amount']" :isOld="false" color="#333" :iconSize="0.3" :fontSize="32"/>
|
|
57
61
|
</view>
|
|
58
|
-
<view style="font-size: 28rpx;color:#999">{{prod['product_num'] ? 'x': ''}} {{prod['product_num']}}</view>
|
|
59
62
|
</view>
|
|
60
63
|
<view v-if="prod.error_message" :style="{color:priceTextColor,fontSize:'24rpx'}">{{prod.error_message}}</view>
|
|
61
64
|
<view v-else-if="showActivityPrice==='Y'&&prod.is_activity==='Y'"
|
|
@@ -1070,11 +1073,46 @@
|
|
|
1070
1073
|
if(!this.canUseCoupon) return;
|
|
1071
1074
|
this.showCouponChose = true;
|
|
1072
1075
|
},
|
|
1076
|
+
//选择完优惠券,需要在商品上展示实付款信息(商品价格-优惠券优惠价格)
|
|
1077
|
+
handleCouponChoseResult(data){
|
|
1078
|
+
//data.total_coupon_parts: [{"card_number":"10001000008865","part_id":"60031172_0_0","sale_amount":8000,"coupon_amount":5000,"coupon_split":"[{\"card_number\":\"10001000008865\",\"coupon_amount\":5000,\"coupon_point\":5000}]","coupon_point":5000}]
|
|
1079
|
+
if(!data || !this.shopList) return;
|
|
1080
|
+
// total_coupon_parts 为空字符串或空数组代表取消选择优惠券,清除已展示的实付金额
|
|
1081
|
+
if(!data.total_coupon_parts || data.total_coupon_parts.length === 0){
|
|
1082
|
+
this.shopList.forEach(shop => {
|
|
1083
|
+
if(!shop.product) return;
|
|
1084
|
+
shop.product.forEach(prod => {
|
|
1085
|
+
delete prod.paid_amount;
|
|
1086
|
+
});
|
|
1087
|
+
});
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
// 按 part_id 建立映射,快速查找
|
|
1091
|
+
const couponMap = {};
|
|
1092
|
+
data.total_coupon_parts.forEach(item => {
|
|
1093
|
+
couponMap[item.part_id] = item;
|
|
1094
|
+
});
|
|
1095
|
+
// 遍历 shopList 下每个商品的 product,匹配 part_id 计算实付金额
|
|
1096
|
+
this.shopList.forEach(shop => {
|
|
1097
|
+
if(!shop.product) return;
|
|
1098
|
+
shop.product.forEach(prod => {
|
|
1099
|
+
const partId = prod.part_id;
|
|
1100
|
+
const couponItem = couponMap[partId];
|
|
1101
|
+
if(couponItem) {
|
|
1102
|
+
// sale_price、coupon_point 均为分,实付金额 = 商品价格 x 数量 - 优惠券优惠价格
|
|
1103
|
+
prod.paid_amount = (prod.sale_price || 0) * (prod.product_num || 1) - (couponItem.coupon_point || 0);
|
|
1104
|
+
} else {
|
|
1105
|
+
prod.paid_amount = (prod.sale_price || 0) * (prod.product_num || 1);
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
});
|
|
1109
|
+
},
|
|
1073
1110
|
//only选择满减券结果
|
|
1074
1111
|
handleCouponChose(data){
|
|
1075
1112
|
console.log(data,'alalalal')
|
|
1076
1113
|
this.choseCoupon = data;
|
|
1077
1114
|
this.showCouponChose = false;
|
|
1115
|
+
this.handleCouponChoseResult(data);
|
|
1078
1116
|
//共同使用模式:优惠券 + 积分 + 钱包可叠加
|
|
1079
1117
|
//串行逻辑:先选积分 → 积分选完后检查 orderNeedPayPrice > 0 才选钱包
|
|
1080
1118
|
if(this.is_wallet_use_with_coupon === "Y"){
|
|
@@ -2036,6 +2074,12 @@
|
|
|
2036
2074
|
align-items: flex-end;
|
|
2037
2075
|
justify-content: space-between;
|
|
2038
2076
|
}
|
|
2077
|
+
.coupon_paid{
|
|
2078
|
+
font-size: 28rpx;
|
|
2079
|
+
color:#999;
|
|
2080
|
+
display:flex;
|
|
2081
|
+
align-items: center;
|
|
2082
|
+
}
|
|
2039
2083
|
}
|
|
2040
2084
|
.postage_tip{
|
|
2041
2085
|
color: rgb(229, 116, 112);
|