|
@@ -689,7 +689,7 @@ const showStoreList = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 计算订单价格
|
|
// 计算订单价格
|
|
|
-function computedPrice() {
|
|
|
|
|
|
|
+function computedPrice(couponTitleValue) {
|
|
|
let shippingTypeValue = shippingType.value;
|
|
let shippingTypeValue = shippingType.value;
|
|
|
postOrderComputed({
|
|
postOrderComputed({
|
|
|
mallType: orderInfoVo.value.mallType, // 商城类型
|
|
mallType: orderInfoVo.value.mallType, // 商城类型
|
|
@@ -701,6 +701,9 @@ function computedPrice() {
|
|
|
goldNum: appStore.userInfo.goldBalance, // 余料数量
|
|
goldNum: appStore.userInfo.goldBalance, // 余料数量
|
|
|
})
|
|
})
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
|
|
+ if (couponTitleValue) {
|
|
|
|
|
+ couponTitle.value = couponTitleValue;
|
|
|
|
|
+ }
|
|
|
// 成功回调
|
|
// 成功回调
|
|
|
let data = res.data; // 计算后的价格数据
|
|
let data = res.data; // 计算后的价格数据
|
|
|
// 更新订单费用信息
|
|
// 更新订单费用信息
|
|
@@ -787,11 +790,11 @@ const ChangCoupons = (e) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 更新优惠券相关状态
|
|
// 更新优惠券相关状态
|
|
|
- couponTitle.value = couponTitleValue;
|
|
|
|
|
|
|
+
|
|
|
couponId.value = couponIdValue;
|
|
couponId.value = couponIdValue;
|
|
|
coupon.value.coupon = false;
|
|
coupon.value.coupon = false;
|
|
|
// coupon.value.list = list;
|
|
// coupon.value.list = list;
|
|
|
- computedPrice();
|
|
|
|
|
|
|
+ computedPrice(couponTitleValue);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 首次进入页面时展示默认地址
|
|
// 首次进入页面时展示默认地址
|
|
@@ -1188,6 +1191,17 @@ const SubOrder = async (e) => {
|
|
|
showModal.value = true;
|
|
showModal.value = true;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 验证余料是否充足(普通商城且有余料余量时校验)
|
|
|
|
|
+ // else if (orderInfoVo.value.mallType === 0 && metalTypeMap[metalType.value].balance > 0) {
|
|
|
|
|
+ // const totalNeedWeight = cartInfo.value.reduce((sum, item) => {
|
|
|
|
|
+ // return sum + Number(item.weight || 0) * Number(item.payNum || item.cartNum || 1);
|
|
|
|
|
+ // }, 0);
|
|
|
|
|
+ // if (totalNeedWeight > metalTypeMap[metalType.value].balance) {
|
|
|
|
|
+ // return Toast({
|
|
|
|
|
+ // title: `${metalTypeMap[metalType.value].name}余料不足,当前可用 ${metalTypeMap[metalType.value].balance}g,订单需要 ${totalNeedWeight.toFixed(2)}g`,
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: "订单支付中",
|
|
title: "订单支付中",
|
|
|
});
|
|
});
|