From 7cc39d4f22fcbb7923445da5c13ebe351eff5396 Mon Sep 17 00:00:00 2001 From: zlflying Date: Tue, 6 Jan 2026 11:42:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(@vben/web-antd):=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=B8=A0=E9=81=93=E7=9A=84=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 getEnableChannelCodeList API 接口用于获取指定应用的开启支付渠道编码列表 - 在收银台页面引入支付渠道启用状态检查功能 --- apps/web-antd/src/api/pay/channel/index.ts | 7 ++ apps/web-antd/src/views/pay/cashier/index.vue | 76 +++++++++++-------- 2 files changed, 53 insertions(+), 30 deletions(-) diff --git a/apps/web-antd/src/api/pay/channel/index.ts b/apps/web-antd/src/api/pay/channel/index.ts index 99005024c..10db352bb 100644 --- a/apps/web-antd/src/api/pay/channel/index.ts +++ b/apps/web-antd/src/api/pay/channel/index.ts @@ -30,3 +30,10 @@ export function createChannel(data: PayChannelApi.Channel) { export function updateChannel(data: PayChannelApi.Channel) { return requestClient.put('/pay/channel/update', data); } + +/** 获得指定应用的开启的支付渠道编码列表 */ +export function getEnableChannelCodeList(appId: number) { + return requestClient.get( + `/pay/channel/get-enable-code-list?appId=${appId}`, + ); +} diff --git a/apps/web-antd/src/views/pay/cashier/index.vue b/apps/web-antd/src/views/pay/cashier/index.vue index 8f2087296..c7fff62af 100644 --- a/apps/web-antd/src/views/pay/cashier/index.vue +++ b/apps/web-antd/src/views/pay/cashier/index.vue @@ -22,6 +22,7 @@ import { QRCode, } from 'ant-design-vue'; +import { getEnableChannelCodeList } from '#/api/pay/channel'; import { getOrder, submitOrder } from '#/api/pay/order'; import { channelsAlipay, channelsMock, channelsWechat } from './data'; @@ -56,6 +57,14 @@ const barCode = ref({ visible: false, }); +/** 开启的支付渠道编码列表 */ +const enableChannelCodeList = ref([]); + +/** 判断是否支持的支付渠道 */ +function isSupportPayChannel(channelCode: string) { + return enableChannelCodeList.value.includes(channelCode); +} + /** 获得支付信息 */ async function getDetail() { // 1. 获取路由参数 @@ -88,6 +97,10 @@ async function getDetail() { } // 2. 正常展示支付信息 payOrder.value = res; + + // 3. 获得指定应用的开启的支付渠道编码列表 + const channelCodeList = await getEnableChannelCodeList(res.appId); + enableChannelCodeList.value = channelCodeList; } /** 处理支付 */ @@ -329,47 +342,50 @@ onBeforeUnmount(() => {
-
-
- +
-
-
- +
-
-
- +