画家海外支付

This commit is contained in:
常东方 2025-05-19 15:12:51 +08:00
parent 24adb4c68d
commit 56ffd2073d
5 changed files with 74 additions and 2 deletions

View File

@ -1,9 +1,20 @@
import { request } from '@/api-collect-code/http-abroad.js' import { request } from '@/api-collect-code/http-abroad.js'
// 创建支付订单
export async function abroadCreateOrder(data) { export async function abroadCreateOrder(data) {
console.log('data',data);
return await request({ return await request({
url:"/artshow/overseas/show-pay/createOrder", url:"/artshow/overseas/show-pay/createOrder",
method:"POST", method:"POST",
data data
}) })
}
// 获取支付详情
export async function abroadPayInfo(data) {
return await request({
url:"/artshow/overseas/show-pay/info",
method:"POST",
data
})
} }

View File

@ -3,6 +3,7 @@
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import { authStore } from "~/stores/auth/index.js"; import { authStore } from "~/stores/auth/index.js";
import { orderQuery } from "~/api/goods/index.js"; import { orderQuery } from "~/api/goods/index.js";
import {abroadPayInfo} from "~/api-collect-code/abroad/index"
import { WebSocketClient } from "@/utils/websocket"; import { WebSocketClient } from "@/utils/websocket";
const config = useRuntimeConfig(); const config = useRuntimeConfig();
definePageMeta({ definePageMeta({

View File

@ -40,7 +40,7 @@ const getData = async () => {
} }
}; };
// //
getData(); // getData();
const confirmPay = async () => { const confirmPay = async () => {
const res = await createOrder({ const res = await createOrder({
price: qrData.value.price, price: qrData.value.price,
@ -64,6 +64,7 @@ const confirmPay = async () => {
}); });
} }
}; };
//
const abroadPay=async ()=>{ const abroadPay=async ()=>{
if(!route.query.qrUid){ if(!route.query.qrUid){
return return
@ -78,13 +79,15 @@ const abroadPay=async ()=>{
} }
} }
// typetype=abroad
const payment=async ()=>{ const payment=async ()=>{
if(type==="abroad"){ if(type==="abroad"){
await abroadPay() await abroadPay()
}else{ }else{
await confirmPay() await getData()
} }
} }
payment()
</script> </script>
<template> <template>

View File

@ -0,0 +1,55 @@
<script setup>
import { orderQuery } from "~/api/goods/index.js";
import { abroadCreateOrder } from "~/api-collect-code/abroad";
definePageMeta({
i18n: "payment.text1",
});
const router = useRouter();
const { t } = useI18n();
const route = useRoute();
const resData = ref({});
//
const res=await abroadPayInfo({QrUid:route.query.qrUid})
if (res.status === 0) {
resData.value = res.data;
}
const statusLabel = {
1: t("payment.text2"),
2: t("payment.text3"),
3: t("payment.text4"),
4: t("payment.text5"),
};
const goHome = () => {
router.push("/");
};
</script>
<template>
<div
class="w-[100vw] h-screen-nav bg-[url('@/static/images/3532@2x.png')] bg-cover grow-1 flex flex-col items-center px-30px"
>
<div class="flex flex-col items-center mt-150px">
<img
class="w-119px h-120px mb-36px"
src="@/static/images/5554@2x1.png"
alt=""
/>
<div class="text-#000 text-16px mb-25px">
{{ statusLabel[resData.PaymentStatus] }}!
</div>
<div class="text-#999 text-16px">
{{ resData.CurrencyType===1?'人民币':'美元' }}{{ resData.Amount }}
</div>
</div>
<!-- <div class="w-full mt-auto mb-40px">
<van-button type="primary" block @click="goHome">
回到首页
</van-button>
</div>-->
</div>
</template>
<style scoped></style>

View File

@ -1,6 +1,8 @@
import { setupHttp } from '@/api/http' import { setupHttp } from '@/api/http'
import { setupHttp as setupHttp1} from '@/api-collect-code/http' import { setupHttp as setupHttp1} from '@/api-collect-code/http'
import { setupHttp as abroadSetupHttp } from '~/api-collect-code/http-abroad'
export default defineNuxtPlugin(() => { export default defineNuxtPlugin(() => {
setupHttp() setupHttp()
setupHttp1() setupHttp1()
abroadSetupHttp()
}) })