diff --git a/package.json b/package.json index a04c2520..2cf30fb6 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "nprogress": "^0.2.0", "pinia": "^2.1.6", "qrcode": "^1.5.3", + "qrcode.vue": "^3.4.0", "qs": "^6.11.2", "steady-xml": "^0.1.0", "url": "^0.11.1", diff --git a/src/api/pay/app/index.ts b/src/api/pay/app/index.ts index c19eb99b..286f97bb 100644 --- a/src/api/pay/app/index.ts +++ b/src/api/pay/app/index.ts @@ -76,3 +76,9 @@ export const exportApp = (params: AppExportReqVO) => { 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/demo/index.ts b/src/api/pay/demo/index.ts new file mode 100644 index 00000000..3824a8b2 --- /dev/null +++ b/src/api/pay/demo/index.ts @@ -0,0 +1,36 @@ +import request from '@/config/axios' + +export interface DemoOrderVO { + spuId: number + createTime: Date +} + +// 创建示例订单 +export function createDemoOrder(data: DemoOrderVO) { + return request.post({ + url: '/pay/demo-order/create', + data: data + }) +} + +// 获得示例订单 +export function getDemoOrder(id: number) { + return request.get({ + url: '/pay/demo-order/get?id=' + id + }) +} + +// 获得示例订单分页 +export function getDemoOrderPage(query: PageParam) { + return request.get({ + url: '/pay/demo-order/page', + params: query + }) +} + +// 退款示例订单 +export function refundDemoOrder(id) { + return request.put({ + url: '/pay/demo-order/refund?id=' + id + }) +} diff --git a/src/api/pay/notify/index.ts b/src/api/pay/notify/index.ts new file mode 100644 index 00000000..494c2216 --- /dev/null +++ b/src/api/pay/notify/index.ts @@ -0,0 +1,15 @@ +import request from '@/config/axios' + +export const getNotifyTaskDetail = (id) => { + return request.get({ + url: '/pay/notify/get-detail?id=' + id + }) +} + +// 获得支付通知分页 +export const getNotifyTaskPage = (query) => { + return request.get({ + url: '/pay/notify/page', + params: query + }) +} diff --git a/src/api/pay/order/index.ts b/src/api/pay/order/index.ts index 6621381a..95dda2c5 100644 --- a/src/api/pay/order/index.ts +++ b/src/api/pay/order/index.ts @@ -95,7 +95,7 @@ export const getOrderDetail = async (id: number) => { // 新增支付订单 export const createOrder = async (data: OrderVO) => { - return await request.post({ url: '/pay/order/create', data }) + return await request.post({ url: '/pay/order/submit', data }) } // 修改支付订单 diff --git a/src/assets/svgs/pay/icon/alipay_app.svg b/src/assets/svgs/pay/icon/alipay_app.svg new file mode 100644 index 00000000..ebf11883 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_app.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/alipay_bar.svg b/src/assets/svgs/pay/icon/alipay_bar.svg new file mode 100644 index 00000000..eb1e1e84 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_bar.svg @@ -0,0 +1,2 @@ + diff --git a/src/assets/svgs/pay/icon/alipay_pc.svg b/src/assets/svgs/pay/icon/alipay_pc.svg new file mode 100644 index 00000000..2a752770 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_pc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/alipay_qr.svg b/src/assets/svgs/pay/icon/alipay_qr.svg new file mode 100644 index 00000000..48337508 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_qr.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/alipay_wap.svg b/src/assets/svgs/pay/icon/alipay_wap.svg new file mode 100644 index 00000000..87075dbb --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_wap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/mock.svg b/src/assets/svgs/pay/icon/mock.svg new file mode 100644 index 00000000..27b09ead --- /dev/null +++ b/src/assets/svgs/pay/icon/mock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_app.svg b/src/assets/svgs/pay/icon/wx_app.svg new file mode 100644 index 00000000..ad40b2a2 --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_app.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_bar.svg b/src/assets/svgs/pay/icon/wx_bar.svg new file mode 100644 index 00000000..11292e6e --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_bar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_lite.svg b/src/assets/svgs/pay/icon/wx_lite.svg new file mode 100644 index 00000000..0c925cf3 --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_lite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_native.svg b/src/assets/svgs/pay/icon/wx_native.svg new file mode 100644 index 00000000..bf3ba2b6 --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_native.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_pub.svg b/src/assets/svgs/pay/icon/wx_pub.svg new file mode 100644 index 00000000..3a6d15b7 --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_pub.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 2a277a10..81f74d55 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -410,6 +410,24 @@ const remainingRouter: AppRouteRecordRaw[] = [ } } ] + }, + { + path: '/pay', + component: Layout, + name: 'pay', + meta: { hidden: true }, + children: [ + { + path: 'cashier', + name: 'PayCashier', + meta: { + title: '收银台', + noCache: true, + hidden: true + }, + component: () => import('@/views/pay/cashier/index.vue') + } + ] } ] diff --git a/src/utils/constants.ts b/src/utils/constants.ts index edde87d5..d5c29eb0 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -99,6 +99,10 @@ export const PayChannelEnum = { code: 'wx_app', name: '微信 APP 支付' }, + WX_BAR: { + code: 'wx_bar', + name: '微信条码支付' + }, ALIPAY_PC: { code: 'alipay_pc', name: '支付宝 PC 网站支付' @@ -125,6 +129,36 @@ export const PayChannelEnum = { } } +/** + * 支付的展示模式每局 + */ +export const PayDisplayModeEnum = { + URL: { + mode: 'url' + }, + IFRAME: { + mode: 'iframe' + }, + FORM: { + mode: 'form' + }, + QR_CODE: { + mode: 'qr_code' + }, + APP: { + mode: 'app' + } +} + +/** + * 支付类型枚举 + */ +export const PayType = { + WECHAT: 'WECHAT', + ALIPAY: 'ALIPAY', + MOCK: 'MOCK' +} + /** * 支付订单状态枚举 */ diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 67a92ba6..7b1287fb 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -134,13 +134,17 @@ export enum DICT_TYPE { 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_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', // 退款订单状态 PAY_REFUND_ORDER_TYPE = 'pay_refund_order_type', // 退款订单类别 + PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态 + PAY_NOTIFY_TYPE = 'pay_notify_type', // 商户支付回调状态 + // ========== MP 模块 ========== MP_AUTO_REPLY_REQUEST_MATCH = 'mp_auto_reply_request_match', // 自动回复请求匹配类型 MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型 diff --git a/src/views/pay/cashier/index.vue b/src/views/pay/cashier/index.vue new file mode 100644 index 00000000..44201fbe --- /dev/null +++ b/src/views/pay/cashier/index.vue @@ -0,0 +1,485 @@ + + + + + {{ payOrder.id }} + {{ payOrder.subject }} + {{ payOrder.body }} + ¥{{ (payOrder.price / 100.0).toFixed(2) }} + {{ + formatDate(payOrder.createTime) + }} + {{ + formatDate(payOrder.expireTime) + }} + + + + + + + + + + + {{ channel.name }} + + + + + + + + {{ channel.name }} + + + + + + + + {{ channel.name }} + + + + + + + + + + + + + + + + + + + + + 或使用 + (扫码枪/扫码盒) + 扫码 + + + + + + 确认支付 + 取 消 + + + + + + + diff --git a/src/views/pay/demo/index.vue b/src/views/pay/demo/index.vue new file mode 100644 index 00000000..d7ed0a1b --- /dev/null +++ b/src/views/pay/demo/index.vue @@ -0,0 +1,242 @@ + + + + + 发起订单 + + + + + + + + + + + ¥{{ (scope.row.price / 100.0).toFixed(2) }} + + + + + ¥{{ (scope.row.refundPrice / 100.0).toFixed(2) }} + + + + + + + + + + + + + {{ formatDate(scope.row.refundTime) }} + 退款中,等待退款结果 + + + + + 前往支付 + 发起退款 + + + + + + + + + + + + + {{ item.name }} + ¥{{ (item.price / 100.0).toFixed(2) }} + + + + + + 确 定 + 取 消 + + + + + diff --git a/src/views/pay/notify/index.vue b/src/views/pay/notify/index.vue new file mode 100644 index 00000000..0f9f4631 --- /dev/null +++ b/src/views/pay/notify/index.vue @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ scope.row.notifyTimes }} / {{ scope.row.maxNotifyTimes }} + + + + + + 查看详情 + + + + + + + + + + + + + {{ notifyDetail.merchantOrderId }} + + + + + + + {{ notifyDetail.appId }} + {{ notifyDetail.appName }} + + + {{ notifyDetail.dataId }} + + + + + + {{ notifyDetail.notifyTimes }} + {{ + notifyDetail.maxNotifyTimes + }} + + + {{ + formatDate(notifyDetail.lastExecuteTime) + }} + {{ + formatDate(notifyDetail.nextNotifyTime) + }} + + + {{ + formatDate(notifyDetail.createTime) + }} + {{ + formatDate(notifyDetail.updateTime) + }} + + + + + + + + + + + + + + + + {{ formatDate(scope.row.createTime) }} + + + + + + + + + + diff --git a/src/views/pay/order/OrderDetail.vue b/src/views/pay/order/OrderDetail.vue index 4716b258..79834444 100644 --- a/src/views/pay/order/OrderDetail.vue +++ b/src/views/pay/order/OrderDetail.vue @@ -19,11 +19,11 @@ - ¥{{ parseFloat(detailData.amount / 100, 2).toFixed(2) }} + ¥{{ parseFloat(detailData.price / 100, 2).toFixed(2) }} - ¥{{ parseFloat(detailData.channelFeeAmount / 100, 2).toFixed(2) }} + ¥{{ parseFloat(detailData.channelFeePrice / 100, 2).toFixed(2) }} @@ -61,7 +61,7 @@ {{ detailData.refundTimes }} - {{ parseFloat(detailData.refundAmount / 100, 2) }} + {{ parseFloat(detailData.refundPrice / 100, 2) }} diff --git a/src/views/pay/order/index.vue b/src/views/pay/order/index.vue index 4759af38..d4784efa 100644 --- a/src/views/pay/order/index.vue +++ b/src/views/pay/order/index.vue @@ -139,56 +139,7 @@ - - - - - - - - - - - - - - - - - 商户 - {{ scope.row.merchantOrderId }} - - - 支付 - {{ scope.row.channelOrderNo }} - - - - - - ¥{{ parseFloat(scope.row.amount / 100).toFixed(2) }} - - - - - ¥{{ parseFloat(scope.row.channelFeeAmount / 100).toFixed(2) }} - - - - - ¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }} - - - - - - - - - - - - + + + ¥{{ parseFloat(scope.row.price / 100).toFixed(2) }} + + + + ¥{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }} + + + + + ¥{{ parseFloat(scope.row.channelFeePrice / 100).toFixed(2) }} + + + + + + 商户 {{ scope.row.merchantOrderId }} + + + 支付 {{ scope.row.no }} + + + 渠道 {{ scope.row.channelOrderNo }} + + + + + + + + + + + + + + + @@ -231,7 +221,7 @@
- 商户 - {{ scope.row.merchantOrderId }} -
- 支付 - {{ scope.row.channelOrderNo }} -
+ 商户 {{ scope.row.merchantOrderId }} +
+ 支付 {{ scope.row.no }} +
+ 渠道 {{ scope.row.channelOrderNo }} +