From bbe816d9b968476512a8e3a79fd81382743893df Mon Sep 17 00:00:00 2001 From: ywyonui Date: Tue, 2 Sep 2025 21:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/base/xk/pay/index.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/pages/base/xk/pay/index.vue b/src/pages/base/xk/pay/index.vue index 733675d..1f2266f 100644 --- a/src/pages/base/xk/pay/index.vue +++ b/src/pages/base/xk/pay/index.vue @@ -48,7 +48,6 @@ import { jzXkCancelApi, jzXkFqJfjApi } from "@/api/base/xkApi"; import { useUserStore } from "@/store/modules/user"; import { useDataStore } from "@/store/modules/data"; import { useDebounce } from "@/utils/debounce"; -import { PageUtils } from "@/utils/pageUtil"; const { getUser, setWsCallback } = useUserStore(); const { getQk } = useDataStore(); @@ -208,17 +207,26 @@ const payNow = payDebounce(async () => { const res = await jzXkFqJfjApi({ xsId: qk.value.xsId, xkId: qk.value.xkId, - jffs: "线上缴费", // 线上,线下,无需缴费 zfptLx: "四川农信", // TODO: 目前只支持四川农信 - jzId: getUser.jzId, - userId: getUser.userId, openId: getUser.openId, }); if (res.resultCode === 1 && res.result) { // 使用 uni.openUrl 或 plus.runtime.openUrl 打开支付页面 - const payUrl = res.result.cashierPayHtml; - + const payUrl = res.result.payUrl || res.result.cashierPayHtml; + if (!payUrl) { + uni.showToast({ + title: "未能获取到对应的支付链接", + icon: "error", + }); + return; + } openPaymentPage(payUrl); + } else { + uni.showToast({ + title: "发起支付失败", + icon: "error", + }); + goBack(); } } catch (error: any) { console.log(error);