更新折扣优惠和代客下单
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<div class="right" v-if="!userPayWait">
|
||||
<div class="amount">
|
||||
<span class="t">扫码支付</span>
|
||||
<span class="n">{{ props.amount }}</span>
|
||||
<span class="n">{{ props.money }}</span>
|
||||
</div>
|
||||
<div class="input">
|
||||
<el-input ref="inputRef" v-model="scanCode" style="height: calc(var(--el-component-size-large) + 30px)"
|
||||
@@ -57,6 +57,7 @@ import icon from "@/assets/icon_scan.png";
|
||||
import { scanpay, queryOrder, quickPay, queryQuickPayStatus, accountPay, queryScanPay } from "@/api/pay";
|
||||
import { useUser } from "@/store/user.js";
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
import { formatDecimal } from '@/utils'
|
||||
const store = useUser();
|
||||
const global = useGlobal()
|
||||
import {
|
||||
@@ -88,6 +89,10 @@ const props = defineProps({
|
||||
payType: {
|
||||
type: [Number, String],
|
||||
default: "",
|
||||
},
|
||||
money: {
|
||||
type: [Number, String],
|
||||
default: 0,
|
||||
}
|
||||
});
|
||||
|
||||
@@ -112,6 +117,8 @@ async function submitHandle() {
|
||||
memberId: props.orderId,
|
||||
amount: props.amount,
|
||||
authCode: scanCode.value,
|
||||
payAmount: props.money < props.amount ? props.money : '',
|
||||
discountAmount: props.money < props.amount ? formatDecimal(props.amount - props.money) : ''
|
||||
});
|
||||
} else {
|
||||
if (props.fast) {
|
||||
@@ -125,13 +132,17 @@ async function submitHandle() {
|
||||
await scanpay({
|
||||
orderId: props.orderId,
|
||||
authCode: scanCode.value,
|
||||
payAmount: props.money < props.amount ? props.money : '',
|
||||
discountAmount: props.money < props.amount ? formatDecimal(props.amount - props.money) : ''
|
||||
});
|
||||
}
|
||||
if (props.payType == 'deposit') {
|
||||
await accountPay({
|
||||
orderId: props.orderId,
|
||||
memberId: '',
|
||||
memberAccount: scanCode.value
|
||||
memberAccount: scanCode.value,
|
||||
payAmount: props.money < props.amount ? props.money : '',
|
||||
discountAmount: props.money < props.amount ? formatDecimal(props.amount - props.money) : ''
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user