画家海外支付
This commit is contained in:
parent
24adb4c68d
commit
56ffd2073d
@ -1,5 +1,8 @@
|
||||
import { request } from '@/api-collect-code/http-abroad.js'
|
||||
// 创建支付订单
|
||||
export async function abroadCreateOrder(data) {
|
||||
console.log('data',data);
|
||||
|
||||
return await request({
|
||||
url:"/artshow/overseas/show-pay/createOrder",
|
||||
method:"POST",
|
||||
@ -7,3 +10,11 @@ export async function abroadCreateOrder(data) {
|
||||
})
|
||||
|
||||
}
|
||||
// 获取支付详情
|
||||
export async function abroadPayInfo(data) {
|
||||
return await request({
|
||||
url:"/artshow/overseas/show-pay/info",
|
||||
method:"POST",
|
||||
data
|
||||
})
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
import { onMounted, ref } from "vue";
|
||||
import { authStore } from "~/stores/auth/index.js";
|
||||
import { orderQuery } from "~/api/goods/index.js";
|
||||
import {abroadPayInfo} from "~/api-collect-code/abroad/index"
|
||||
import { WebSocketClient } from "@/utils/websocket";
|
||||
const config = useRuntimeConfig();
|
||||
definePageMeta({
|
||||
|
@ -40,7 +40,7 @@ const getData = async () => {
|
||||
}
|
||||
};
|
||||
// 获取二维码价格
|
||||
getData();
|
||||
// getData();
|
||||
const confirmPay = async () => {
|
||||
const res = await createOrder({
|
||||
price: qrData.value.price,
|
||||
@ -64,6 +64,7 @@ const confirmPay = async () => {
|
||||
});
|
||||
}
|
||||
};
|
||||
// 画家海外支付 扫码支付
|
||||
const abroadPay=async ()=>{
|
||||
if(!route.query.qrUid){
|
||||
return
|
||||
@ -78,13 +79,15 @@ const abroadPay=async ()=>{
|
||||
}
|
||||
|
||||
}
|
||||
// 根据是否有type选择执行支付方式,当type=abroad时,属于画家海外支付
|
||||
const payment=async ()=>{
|
||||
if(type==="abroad"){
|
||||
await abroadPay()
|
||||
}else{
|
||||
await confirmPay()
|
||||
await getData()
|
||||
}
|
||||
}
|
||||
payment()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
55
app/pages/overseasCode/payment/result/index.vue
Normal file
55
app/pages/overseasCode/payment/result/index.vue
Normal 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>
|
@ -1,6 +1,8 @@
|
||||
import { setupHttp } from '@/api/http'
|
||||
import { setupHttp as setupHttp1} from '@/api-collect-code/http'
|
||||
import { setupHttp as abroadSetupHttp } from '~/api-collect-code/http-abroad'
|
||||
export default defineNuxtPlugin(() => {
|
||||
setupHttp()
|
||||
setupHttp1()
|
||||
abroadSetupHttp()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user