调整支付
This commit is contained in:
parent
717f32cdf3
commit
bbe816d9b9
@ -48,7 +48,6 @@ import { jzXkCancelApi, jzXkFqJfjApi } from "@/api/base/xkApi";
|
|||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
import { useDataStore } from "@/store/modules/data";
|
import { useDataStore } from "@/store/modules/data";
|
||||||
import { useDebounce } from "@/utils/debounce";
|
import { useDebounce } from "@/utils/debounce";
|
||||||
import { PageUtils } from "@/utils/pageUtil";
|
|
||||||
const { getUser, setWsCallback } = useUserStore();
|
const { getUser, setWsCallback } = useUserStore();
|
||||||
const { getQk } = useDataStore();
|
const { getQk } = useDataStore();
|
||||||
|
|
||||||
@ -208,17 +207,26 @@ const payNow = payDebounce(async () => {
|
|||||||
const res = await jzXkFqJfjApi({
|
const res = await jzXkFqJfjApi({
|
||||||
xsId: qk.value.xsId,
|
xsId: qk.value.xsId,
|
||||||
xkId: qk.value.xkId,
|
xkId: qk.value.xkId,
|
||||||
jffs: "线上缴费", // 线上,线下,无需缴费
|
|
||||||
zfptLx: "四川农信", // TODO: 目前只支持四川农信
|
zfptLx: "四川农信", // TODO: 目前只支持四川农信
|
||||||
jzId: getUser.jzId,
|
|
||||||
userId: getUser.userId,
|
|
||||||
openId: getUser.openId,
|
openId: getUser.openId,
|
||||||
});
|
});
|
||||||
if (res.resultCode === 1 && res.result) {
|
if (res.resultCode === 1 && res.result) {
|
||||||
// 使用 uni.openUrl 或 plus.runtime.openUrl 打开支付页面
|
// 使用 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);
|
openPaymentPage(payUrl);
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "发起支付失败",
|
||||||
|
icon: "error",
|
||||||
|
});
|
||||||
|
goBack();
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user