From 7625e6757c92e5dc5cf76fdc33e31ff3625268d5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 10 Aug 2023 23:30:37 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=94=B6=E9=93=B6=E5=8F=B0=E7=9A=84=E5=AE=9E=E7=8E=B0=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/pay/app/index.ts | 21 +----- src/api/pay/notify/index.ts | 1 + src/api/pay/order/index.ts | 14 +--- src/utils/constants.ts | 74 ------------------- src/utils/dict.ts | 5 -- src/views/pay/app/components/AppForm.vue | 8 +- src/views/pay/app/index.vue | 23 ------ src/views/pay/cashier/index.vue | 93 ++++++++++++------------ 8 files changed, 55 insertions(+), 184 deletions(-) diff --git a/src/api/pay/app/index.ts b/src/api/pay/app/index.ts index 286f97bb..4bb06b36 100644 --- a/src/api/pay/app/index.ts +++ b/src/api/pay/app/index.ts @@ -22,16 +22,6 @@ export interface AppPageReqVO extends PageParam { createTime?: Date[] } -export interface AppExportReqVO { - name?: string - status?: number - remark?: string - payNotifyUrl?: string - refundNotifyUrl?: string - merchantName?: string - createTime?: Date[] -} - export interface AppUpdateStatusReqVO { id: number status: number @@ -67,16 +57,7 @@ export const deleteApp = (id: number) => { return request.delete({ url: '/pay/app/delete?id=' + id }) } -// 导出支付应用 -export const exportApp = (params: AppExportReqVO) => { - return request.download({ url: '/pay/app/export-excel', params }) -} - -// 根据商ID称搜索应用列表 -export const getAppListByMerchantId = (merchantId: number) => { - return request.get({ url: '/pay/app/list-merchant-id', params: { merchantId: merchantId } }) -} - +// 获得支付应用列表 export const getAppList = () => { return request.get({ url: '/pay/app/list' diff --git a/src/api/pay/notify/index.ts b/src/api/pay/notify/index.ts index 494c2216..dc8bd887 100644 --- a/src/api/pay/notify/index.ts +++ b/src/api/pay/notify/index.ts @@ -1,5 +1,6 @@ import request from '@/config/axios' +// 获得支付通知明细 export const getNotifyTaskDetail = (id) => { return request.get({ url: '/pay/notify/get-detail?id=' + id diff --git a/src/api/pay/order/index.ts b/src/api/pay/order/index.ts index 95dda2c5..71960a8a 100644 --- a/src/api/pay/order/index.ts +++ b/src/api/pay/order/index.ts @@ -93,21 +93,11 @@ export const getOrderDetail = async (id: number) => { return await request.get({ url: '/pay/order/get-detail?id=' + id }) } -// 新增支付订单 -export const createOrder = async (data: OrderVO) => { +// 提交支付订单 +export const submitOrder = async (data: any) => { return await request.post({ url: '/pay/order/submit', data }) } -// 修改支付订单 -export const updateOrder = async (data: OrderVO) => { - return await request.put({ url: '/pay/order/update', data }) -} - -// 删除支付订单 -export const deleteOrder = async (id: number) => { - return await request.delete({ url: '/pay/order/delete?id=' + id }) -} - // 导出支付订单 export const exportOrder = async (params: OrderExportReqVO) => { return await request.download({ url: '/pay/order/export-excel', params }) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index d5c29eb0..cd346a5c 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -177,80 +177,6 @@ export const PayOrderStatusEnum = { } } -/** - * 支付订单回调状态枚举 - */ -export const PayOrderNotifyStatusEnum = { - NO: { - status: 0, - name: '未通知' - }, - SUCCESS: { - status: 10, - name: '通知成功' - }, - FAILURE: { - status: 20, - name: '通知失败' - } -} - -/** - * 支付订单退款状态枚举 - */ -export const PayOrderRefundStatusEnum = { - NO: { - status: 0, - name: '未退款' - }, - SOME: { - status: 10, - name: '部分退款' - }, - ALL: { - status: 20, - name: '全部退款' - } -} - -/** - * 支付退款订单状态枚举 - */ -export const PayRefundStatusEnum = { - CREATE: { - status: 0, - name: '退款订单生成' - }, - SUCCESS: { - status: 1, - name: '退款成功' - }, - FAILURE: { - status: 2, - name: '退款失败' - }, - PROCESSING_NOTIFY: { - status: 3, - name: '退款中,渠道通知结果' - }, - PROCESSING_QUERY: { - status: 4, - name: '退款中,系统查询结果' - }, - UNKNOWN_RETRY: { - status: 5, - name: '状态未知,请重试' - }, - UNKNOWN_QUERY: { - status: 6, - name: '状态未知,系统查询结果' - }, - CLOSE: { - status: 99, - name: '退款关闭' - } -} - /** * 商品 SPU 状态 */ diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 7b1287fb..d11d1d33 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -130,13 +130,8 @@ export enum DICT_TYPE { BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type', // ========== PAY 模块 ========== - PAY_CHANNEL_WECHAT_VERSION = 'pay_channel_wechat_version', // 微信渠道版本 - PAY_CHANNEL_ALIPAY_SIGN_TYPE = 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型 - PAY_CHANNEL_ALIPAY_MODE = 'pay_channel_alipay_mode', // 支付宝公钥类型 - PAY_CHANNEL_ALIPAY_SERVER_TYPE = 'pay_channel_alipay_server_type', // 支付宝网关地址 PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型 PAY_CHANNEL_CODE_TYPE = 'pay_channel_code_type', // 支付渠道编码类型 - // PAY_ORDER_NOTIFY_STATUS = 'pay_order_notify_status', // 商户支付订单回调状态 PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态 PAY_ORDER_REFUND_STATUS = 'pay_order_refund_status', // 商户支付订单退款状态 PAY_REFUND_ORDER_STATUS = 'pay_refund_order_status', // 退款订单状态 diff --git a/src/views/pay/app/components/AppForm.vue b/src/views/pay/app/components/AppForm.vue index 4277fb62..b99766c1 100644 --- a/src/views/pay/app/components/AppForm.vue +++ b/src/views/pay/app/components/AppForm.vue @@ -21,8 +21,8 @@ - - + + @@ -66,7 +66,7 @@ const formData = ref({ const formRules = reactive({ name: [{ required: true, message: '应用名不能为空', trigger: 'blur' }], status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }], - payNotifyUrl: [{ required: true, message: '支付结果的回调地址不能为空', trigger: 'blur' }], + orderNotifyUrl: [{ required: true, message: '支付结果的回调地址不能为空', trigger: 'blur' }], refundNotifyUrl: [{ required: true, message: '退款结果的回调地址不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref @@ -122,7 +122,7 @@ const resetForm = () => { name: undefined, status: CommonStatusEnum.ENABLE, remark: undefined, - payNotifyUrl: undefined, + orderNotifyUrl: undefined, refundNotifyUrl: undefined } formRef.value?.resetFields() diff --git a/src/views/pay/app/index.vue b/src/views/pay/app/index.vue index d3f993e9..6073f1b0 100644 --- a/src/views/pay/app/index.vue +++ b/src/views/pay/app/index.vue @@ -54,15 +54,6 @@ > 新增 - - 导出 - @@ -392,20 +383,6 @@ const handleDelete = async (id: number) => { } catch {} } -/** 导出按钮操作 */ -const handleExport = async () => { - try { - // 导出的二次确认 - await message.exportConfirm() - // 发起导出 - exportLoading.value = true - const data = await AppApi.exportApp(queryParams) - download.excel(data, '支付应用信息.xls') - } finally { - exportLoading.value = false - } -} - /** * 根据渠道编码判断渠道列表中是否存在 * diff --git a/src/views/pay/cashier/index.vue b/src/views/pay/cashier/index.vue index 44201fbe..f3d140d2 100644 --- a/src/views/pay/cashier/index.vue +++ b/src/views/pay/cashier/index.vue @@ -5,15 +5,15 @@ {{ payOrder.id }} {{ payOrder.subject }} {{ payOrder.body }} - ¥{{ (payOrder.price / 100.0).toFixed(2) }} - {{ - formatDate(payOrder.createTime) - }} - {{ - formatDate(payOrder.expireTime) - }} + + ¥{{ (payOrder.price / 100.0).toFixed(2) }} + + + {{ formatDate(payOrder.createTime) }} + + + {{ formatDate(payOrder.expireTime) }} + @@ -61,7 +61,7 @@ - - + - (扫码枪/扫码盒) + (扫码枪/扫码盒) + 扫码 @@ -105,21 +106,22 @@ type="primary" @click="submit0(barCode.channelCode)" :disabled="barCode.value.length === 0" - >确认支付 + 确认支付 + 取 消 - + -