优化会员支付,已会员价结算

This commit is contained in:
gyq
2025-03-19 18:29:46 +08:00
parent a101cc4fb7
commit 87e8976353
11 changed files with 177 additions and 70 deletions

View File

@@ -358,12 +358,23 @@ async function vipPayAjax(row) {
return
}
goodsStore.showVipPrice = 1
goodsStore.vipUserInfo = row
goodsStore.calcCartInfo()
reset()
payData.value.payType = 'userPay'
payData.value.shopUserId = row.id
payData.value.checkOrderPay.userId = row.userId
payLoading.value = true;
await vipPay(payData.value)
goodsStore.showVipPrice = 0
goodsStore.vipUserInfo = ''
emit("paySuccess");
} catch (error) {
console.log(error);
@@ -392,12 +403,12 @@ async function payTypeChange(index, item) {
// 挂账支付
showBuyerHandle();
}
if(item.payType == 'deposit'){
if (item.payType == 'deposit') {
scanModalRef.value.show();
}
// if (payActive.value != "buyer") {
// if (payList.value[payActive.value].payType == "deposit") {
// }
// }
} catch (error) {
@@ -820,7 +831,7 @@ function reset() {
orderId: goodsStore.orderListInfo.id,
vipPrice: store.shopInfo.isMemberPrice ? goodsStore.showVipPrice : 0, // 是否使用会员价
allPack: goodsStore.allSelected, // 是否整单打包
userId: goodsStore.vipUserInfo.id,
userId: goodsStore.vipUserInfo.userId,
seatNum: goodsStore.tableInfo.num, // 用餐人数
originAmount: formatDecimal(+goodsStore.cartInfo.totalAmount), // 订单原金额(包含打包费+餐位费) 不含折扣价格
discountRatio: '', // 折扣比例(计算时 向上取整保留 两位小数)