|
@@ -43,7 +43,7 @@
|
|
v-if="isWalletPay"
|
|
v-if="isWalletPay"
|
|
class="buttons" color="primary"
|
|
class="buttons" color="primary"
|
|
:loading="payLoading"
|
|
:loading="payLoading"
|
|
- @click="paySubmit"
|
|
|
|
|
|
+ @click="walletPaySubmit"
|
|
>
|
|
>
|
|
<!-- {{ isWalletPay ? '确认' : '支付完成' }} -->
|
|
<!-- {{ isWalletPay ? '确认' : '支付完成' }} -->
|
|
确认
|
|
确认
|
|
@@ -87,6 +87,20 @@ const props = defineProps({
|
|
})
|
|
})
|
|
const loading = ref(true)
|
|
const loading = ref(true)
|
|
|
|
|
|
|
|
+const balance = JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0
|
|
|
|
+const balanceNotEnough = computed(() => {
|
|
|
|
+ return (Number(props.cost) > Number(balance))
|
|
|
|
+})
|
|
|
|
+// 支付方式
|
|
|
|
+const isWalletPay = ref(true)
|
|
|
|
+const isQrCodePay = ref(false)
|
|
|
|
+const payTypeChange = (val) => {
|
|
|
|
+ payType.value = val
|
|
|
|
+ isQrCodePay.value = qrCodePay.includes(payType.value)
|
|
|
|
+ isWalletPay.value = walletPay.includes(payType.value)
|
|
|
|
+ if (isQrCodePay.value) initPayQrCode() // 生成二维码内容
|
|
|
|
+ emit('payTypeChange', val, balanceNotEnough)
|
|
|
|
+}
|
|
// 支付方式
|
|
// 支付方式
|
|
const payType = ref('')
|
|
const payType = ref('')
|
|
const payTypeList = ref([])
|
|
const payTypeList = ref([])
|
|
@@ -127,7 +141,6 @@ const getUnpaidOrderList = async () => {
|
|
try {
|
|
try {
|
|
const data = await getUnpaidOrder({ spuId: props.spuId, type: props.type })
|
|
const data = await getUnpaidOrder({ spuId: props.spuId, type: props.type })
|
|
// order:业务订单; payOrder:支付订单
|
|
// order:业务订单; payOrder:支付订单
|
|
- console.log('获取待支付的订单', data)
|
|
|
|
if (!data) {
|
|
if (!data) {
|
|
// 订单超时,重新提交订单
|
|
// 订单超时,重新提交订单
|
|
await createTradeOrder({
|
|
await createTradeOrder({
|
|
@@ -165,23 +178,9 @@ const payTypeItem = {
|
|
items: payTypeList.value
|
|
items: payTypeList.value
|
|
}
|
|
}
|
|
|
|
|
|
-const balance = JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0
|
|
|
|
-const balanceNotEnough = computed(() => {
|
|
|
|
- return (Number(props.cost) > Number(balance))
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
-const isWalletPay = ref(true)
|
|
|
|
-const isQrCodePay = ref(false)
|
|
|
|
-const payTypeChange = (val) => {
|
|
|
|
- payType.value = val
|
|
|
|
- isQrCodePay.value = qrCodePay.includes(payType.value)
|
|
|
|
- isWalletPay.value = walletPay.includes(payType.value)
|
|
|
|
- if (isQrCodePay.value) initPayQrCode() // 生成二维码内容
|
|
|
|
- emit('payTypeChange', val, balanceNotEnough)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-const paySubmit = () => {
|
|
|
|
- emit('paySubmit', payType.value)
|
|
|
|
|
|
+// 钱包支付(余额支付)
|
|
|
|
+const walletPaySubmit = () => {
|
|
|
|
+ // emit('paySubmit', payType.value)
|
|
}
|
|
}
|
|
|
|
|
|
// 生成二维码内容
|
|
// 生成二维码内容
|