From c07e7a3657b1181f42e28d69c244c499512afe3b Mon Sep 17 00:00:00 2001 From: DaxPay Dev Date: Sun, 5 Jul 2026 12:36:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(payment):=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=AE=A1=E7=90=86=E5=89=8D=E7=AB=AF:=20?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E9=A1=B5+=E8=AF=A6=E6=83=85=E9=A1=B5+API+loc?= =?UTF-8?q?ale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - API: src/api/payment/config/mobile-app.api.ts (list/list-by-app-type/get/save/update-enabled) - 卡片页 MobileAppConfig.vue: 三张卡片(商户端/管理端可点击, 收银台灰显敬请期待) - 详情页 detail/MobileAppDetail.vue: 按移动平台分Tab配置(密钥/通知/绑定/启用), 路由 /payment/config/mobile-app/detail/:appType - locale: payment/config/mobileApp.json (zh-CN/en-US, 含 platformNames) --- .../src/api/payment/config/mobile-app.api.ts | 91 ++++++++ .../langs/en-US/payment/config/mobileApp.json | 44 ++++ .../langs/zh-CN/payment/config/mobileApp.json | 44 ++++ .../config/mobileApp/MobileAppConfig.vue | 197 ++++++++++++++++ .../mobileApp/detail/MobileAppDetail.vue | 220 ++++++++++++++++++ 5 files changed, 596 insertions(+) create mode 100644 apps/daxpay-admin/src/api/payment/config/mobile-app.api.ts create mode 100644 apps/daxpay-admin/src/locales/langs/en-US/payment/config/mobileApp.json create mode 100644 apps/daxpay-admin/src/locales/langs/zh-CN/payment/config/mobileApp.json create mode 100644 apps/daxpay-admin/src/views/payment/config/mobileApp/MobileAppConfig.vue create mode 100644 apps/daxpay-admin/src/views/payment/config/mobileApp/detail/MobileAppDetail.vue diff --git a/apps/daxpay-admin/src/api/payment/config/mobile-app.api.ts b/apps/daxpay-admin/src/api/payment/config/mobile-app.api.ts new file mode 100644 index 000000000..5017970e9 --- /dev/null +++ b/apps/daxpay-admin/src/api/payment/config/mobile-app.api.ts @@ -0,0 +1,91 @@ +import type { BaseEntity, Result } from '#/types/web'; + +import { defHttp } from '#/api/request'; + +/** + * 移动端应用配置 API(平台级, 按端类型+移动平台维度) + */ +export const MobileAppApi = { + /** + * 查询全部(按端类型分组) + */ + list(): Promise> { + return defHttp.get({ url: '/admin/mobile-app/list' }); + }, + + /** + * 按端类型查询所有平台配置 + */ + listByAppType(appType: string): Promise> { + return defHttp.get({ + url: '/admin/mobile-app/list-by-app-type', + params: { appType }, + }); + }, + + /** + * 查询单条详情 + */ + findById(id: number): Promise> { + return defHttp.get({ url: '/admin/mobile-app/get', params: { id } }); + }, + + /** + * 保存(按端类型+平台 upsert) + */ + save(param: MobileAppParam): Promise> { + return defHttp.post({ url: '/admin/mobile-app/save', data: param }); + }, + + /** + * 更新启用状态 + */ + updateEnabled(id: number, enable: boolean): Promise> { + return defHttp.post({ + url: '/admin/mobile-app/update-enabled', + params: { id, enable }, + }); + }, +}; + +/** 移动端应用配置结果 */ +export interface MobileAppResult extends BaseEntity { + /** 端类型: merchant/admin/cashier */ + appType?: string; + /** 移动平台: wx_h5/wx_mini/alipay_mini/dy_mini/android/ios */ + platform?: string; + /** 应用名称 */ + appName?: string; + /** 平台特有密钥配置(JSON文本) */ + appConfig?: string; + /** 消息通知配置(JSON文本) */ + notifyConfig?: string; + /** 是否启用第三方账号用户绑定 */ + bindingEnabled?: boolean; + /** 是否启用 */ + enabled?: boolean; + /** 备注 */ + remark?: string; +} + +/** 移动端应用配置保存参数 */ +export interface MobileAppParam { + /** 主键(更新时传) */ + id?: number; + /** 端类型 */ + appType?: string; + /** 移动平台 */ + platform?: string; + /** 应用名称 */ + appName?: string; + /** 平台特有密钥配置(JSON文本) */ + appConfig?: string; + /** 消息通知配置(JSON文本) */ + notifyConfig?: string; + /** 是否启用第三方账号用户绑定 */ + bindingEnabled?: boolean; + /** 是否启用 */ + enabled?: boolean; + /** 备注 */ + remark?: string; +} diff --git a/apps/daxpay-admin/src/locales/langs/en-US/payment/config/mobileApp.json b/apps/daxpay-admin/src/locales/langs/en-US/payment/config/mobileApp.json new file mode 100644 index 000000000..41335425d --- /dev/null +++ b/apps/daxpay-admin/src/locales/langs/en-US/payment/config/mobileApp.json @@ -0,0 +1,44 @@ +{ + "title": "Mobile App Management", + "card": { + "merchant": { + "name": "Merchant App", + "desc": "Mobile app for merchant staff" + }, + "admin": { + "name": "Admin App", + "desc": "Mobile app for platform operators" + }, + "cashier": { + "name": "Cashier Mini Program", + "desc": "Mini program for consumer payment" + }, + "comingSoon": "Coming Soon", + "enter": "Configure" + }, + "platformNames": { + "wx_h5": "WeChat Official Account", + "wx_mini": "WeChat Mini Program", + "alipay_mini": "Alipay Mini Program", + "dy_mini": "Douyin Mini Program", + "android": "Android App", + "ios": "iOS App" + }, + "detail": { + "back": "Back", + "appName": "App Name", + "appNamePlaceholder": "Enter app name", + "appConfig": "Platform Key Config", + "appConfigPlaceholder": "Enter platform key config in JSON format", + "notifyConfig": "Notification Config", + "notifyConfigPlaceholder": "Enter notification config in JSON format", + "bindingEnabled": "Enable third-party account binding", + "enabled": "Enabled", + "remark": "Remark", + "remarkPlaceholder": "Enter remark", + "save": "Save", + "saveSuccess": "Saved successfully", + "notSupportedAppType": "Unsupported app type", + "emptyPlatformConfig": "No platform config yet, fill in and save to create" + } +} diff --git a/apps/daxpay-admin/src/locales/langs/zh-CN/payment/config/mobileApp.json b/apps/daxpay-admin/src/locales/langs/zh-CN/payment/config/mobileApp.json new file mode 100644 index 000000000..4806f4750 --- /dev/null +++ b/apps/daxpay-admin/src/locales/langs/zh-CN/payment/config/mobileApp.json @@ -0,0 +1,44 @@ +{ + "title": "移动端应用管理", + "card": { + "merchant": { + "name": "商户端", + "desc": "商户员工使用的移动应用" + }, + "admin": { + "name": "管理端", + "desc": "平台运营使用的移动应用" + }, + "cashier": { + "name": "收银台小程序", + "desc": "消费者扫码支付的小程序" + }, + "comingSoon": "敬请期待", + "enter": "进入配置" + }, + "platformNames": { + "wx_h5": "微信公众号", + "wx_mini": "微信小程序", + "alipay_mini": "支付宝小程序", + "dy_mini": "抖音小程序", + "android": "安卓APP", + "ios": "iOS APP" + }, + "detail": { + "back": "返回", + "appName": "应用名称", + "appNamePlaceholder": "请输入应用名称", + "appConfig": "平台密钥配置", + "appConfigPlaceholder": "请输入 JSON 格式的平台密钥配置", + "notifyConfig": "消息通知配置", + "notifyConfigPlaceholder": "请输入 JSON 格式的消息通知配置", + "bindingEnabled": "启用第三方账号用户绑定", + "enabled": "是否启用", + "remark": "备注", + "remarkPlaceholder": "请输入备注", + "save": "保存", + "saveSuccess": "保存成功", + "notSupportedAppType": "不支持的端类型", + "emptyPlatformConfig": "暂无平台配置,填写后保存即可创建" + } +} diff --git a/apps/daxpay-admin/src/views/payment/config/mobileApp/MobileAppConfig.vue b/apps/daxpay-admin/src/views/payment/config/mobileApp/MobileAppConfig.vue new file mode 100644 index 000000000..05741d132 --- /dev/null +++ b/apps/daxpay-admin/src/views/payment/config/mobileApp/MobileAppConfig.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/apps/daxpay-admin/src/views/payment/config/mobileApp/detail/MobileAppDetail.vue b/apps/daxpay-admin/src/views/payment/config/mobileApp/detail/MobileAppDetail.vue new file mode 100644 index 000000000..4f559f425 --- /dev/null +++ b/apps/daxpay-admin/src/views/payment/config/mobileApp/detail/MobileAppDetail.vue @@ -0,0 +1,220 @@ + + +