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 @@ + + +