From 24adb4c68d08e10ebe043eede5aec34dafa6fade Mon Sep 17 00:00:00 2001
From: changDongFang <2628162102@qq.com>
Date: Mon, 19 May 2025 11:44:09 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E5=AE=B6=E6=B5=B7=E5=A4=96=E6=94=AF?=
 =?UTF-8?q?=E4=BB=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/pages/collectCode/payment/index.vue | 23 +++++++++++++++++++++++
 env/.env.prod                           |  2 +-
 env/.env.test                           |  4 +++-
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/app/pages/collectCode/payment/index.vue b/app/pages/collectCode/payment/index.vue
index 780017e..5b3b154 100644
--- a/app/pages/collectCode/payment/index.vue
+++ b/app/pages/collectCode/payment/index.vue
@@ -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>
diff --git a/env/.env.prod b/env/.env.prod
index c532d9f..899c852 100644
--- a/env/.env.prod
+++ b/env/.env.prod
@@ -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
\ No newline at end of file
+NUXT_PUBLIC_ABROAD_API_BASE=https://erpapi.fontree.cn
\ No newline at end of file
diff --git a/env/.env.test b/env/.env.test
index 6d382ab..481899a 100644
--- a/env/.env.test
+++ b/env/.env.test
@@ -3,4 +3,6 @@ NUXT_PUBLIC_API_BASE=https://auction-test.szjixun.cn
 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
\ No newline at end of file
+NUXT_PUBLIC_PKEY=pk_test_51QfbSAAB1Vm8VfJq3AWsR4k2mZjnlF7XFrmlbc6XVXrtwXquAUfwzZmOFDbxMIAwqJBgqao8KLt2wmPc4vNOCTeo00WB78KtfV
+
+NUXT_PUBLIC_ABROAD_API_BASE=http://114.218.158.24:9020
\ No newline at end of file