画家海外支付

This commit is contained in:
常东方 2025-05-19 11:44:09 +08:00
parent 1a7c74b9da
commit 24adb4c68d
3 changed files with 27 additions and 2 deletions

View File

@ -6,12 +6,14 @@ import { showLoadingToast, closeToast } from "vant";
import { authStore } from "~/stores/auth/index.js";
import { message } from "~/components/x-message/useMessage.js";
import { createOrder, offlineQrcode } from "~/api-collect-code/goods/index.js";
import {abroadCreateOrder} from "~/api-collect-code/abroad/index.js"
import { codeAuthStore } from "~/stores-collect-code/auth/index.js";
import { useI18n } from "vue-i18n";
const amount = ref("");
const router = useRouter();
const route = useRoute();
const type=route.query.type
const { t } = useI18n();
const { checkoutSessionUrl, qrUid, qrData, codePKey, codePayUid } =
codeAuthStore();
@ -62,6 +64,27 @@ const confirmPay = async () => {
});
}
};
const abroadPay=async ()=>{
if(!route.query.qrUid){
return
}
const res=await abroadCreateOrder({
QrUid:route.query.qrUid
});
if(res.status===0){
codePKey.value = res.data.checkoutSessionUrl;
codePayUid.value = res.data.payUid;
window.location.href = res.data.checkoutSessionUrl;
}
}
const payment=async ()=>{
if(type==="abroad"){
await abroadPay()
}else{
await confirmPay()
}
}
</script>
<template>

2
env/.env.prod vendored
View File

@ -4,4 +4,4 @@ NUXT_PUBLIC_SOCKET_URL=wss://auction.szjixun.cn
NUXT_API_SECRET=prod-secret
NUXT_PUBLIC_PKEY=pk_live_51QfbSAAB1Vm8VfJqEVY2uFHPn9N4sDbOaCzht8IVKoylYBrYvdUsmsnCzGxIoN9skBCvI5PsxLJcf4PlytXIr1aX00mFJBXSB8
NUXT_PUBLIC_ABROAD_API_BASE
NUXT_PUBLIC_ABROAD_API_BASE=https://erpapi.fontree.cn

2
env/.env.test vendored
View File

@ -4,3 +4,5 @@ NUXT_PUBLIC_API_COLLECT_CODE=http://auction-test.szjixun.cn
NUXT_API_SECRET=test-secret
NUXT_PUBLIC_SOCKET_URL=wss://auction-test.szjixun.cn
NUXT_PUBLIC_PKEY=pk_test_51QfbSAAB1Vm8VfJq3AWsR4k2mZjnlF7XFrmlbc6XVXrtwXquAUfwzZmOFDbxMIAwqJBgqao8KLt2wmPc4vNOCTeo00WB78KtfV
NUXT_PUBLIC_ABROAD_API_BASE=http://114.218.158.24:9020