|
@@ -62,7 +62,7 @@ import { definePayTypeList, qrCodePay, walletPay } from './until/payType'
|
|
|
import { getEnableCodeList, getUnpaidOrder, payOrderSubmit, getOrderPayStatus } from '@/api/common'
|
|
|
import { createTradeOrder } from '@/api/position'
|
|
|
import { useSharedState } from '@/store/sharedState'
|
|
|
-const emit = defineEmits(['payTypeChange', ])
|
|
|
+const emit = defineEmits(['payTypeChange', 'paySuccess'])
|
|
|
const props = defineProps({
|
|
|
params: {
|
|
|
type: Object,
|
|
@@ -80,11 +80,16 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
default: ''
|
|
|
},
|
|
|
+ returnUrl: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
type: {
|
|
|
type: Number,
|
|
|
default: 2 // 订单类型 0平台订单| 1发布职位订单| 2发布众聘职位订单,示例值(1)
|
|
|
},
|
|
|
})
|
|
|
+
|
|
|
const loading = ref(true)
|
|
|
|
|
|
const balance = JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0
|
|
@@ -197,7 +202,7 @@ const initPayQrCode = async () => {
|
|
|
id: payOrder.value.id, // 支付单编号
|
|
|
channelCode: payType.value, // 支付渠道
|
|
|
displayMode: payOrder.value.notifyUrl, // 展示模式 notifyUrl
|
|
|
- returnUrl: '',
|
|
|
+ // returnUrl: location.href, // 支付成功后,支付渠道跳转回当前页;再由当前页,跳转回 {@link returnUrl} 对应的地址
|
|
|
}
|
|
|
const res = await payOrderSubmit(params)
|
|
|
payQrCodeTet.value = res?.displayContent || '' // 支付二维码
|
|
@@ -217,8 +222,8 @@ const payStatus = async () => {
|
|
|
// 支付成功
|
|
|
if (timer.value) clearInterval(timer.value); timer.value = null
|
|
|
setTimeout(() => {
|
|
|
- const query = { hire: true }
|
|
|
- router.push({ path: '/recruit/enterprise/position', query }) // 返回到众聘页面
|
|
|
+ if (props.returnUrl) router.push(props.returnUrl) // 返回指定页面
|
|
|
+ else emit('paySuccess')
|
|
|
Snackbar.success('付款成功')
|
|
|
}, 1000);
|
|
|
}
|