feat:【antd】【ele】【pay 支付】pay/cashier 迁移 antd、ele 版本

pull/220/head
YunaiV 2025-10-06 20:45:29 +08:00
parent 38040be98f
commit 825a052533
4 changed files with 28 additions and 20 deletions

View File

@ -40,6 +40,7 @@ export const channelsAlipay = [
code: 'alipay_bar',
},
];
export const channelsWechat = [
{
name: '微信公众号支付',
@ -67,6 +68,7 @@ export const channelsWechat = [
code: 'wx_bar',
},
];
export const channelsMock = [
{
name: '钱包支付',

View File

@ -28,22 +28,21 @@ import { channelsAlipay, channelsMock, channelsWechat } from './data';
defineOptions({ name: 'PayCashier' });
const [Modal, modalApi] = useVbenModal({
showConfirmButton: false,
destroyOnClose: true,
});
const route = useRoute();
const { push } = useRouter(); //
const { push } = useRouter();
const { closeCurrentTab } = useTabs();
const id = ref(); //
const title = ref('支付订单');
const returnUrl = ref<string>(); //
const payOrder = ref<PayOrderApi.Order>();
const interval = ref<any>(undefined); //
const [Modal, modalApi] = useVbenModal({
showConfirmButton: false,
destroyOnClose: true,
});
/** 展示形式:二维码 */
const qrCode = ref({
url: '',
@ -87,9 +86,11 @@ async function getDetail() {
goReturnUrl('close');
return;
}
// 2.
payOrder.value = res;
}
/** 处理支付 */
function handlePay(channelCode: string) {
switch (channelCode) {
//
@ -129,6 +130,7 @@ function handlePay(channelCode: string) {
}
}
/** 提交支付 */
async function submit(channelCode: string) {
try {
const submitParam = {
@ -165,9 +167,7 @@ async function submit(channelCode: string) {
//
createQueryInterval();
} finally {
// message.success('')
}
} finally {}
}
/** 构建提交支付的额外参数 */
@ -291,10 +291,12 @@ function goReturnUrl(payResult: string) {
}
}
/** 页面加载时,获取支付信息 */
onMounted(async () => {
await getDetail();
});
/** 页面卸载时,清理定时任务 */
onBeforeUnmount(() => {
clearQueryInterval();
});

View File

@ -40,6 +40,7 @@ export const channelsAlipay = [
code: 'alipay_bar',
},
];
export const channelsWechat = [
{
name: '微信公众号支付',
@ -67,6 +68,7 @@ export const channelsWechat = [
code: 'wx_bar',
},
];
export const channelsMock = [
{
name: '钱包支付',

View File

@ -28,22 +28,21 @@ import { channelsAlipay, channelsMock, channelsWechat } from './data';
defineOptions({ name: 'PayCashier' });
const [Modal, modalApi] = useVbenModal({
showConfirmButton: false,
destroyOnClose: true,
});
const route = useRoute();
const { push } = useRouter(); //
const { push } = useRouter();
const { closeCurrentTab } = useTabs();
const id = ref(); //
const title = ref('支付订单');
const returnUrl = ref<string>(); //
const payOrder = ref<PayOrderApi.Order>();
const interval = ref<any>(undefined); //
const [Modal, modalApi] = useVbenModal({
showConfirmButton: false,
destroyOnClose: true,
});
/** 展示形式:二维码 */
const qrCode = ref({
url: '',
@ -87,9 +86,11 @@ async function getDetail() {
goReturnUrl('close');
return;
}
// 2.
payOrder.value = res;
}
/** 处理支付 */
function handlePay(channelCode: string) {
switch (channelCode) {
//
@ -129,6 +130,7 @@ function handlePay(channelCode: string) {
}
}
/** 提交支付 */
async function submit(channelCode: string) {
try {
const submitParam = {
@ -165,9 +167,7 @@ async function submit(channelCode: string) {
//
createQueryInterval();
} finally {
// message.success('')
}
} finally {}
}
/** 构建提交支付的额外参数 */
@ -291,10 +291,12 @@ function goReturnUrl(payResult: string) {
}
}
/** 页面加载时,获取支付信息 */
onMounted(async () => {
await getDetail();
});
/** 页面卸载时,清理定时任务 */
onBeforeUnmount(() => {
clearQueryInterval();
});