优化订单退款

This commit is contained in:
gyq
2025-03-12 09:55:07 +08:00
parent 1e66b2ad1f
commit 48c9f24d4c
17 changed files with 191 additions and 16211 deletions

View File

@@ -82,7 +82,7 @@ const takeFoodCodeRef = ref(null);
const props = defineProps({
type: {
type: [String, Number],
default: 0, // 1快捷收银 2会员支付
default: 0, // 0 订单支付 1 会员充值 2 快捷收款
},
userInfo: {
type: Object,

View File

@@ -7,8 +7,8 @@
<span class="num">{{ money }}</span>
</div>
<div class="t2">
<span>原价{{ formatDecimal(props.amount - goodsStore.tableInfo.tableFee) }}</span>
<span style="margin-left: 20px">餐位费{{ formatDecimal(goodsStore.tableInfo.tableFee) }}</span>
<span>原价{{ formatDecimal(props.amount - (goodsStore.tableInfo.tableFee || 0)) }}</span>
<span style="margin-left: 20px">餐位费{{ formatDecimal(+goodsStore.tableInfo.tableFee || 0) }}</span>
<span style="margin-left: 20px">优惠{{ formatDecimal(props.amount - money) }}</span>
<span style="margin-left: 20px" v-if="discountRateVlaue" @click="cancelDiscount">
折扣{{ discountRateVlaue }}
@@ -404,8 +404,7 @@ async function payTypeChange(index, item) {
// 结算支付
async function confirmOrder() {
try {
payLoading.value = true;
if (payLoading.value) return
payData.value.checkOrderPay.orderAmount = formatDecimal(+money.value);
payData.value.checkOrderPay.roundAmount = roundAmount.value;
payData.value.checkOrderPay.vipPrice = goodsStore.vipUserInfo.userId ? 1 : 0;
@@ -414,8 +413,10 @@ async function confirmOrder() {
// await staffPermission("yun_xu_shou_kuan");
if (payActive.value == "buyer") {
showBuyerHandle();
return
} else if (payList.value[payActive.value].payType == "scanCode") {
scanModalRef.value.show();
return
} else {
// if (money.value < props.amount) return
payLoading.value = true;
@@ -424,21 +425,21 @@ async function confirmOrder() {
// 会员码支付
payLoading.value = false;
scanModalRef.value.show();
break;
return;
case "cash":
//现金
if (props.selecttype == 0) {
payLoading.loading = true
await cashPay(payData.value);
} else {
}
break;
break
case "vipPay":
// 会员支付
console.log("使用会员id支付");
payLoading.value = false;
showDialog.value = true;
return;
break;
default:
break;
}
@@ -677,7 +678,7 @@ const calcPointMoney = _.debounce(async function () {
// 当dialog打开时
function couponDialogOpen() {
couponForm.value.amount = formatDecimal(money.value - goodsStore.tableInfo.tableFee)
couponForm.value.amount = formatDecimal(money.value - (goodsStore.tableInfo.tableFee || 0))
couponForm.value.originAmount = couponForm.value.amount
resetCouponForm.value = { ...couponForm.value }
@@ -840,7 +841,7 @@ function discountConfirm() {
payData.value.checkOrderPay.orderAmount = couponForm.value.amount
// 优惠完之后加上餐位费
money.value = formatDecimal(+couponForm.value.amount + +goodsStore.tableInfo.tableFee)
money.value = formatDecimal(+couponForm.value.amount + +(goodsStore.tableInfo.tableFee || 0))
payData.value.checkOrderPay.fullCouponDiscountAmount = couponForm.value.fullCouponDiscountAmount

View File

@@ -116,13 +116,14 @@ const fastOrder = ref('')
// 提交扫码支付
async function submitHandle() {
console.log('props.selecttype===', props.selecttype);
try {
if (!scanCode.value) return;
loading.value = true;
if (props.selecttype == 0) {
// 下单扫码支付
if (props.payType == 'payType') {
if (props.payType == 'scanCode') {
await microPay({
...props.payData,
authCode: scanCode.value
@@ -157,7 +158,6 @@ async function submitHandle() {
} else if (props.selecttype == 2) {
}
emits('success')
}
if (props.payType == 'deposit') {
await accountPay({
@@ -170,10 +170,8 @@ async function submitHandle() {
}
}
}
loading.value = false;
scanCode.value = "";
ElMessage.success("支付成功");
dialogVisible.value = false;
emits("success");
} catch (error) {