diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index e5c1e01d6051d4af2465ef6cdc314e7249318c83..be092084ff54098bc9e2e21b5e00b902087d8ccd 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -26,6 +26,7 @@ "#/*": "./src/*" }, "dependencies": { + "@ant-design/icons-vue": "catalog:", "@form-create/ant-design-vue": "catalog:", "@form-create/antd-designer": "catalog:", "@tinymce/tinymce-vue": "catalog:", diff --git a/apps/web-antd/src/adapter/form.ts b/apps/web-antd/src/adapter/form.ts index cf75673e5038fe3c9896a19ad43182f3036d15bf..a1653a237fc0bc1ec5933722959062beca88e00e 100644 --- a/apps/web-antd/src/adapter/form.ts +++ b/apps/web-antd/src/adapter/form.ts @@ -68,3 +68,4 @@ export { useVbenForm, z }; export type VbenFormSchema = FormSchema; export type { VbenFormProps }; +export type FormSchemaGetter = () => VbenFormSchema[]; diff --git a/apps/web-antd/src/api/pay/channel/index.ts b/apps/web-antd/src/api/pay/channel/index.ts index 99a16c05c2f1bfbd723d12429bdaa9c23dbf0901..eb4c1d99ed7ced2538283d581484c85766355668 100644 --- a/apps/web-antd/src/api/pay/channel/index.ts +++ b/apps/web-antd/src/api/pay/channel/index.ts @@ -27,7 +27,7 @@ export function getChannelPage(params: PageParam) { } /** 查询支付渠道详情 */ -export function getChannel(appId: string, code: string) { +export function getChannel(appId: number, code: string) { return requestClient.get('/pay/channel/get', { params: { appId, code }, }); diff --git a/apps/web-antd/src/api/pay/order/index.ts b/apps/web-antd/src/api/pay/order/index.ts index 984a5d1f604e173de892525890cd3d7b92ba67bf..31ba880d893f0e35e22a01d3c5026837871987f2 100644 --- a/apps/web-antd/src/api/pay/order/index.ts +++ b/apps/web-antd/src/api/pay/order/index.ts @@ -6,8 +6,13 @@ export namespace PayOrderApi { /** 支付订单信息 */ export interface Order { id: number; + no: string; + price: number; + channelFeePrice: number; + refundPrice: number; merchantId: number; appId: number; + appName: string; channelId: number; channelCode: string; merchantOrderId: string; @@ -29,7 +34,9 @@ export namespace PayOrderApi { refundAmount: number; channelUserId: string; channelOrderNo: string; + channelNotifyData: string; createTime: Date; + updateTime: Date; } /** 支付订单分页请求 */ diff --git a/apps/web-antd/src/components/upload/file-upload.vue b/apps/web-antd/src/components/upload/file-upload.vue index 91d7cc669afc7cfd265af4790ae2ce07b46d9008..b3b1276a877e15b428ed55a4d2bc00562b7275c4 100644 --- a/apps/web-antd/src/components/upload/file-upload.vue +++ b/apps/web-antd/src/components/upload/file-upload.vue @@ -55,7 +55,7 @@ const props = withDefaults( showDescription: false, }, ); -const emit = defineEmits(['change', 'update:value', 'delete']); +const emit = defineEmits(['change', 'update:value', 'delete', 'returnText']); const { accept, helpText, maxNumber, maxSize } = toRefs(props); const isInnerOperate = ref(false); const { getStringAccept } = useUploadType({ @@ -122,6 +122,10 @@ const handleRemove = async (file: UploadFile) => { }; const beforeUpload = async (file: File) => { + // 使用现代的Blob.text()方法替代FileReader + const fileContent = await file.text(); + emit('returnText', fileContent); + const { maxSize, accept } = props; const isAct = checkFileType(file, accept); if (!isAct) { diff --git a/apps/web-antd/src/views/pay/app/data.ts b/apps/web-antd/src/views/pay/app/data.ts new file mode 100644 index 0000000000000000000000000000000000000000..dcc83ba04a2e2c0f1e7bf8024129a422506e2d44 --- /dev/null +++ b/apps/web-antd/src/views/pay/app/data.ts @@ -0,0 +1,223 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'name', + label: '应用名', + componentProps: { + placeholder: '请输入应用名', + }, + }, + { + component: 'Select', + fieldName: 'status', + label: '开启状态', + componentProps: { + placeholder: '请选择开启状态', + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + { + component: 'RangePicker', + fieldName: 'createTime', + label: '创建时间', + componentProps: { + placeholder: ['开始日期', '结束日期'], + }, + }, +]; + +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '应用标识', + field: 'appKey', + }, + { + title: '应用名', + field: 'name', + }, + { + title: '开启状态', + field: 'status', + slots: { + default: 'status', + }, + }, + { + title: '支付宝配置', + children: [ + { + title: 'APP 支付', + slots: { + default: 'alipayAppConfig', + }, + }, + { + title: 'PC 网站支付', + slots: { + default: 'alipayPCConfig', + }, + }, + { + title: 'WAP 网站支付', + slots: { + default: 'alipayWAPConfig', + }, + }, + { + title: '扫码支付', + slots: { + default: 'alipayQrConfig', + }, + }, + { + title: '条码支付', + slots: { + default: 'alipayBarConfig', + }, + }, + ], + }, + { + title: '微信配置', + children: [ + { + title: '小程序支付', + slots: { + default: 'wxLiteConfig', + }, + }, + { + title: 'JSAPI 支付', + slots: { + default: 'wxPubConfig', + }, + }, + { + title: 'APP 支付', + slots: { + default: 'wxAppConfig', + }, + }, + { + title: 'Native 支付', + slots: { + default: 'wxNativeConfig', + }, + }, + { + title: 'WAP 网站支付', + slots: { + default: 'wxWapConfig', + }, + }, + { + title: '条码支付', + slots: { + default: 'wxBarConfig', + }, + }, + ], + }, + { + title: '钱包支付配置', + field: 'walletConfig', + slots: { + default: 'walletConfig', + }, + }, + { + title: '模拟支付配置', + field: 'mockConfig', + slots: { + default: 'mockConfig', + }, + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + minWidth: 160, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '应用编号', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '应用名', + fieldName: 'name', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入应用名', + }, + }, + { + label: '应用标识', + fieldName: 'appKey', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入应用标识', + }, + }, + { + label: '开启状态', + fieldName: 'status', + component: 'RadioGroup', + rules: 'required', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + { + label: '支付结果的回调地址', + fieldName: 'orderNotifyUrl', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入支付结果的回调地址', + }, + }, + { + label: '退款结果的回调地址', + fieldName: 'refundNotifyUrl', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入支付结果的回调地址', + }, + }, + { + label: '转账结果的回调地址', + fieldName: 'transferNotifyUrl', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入转账结果的回调地址', + }, + }, + { + label: '备注', + fieldName: 'remark', + component: 'Textarea', + componentProps: { + rows: 3, + placeholder: '请输入备注', + }, + }, +]; diff --git a/apps/web-antd/src/views/pay/app/index.vue b/apps/web-antd/src/views/pay/app/index.vue index 199d0ebd2f312ba847e8685cebf5b32a34551252..08cfc1b354783f66fb0b57ce6c5abea3ed003b7f 100644 --- a/apps/web-antd/src/views/pay/app/index.vue +++ b/apps/web-antd/src/views/pay/app/index.vue @@ -1,31 +1,498 @@ diff --git a/apps/web-antd/src/views/pay/app/modules/app-form.vue b/apps/web-antd/src/views/pay/app/modules/app-form.vue new file mode 100644 index 0000000000000000000000000000000000000000..3791d15a16a4e1d4a8621071ec3a361a0cc435ba --- /dev/null +++ b/apps/web-antd/src/views/pay/app/modules/app-form.vue @@ -0,0 +1,90 @@ + + diff --git a/apps/web-antd/src/views/pay/app/modules/channel/alipay-channel-form.vue b/apps/web-antd/src/views/pay/app/modules/channel/alipay-channel-form.vue new file mode 100644 index 0000000000000000000000000000000000000000..a188ce67d5f46e4fb91142c63e5ec6a4507166d5 --- /dev/null +++ b/apps/web-antd/src/views/pay/app/modules/channel/alipay-channel-form.vue @@ -0,0 +1,163 @@ + +