瀏覽代碼

Merge branch 'master' of https://gitee.com/yudaocode/yudao-ui-admin-vue3

xingyu 1 年之前
父節點
當前提交
e262ab9504
共有 35 個文件被更改,包括 1291 次插入747 次删除
  1. 1 0
      package.json
  2. 5 18
      src/api/pay/app/index.ts
  3. 36 0
      src/api/pay/demo/index.ts
  4. 0 78
      src/api/pay/merchant/index.ts
  5. 16 0
      src/api/pay/notify/index.ts
  6. 3 13
      src/api/pay/order/index.ts
  7. 1 0
      src/assets/svgs/pay/icon/alipay_app.svg
  8. 1 0
      src/assets/svgs/pay/icon/alipay_bar.svg
  9. 1 0
      src/assets/svgs/pay/icon/alipay_pc.svg
  10. 2 0
      src/assets/svgs/pay/icon/alipay_qr.svg
  11. 1 0
      src/assets/svgs/pay/icon/alipay_wap.svg
  12. 1 0
      src/assets/svgs/pay/icon/mock.svg
  13. 2 0
      src/assets/svgs/pay/icon/wx_app.svg
  14. 0 0
      src/assets/svgs/pay/icon/wx_bar.svg
  15. 1 0
      src/assets/svgs/pay/icon/wx_lite.svg
  16. 1 0
      src/assets/svgs/pay/icon/wx_native.svg
  17. 2 0
      src/assets/svgs/pay/icon/wx_pub.svg
  18. 2 1
      src/config/axios/index.ts
  19. 2 3
      src/config/axios/service.ts
  20. 18 0
      src/router/modules/remaining.ts
  21. 30 70
      src/utils/constants.ts
  22. 4 5
      src/utils/dict.ts
  23. 3 0
      src/views/Login/components/LoginForm.vue
  24. 1 1
      src/views/infra/fileConfig/FileConfigForm.vue
  25. 4 4
      src/views/pay/app/components/AppForm.vue
  26. 1 23
      src/views/pay/app/index.vue
  27. 482 0
      src/views/pay/cashier/index.vue
  28. 238 0
      src/views/pay/demo/index.vue
  29. 0 113
      src/views/pay/merchant/MerchantForm.vue
  30. 0 245
      src/views/pay/merchant/index.vue
  31. 89 0
      src/views/pay/notify/NotifyDetail.vue
  32. 224 0
      src/views/pay/notify/index.vue
  33. 60 50
      src/views/pay/order/OrderDetail.vue
  34. 55 121
      src/views/pay/order/index.vue
  35. 4 2
      src/views/pay/refund/index.vue

+ 1 - 0
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",

+ 5 - 18
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,12 +57,9 @@ 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'
+  })
 }

+ 36 - 0
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
+  })
+}

+ 0 - 78
src/api/pay/merchant/index.ts

@@ -1,78 +0,0 @@
-import request from '@/config/axios'
-
-export interface MerchantVO {
-  id: number
-  no: string
-  name: string
-  shortName: string
-  status: number
-  remark: string
-  createTime: Date
-}
-
-export interface MerchantPageReqVO extends PageParam {
-  no?: string
-  name?: string
-  shortName?: string
-  status?: number
-  remark?: string
-  createTime?: Date[]
-}
-
-export interface MerchantExportReqVO {
-  no?: string
-  name?: string
-  shortName?: string
-  status?: number
-  remark?: string
-  createTime?: Date[]
-}
-
-// 查询列表支付商户
-export const getMerchantPage = (params: MerchantPageReqVO) => {
-  return request.get({ url: '/pay/merchant/page', params })
-}
-
-// 查询详情支付商户
-export const getMerchant = (id: number) => {
-  return request.get({ url: '/pay/merchant/get?id=' + id })
-}
-
-// 根据商户名称搜索商户列表
-export const getMerchantListByName = (name?: string) => {
-  return request.get({
-    url: '/pay/merchant/list-by-name',
-    params: {
-      name: name
-    }
-  })
-}
-
-// 新增支付商户
-export const createMerchant = (data: MerchantVO) => {
-  return request.post({ url: '/pay/merchant/create', data })
-}
-
-// 修改支付商户
-export const updateMerchant = (data: MerchantVO) => {
-  return request.put({ url: '/pay/merchant/update', data })
-}
-
-// 删除支付商户
-export const deleteMerchant = (id: number) => {
-  return request.delete({ url: '/pay/merchant/delete?id=' + id })
-}
-
-// 导出支付商户
-export const exportMerchant = (params: MerchantExportReqVO) => {
-  return request.download({ url: '/pay/merchant/export-excel', params })
-}
-
-// 支付商户状态修改
-export const updateMerchantStatus = (id: number, status: number) => {
-  const data = {
-    id,
-    status
-  }
-  return request.put({ url: '/pay/merchant/update-status', data: data })
-}

+ 16 - 0
src/api/pay/notify/index.ts

@@ -0,0 +1,16 @@
+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
+  })
+}

+ 3 - 13
src/api/pay/order/index.ts

@@ -93,19 +93,9 @@ export const getOrderDetail = async (id: number) => {
   return await request.get({ url: '/pay/order/get-detail?id=' + id })
 }
 
-// 新增支付订单
-export const createOrder = async (data: OrderVO) => {
-  return await request.post({ url: '/pay/order/create', 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 submitOrder = async (data: any) => {
+  return await request.post({ url: '/pay/order/submit', data })
 }
 
 // 导出支付订单

+ 1 - 0
src/assets/svgs/pay/icon/alipay_app.svg

@@ -0,0 +1 @@
+<svg t="1627279997305" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11904" width="40" height="40"><path d="M938.7008 669.525333L938.7008 249.412267c0-90.555733-73.5232-164.078933-164.1472-164.078933L249.378133 85.333333c-90.555733 0-164.078933 73.48906699-164.078933 164.078933l0 525.2096c0 90.555733 73.454933 164.078933 164.07893301 164.078933l525.20959999 0c80.725333 0 147.8656-58.368 161.553067-135.099733-43.52-18.8416-232.106667-100.283733-330.376533-147.182933-74.786133 90.589867-153.088 144.930133-271.121067 144.930133s-196.81279999-72.704-187.357867-161.655467c6.2464-58.402133 46.2848-153.9072 220.296533-137.5232 91.682133 8.6016 133.666133 25.736533 208.418133 50.414933 19.3536-35.4304 35.4304-74.513067 47.616-116.0192L292.0448 436.565333l0-32.8704 164.0448 0 0-58.9824L256 344.712533l1e-8-36.181333 200.12373299 0L456.123733 223.3344c0 0 1.809067-13.312 16.520533-13.31200001l82.056533 1e-8 0 98.474667 213.333333 0 0 36.181333-213.333333 1e-8 0 58.98239999 174.045867 0c-16.00853301 65.1264-40.277333 124.962133-70.690133 177.220267C708.608 599.176533 938.7008 669.525333 938.7008 669.525333L938.7008 669.525333 938.7008 669.525333 938.7008 669.525333zM321.57013299 744.994133c-124.7232 0-144.452267-78.7456-137.83039999-111.65013299 6.5536-32.733867 42.666667-75.502933 112.0256-75.50293301 79.6672 0 151.04 20.445867 236.714667 62.088533C472.302933 698.333867 398.370133 744.994133 321.57013299 744.994133L321.57013299 744.994133 321.57013299 744.994133zM321.57013299 744.994133" fill="#1296db" p-id="11905"></path></svg>

文件差異過大導致無法顯示
+ 1 - 0
src/assets/svgs/pay/icon/alipay_bar.svg


+ 1 - 0
src/assets/svgs/pay/icon/alipay_pc.svg

@@ -0,0 +1 @@
+<svg t="1627279878333" class="icon" viewBox="0 0 1285 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8535" width="40" height="40"><path d="M1141.76 855.04h-286.72c0 40.96 30.72 71.68 71.68 71.68h107.52c20.48 0 35.84 15.36 35.84 35.84s-15.36 35.84-35.84 35.84h-783.36c-20.48 0-35.84-15.36-35.84-35.84s15.36-35.84 35.84-35.84h107.52c40.96 0 71.68-30.72 71.68-71.68h-286.72c-76.8 0-143.36-61.44-143.36-143.36v-568.32c0-76.8 61.44-143.36 143.36-143.36h993.28c76.8 0 143.36 61.44 143.36 143.36v568.32c5.12 76.8-56.32 143.36-138.24 143.36z m71.68-711.68c0-40.96-30.72-71.68-71.68-71.68h-993.28c-40.96 0-71.68 30.72-71.68 71.68v568.32c0 40.96 30.72 71.68 71.68 71.68h993.28c40.96 0 71.68-30.72 71.68-71.68v-568.32z m-143.36 568.32h-855.04c-40.96 0-71.68-30.72-71.68-71.68v-424.96c0-40.96 30.72-71.68 71.68-71.68h855.04c40.96 0 71.68 30.72 71.68 71.68v424.96c0 40.96-30.72 71.68-71.68 71.68z" p-id="8536" fill="#1977FD"></path></svg>

+ 2 - 0
src/assets/svgs/pay/icon/alipay_qr.svg

@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1627279238245" class="icon" viewBox="0 0 1115 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4112" width="43.5546875" height="40" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
+</style></defs><path d="M751.388 68.267a34.133 34.133 0 0 1 0-68.267h227.556a91.022 91.022 0 0 1 91.022 91.022v227.556a34.133 34.133 0 1 1-68.266 0V91.022a22.756 22.756 0 0 0-22.756-22.755H751.388M1001.7 705.422a34.133 34.133 0 0 1 68.266 0v227.556A91.022 91.022 0 0 1 978.944 1024H748.885a34.133 34.133 0 0 1 0-68.267H978.49a22.756 22.756 0 0 0 22.755-22.755V705.422M364.09 955.733a34.133 34.133 0 1 1 0 68.267H136.533a91.022 91.022 0 0 1-91.022-91.022V705.422a34.133 34.133 0 0 1 68.267 0v227.556a22.756 22.756 0 0 0 22.755 22.755H364.09M113.778 318.578a34.133 34.133 0 1 1-68.267 0V91.022A91.022 91.022 0 0 1 136.533 0H364.09a34.133 34.133 0 0 1 0 68.267H136.533a22.756 22.756 0 0 0-22.755 22.755v227.556M34.133 477.867a34.133 34.133 0 0 0 0 68.266h168.619v-68.266z m1046.756 0H912.27v68.266h168.619a34.133 34.133 0 0 0 0-68.266zM202.752 157.24h709.746v320.627H202.752z m0 388.893h709.746V866.76H202.752z" fill="#1977FD" p-id="4113"></path></svg>

+ 1 - 0
src/assets/svgs/pay/icon/alipay_wap.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1645964864184" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8460" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40"><defs><style type="text/css"></style></defs><path d="M768.3 0 255.7 0c-70.8 0-128.1 57.4-128.1 128.1l0 767.8c0 70.8 57.4 128.1 128.1 128.1L512 1024l256.3 0c70.8 0 128.1-57.4 128.1-128.1L896.4 128.1C896.4 57.3 839 0 768.3 0zM383.9 96.1c0-17.7 14.3-32 32-32l192.2 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L415.9 128.1C398.2 128.1 383.9 113.8 383.9 96.1L383.9 96.1zM512 959.9 512 959.9 512 959.9c-35.4 0-64.1-28.8-64.1-64.1 0-35.4 28.7-64.1 64.1-64.1l0 0 0 0c35.4 0 64.1 28.7 64.1 64.1C576.1 931.1 547.4 959.9 512 959.9zM832.3 755.6c0 6.7-5.4 12.2-12.2 12.2L203.9 767.8c-6.7 0-12.2-5.4-12.2-12.2L191.7 204.3c0-6.7 5.4-12.2 12.2-12.2l616.3 0c6.7 0 12.2 5.4 12.2 12.2L832.4 755.6z" p-id="8461" fill="#1977FD"></path></svg>

+ 1 - 0
src/assets/svgs/pay/icon/mock.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676209854312" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3033" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M173.077333 362.666667l91.114667-214.677334a65.6 65.6 0 0 1 86.016-34.773333c11.584 4.906667 24.96 10.282667 40.896 16.448 8.277333 3.2 16.789333 6.464 27.904 10.666667 28.202667 10.709333 39.296 14.933333 46.144 17.642666l51.477333-51.669333c28.181333-28.16 74.112-27.946667 102.570667 0.533333l195.925333 195.925334c16.426667 16.426667 23.445333 38.634667 21.056 59.904H896a42.666667 42.666667 0 0 1 42.666667 42.666666v490.666667a42.666667 42.666667 0 0 1-42.666667 42.666667H128a42.666667 42.666667 0 0 1-42.666667-42.666667V405.333333a42.666667 42.666667 0 0 1 42.666667-42.666666h45.077333z m48.96 0h39.104l169.194667-169.770667-27.328-10.389333c-11.2-4.245333-19.818667-7.530667-28.224-10.794667a1459.2 1459.2 0 0 1-42.197333-17.002667 20.522667 20.522667 0 0 0-26.901334 10.88L222.037333 362.666667z m108.842667 0h454.954667a23.509333 23.509333 0 0 0-5.290667-25.322667l-195.925333-195.925333a23.36 23.36 0 0 0-33.024-0.213334L330.88 362.666667zM128 405.333333v490.666667h768V405.333333H128z m597.333333 320a85.333333 85.333333 0 1 1 0-170.666666 85.333333 85.333333 0 0 1 0 170.666666z m0-42.666666a42.666667 42.666667 0 1 0 0-85.333334 42.666667 42.666667 0 0 0 0 85.333334z" fill="#4296d5" p-id="3034"></path></svg>

+ 2 - 0
src/assets/svgs/pay/icon/wx_app.svg

@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1627279375144" class="icon" viewBox="0 0 1115 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4399" width="43.5546875" height="40" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
+</style></defs><path d="M751.388 68.267a34.133 34.133 0 0 1 0-68.267h227.556a91.022 91.022 0 0 1 91.022 91.022v227.556a34.133 34.133 0 1 1-68.266 0V91.022a22.756 22.756 0 0 0-22.756-22.755H751.388M1001.7 705.422a34.133 34.133 0 0 1 68.266 0v227.556A91.022 91.022 0 0 1 978.944 1024H748.885a34.133 34.133 0 0 1 0-68.267H978.49a22.756 22.756 0 0 0 22.755-22.755V705.422M364.09 955.733a34.133 34.133 0 1 1 0 68.267H136.533a91.022 91.022 0 0 1-91.022-91.022V705.422a34.133 34.133 0 0 1 68.267 0v227.556a22.756 22.756 0 0 0 22.755 22.755H364.09M113.778 318.578a34.133 34.133 0 1 1-68.267 0V91.022A91.022 91.022 0 0 1 136.533 0H364.09a34.133 34.133 0 0 1 0 68.267H136.533a22.756 22.756 0 0 0-22.755 22.755v227.556M34.133 477.867a34.133 34.133 0 0 0 0 68.266h168.619v-68.266z m1046.756 0H912.27v68.266h168.619a34.133 34.133 0 0 0 0-68.266zM202.752 157.24h709.746v320.627H202.752z m0 388.893h709.746V866.76H202.752z" fill="#04C361" p-id="4400"></path></svg>

文件差異過大導致無法顯示
+ 0 - 0
src/assets/svgs/pay/icon/wx_bar.svg


+ 1 - 0
src/assets/svgs/pay/icon/wx_lite.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676209433089" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2990" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M608.6 290.3c67.1 0 121.7 50.5 121.7 112.9 0 19.4-5.6 38.4-15.7 55.5-15.3 25-39.8 43.5-69.4 52.3-7.9 2.3-13.9 3.2-19.4 3.2-13 0-23.1-10.2-23.1-23.1 0-13 10.2-23.1 23.1-23.1 0.9 0 2.8 0 5.1-0.9 19.9-5.6 35.6-17.1 44.4-32.4 6-9.7 8.8-20.4 8.8-31.5 0-36.6-33.8-66.6-75-66.6-14.4 0-28.2 3.7-40.7 10.6-21.8 12.5-34.7 33.3-34.7 56v193.9c0 39.3-21.8 75.4-57.9 95.8-19.4 11.1-41.2 16.7-63.4 16.7-67.1 0-121.7-50.5-121.7-112.9 0-19.4 5.6-38.4 15.7-55.5 15.3-25 39.8-43.5 69.4-52.3 8.3-2.3 13.9-3.2 19.4-3.2 13 0 23.1 10.2 23.1 23.1 0 13-10.2 23.1-23.1 23.1-0.9 0-2.8 0-5.1 0.9-19.9 6-35.6 17.6-44.4 32.4-6 9.7-8.8 20.4-8.8 31.5 0 36.6 33.8 66.6 75.4 66.6 14.4 0 28.2-3.7 40.7-10.6 21.8-12.5 34.7-33.3 34.7-56V403.3c0-39.3 21.8-75.4 57.9-95.8 19-11.6 40.7-17.2 63-17.2zM510.8 929c231.1 0 418.4-187.3 418.4-418.4S741.9 92.1 510.8 92.1 92.4 279.5 92.4 510.6 279.7 929 510.8 929z m0 22C267.5 951 70.3 753.8 70.3 510.6S267.5 70.1 510.8 70.1s440.5 197.2 440.5 440.5S754.1 951 510.8 951z" p-id="2991" fill="#58bf6b"></path></svg>

+ 1 - 0
src/assets/svgs/pay/icon/wx_native.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1627279375144" class="icon" viewBox="0 0 1115 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4399" width="43.5546875" height="40" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url(&quot;//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix&quot;) format(&quot;embedded-opentype&quot;), url(&quot;//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2&quot;) format(&quot;woff2&quot;), url(&quot;//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff&quot;) format(&quot;woff&quot;), url(&quot;//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf&quot;) format(&quot;truetype&quot;), url(&quot;//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont&quot;) format(&quot;svg&quot;); }</style></defs><path d="M751.388 68.267a34.133 34.133 0 0 1 0-68.267h227.556a91.022 91.022 0 0 1 91.022 91.022v227.556a34.133 34.133 0 1 1-68.266 0V91.022a22.756 22.756 0 0 0-22.756-22.755H751.388M1001.7 705.422a34.133 34.133 0 0 1 68.266 0v227.556A91.022 91.022 0 0 1 978.944 1024H748.885a34.133 34.133 0 0 1 0-68.267H978.49a22.756 22.756 0 0 0 22.755-22.755V705.422M364.09 955.733a34.133 34.133 0 1 1 0 68.267H136.533a91.022 91.022 0 0 1-91.022-91.022V705.422a34.133 34.133 0 0 1 68.267 0v227.556a22.756 22.756 0 0 0 22.755 22.755H364.09M113.778 318.578a34.133 34.133 0 1 1-68.267 0V91.022A91.022 91.022 0 0 1 136.533 0H364.09a34.133 34.133 0 0 1 0 68.267H136.533a22.756 22.756 0 0 0-22.755 22.755v227.556M34.133 477.867a34.133 34.133 0 0 0 0 68.266h168.619v-68.266z m1046.756 0H912.27v68.266h168.619a34.133 34.133 0 0 0 0-68.266zM202.752 157.24h709.746v320.627H202.752z m0 388.893h709.746V866.76H202.752z" fill="#04C361" p-id="4400"/></svg>

+ 2 - 0
src/assets/svgs/pay/icon/wx_pub.svg

@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1627279797174" class="icon" viewBox="0 0 1260 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7665" xmlns:xlink="http://www.w3.org/1999/xlink" width="49.21875" height="40"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
+</style></defs><path d="M797.14798 481.753a269.194 269.194 0 0 0 102.892-211.929C900.03998 120.99 779.02998 0 630.15698 0 481.28298 0 360.27398 120.99 360.27398 269.824c0 85.878 40.33 162.462 102.912 211.929A450.974 450.974 0 0 0 309.84198 582.774c-85.543 85.524-132.608 199.208-132.608 320.236 0 25.01 0 51.712 0.197 76.367a44.898 44.898 0 0 0 44.82 44.623h816.01a44.8 44.8 0 0 0 44.82-44.623V903.01c0-121.009-47.066-234.732-132.609-320.236a451.072 451.072 0 0 0-153.344-101.021z" p-id="7666" fill="#04C361"></path><path d="M1186.18898 580.391A378.644 378.644 0 0 0 1061.81198 473.03a223.783 223.783 0 0 0 64.237-157.657c0-49.742-15.872-96.67-45.746-136.074A225.34 225.34 0 0 0 964.70998 99.9a37.297 37.297 0 0 0-46.14 25.718c-5.592 19.89 5.79 40.724 25.6 46.356 63.114 18.196 107.363 77.135 107.363 143.4a148.913 148.913 0 0 1-81.23 133.06 38.065 38.065 0 0 0-20.363 36.608c1.32 15.203 11.58 28.16 25.975 32.65 125.479 39.601 209.703 155.038 209.703 287.173v63.074c0 20.638 16.62 37.534 37.16 37.711h0.196a37.396 37.396 0 0 0 37.337-37.336V805.06c-0.197-81.644-25.777-159.35-74.142-224.69z m-901.77-62.503a36.982 36.982 0 0 0 25.955-32.65 37.455 37.455 0 0 0-20.362-36.628 148.913 148.913 0 0 1-81.231-133.06c0-66.245 44.071-125.184 107.382-143.4a37.612 37.612 0 0 0 25.58-46.356 37.376 37.376 0 0 0-46.139-25.718 225.32 225.32 0 0 0-115.593 79.4 223.252 223.252 0 0 0-45.746 136.074c0 60.258 23.533 116.381 64.237 157.676A380.475 380.475 0 0 0 74.14498 580.569 373.839 373.839 0 0 0 0.00198 805.258v63.232c0 20.657 16.798 37.356 37.356 37.356h0.197a37.317 37.317 0 0 0 37.14-37.73V805.06c0-132.332 84.401-247.769 209.723-287.173z" p-id="7667" fill="#04C361"></path></svg>

+ 2 - 1
src/config/axios/index.ts

@@ -5,12 +5,13 @@ import { config } from './config'
 const { default_headers } = config
 
 const request = (option: any) => {
-  const { url, method, params, data, headersType, responseType } = option
+  const { url, method, params, data, headersType, responseType, ...config } = option
   return service({
     url: url,
     method,
     params,
     data,
+    ...config,
     responseType: responseType,
     headers: {
       'Content-Type': headersType || default_headers

+ 2 - 3
src/config/axios/service.ts

@@ -31,7 +31,7 @@ let requestList: any[] = []
 // 是否正在刷新中
 let isRefreshToken = false
 // 请求白名单,无须token的接口
-const whiteList: string[] = ['/login', '/refresh-token']
+const whiteList: string[] = ['/login', '/refresh-token', '/system/tenant/get-id-by-name']
 
 // 创建axios实例
 const service: AxiosInstance = axios.create({
@@ -47,8 +47,7 @@ service.interceptors.request.use(
     let isToken = (config!.headers || {}).isToken === false
     whiteList.some((v) => {
       if (config.url) {
-        config.url.indexOf(v) > -1
-        return (isToken = false)
+        return (isToken = config.url.indexOf(v) > -1)
       }
     })
     if (getAccessToken() && !isToken) {

+ 18 - 0
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')
+      }
+    ]
   }
 ]
 

+ 30 - 70
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 网站支付'
@@ -126,94 +130,50 @@ export const PayChannelEnum = {
 }
 
 /**
- * 支付订单状态枚举
+ * 支付的展示模式每局
  */
-export const PayOrderStatusEnum = {
-  WAITING: {
-    status: 0,
-    name: '未支付'
+export const PayDisplayModeEnum = {
+  URL: {
+    mode: 'url'
   },
-  SUCCESS: {
-    status: 10,
-    name: '已支付'
+  IFRAME: {
+    mode: 'iframe'
   },
-  CLOSED: {
-    status: 20,
-    name: '未支付'
-  }
-}
-
-/**
- * 支付订单回调状态枚举
- */
-export const PayOrderNotifyStatusEnum = {
-  NO: {
-    status: 0,
-    name: '未通知'
+  FORM: {
+    mode: 'form'
   },
-  SUCCESS: {
-    status: 10,
-    name: '通知成功'
+  QR_CODE: {
+    mode: 'qr_code'
   },
-  FAILURE: {
-    status: 20,
-    name: '通知失败'
+  APP: {
+    mode: 'app'
   }
 }
 
 /**
- * 支付订单退款状态枚举
+ * 支付类型枚举
  */
-export const PayOrderRefundStatusEnum = {
-  NO: {
-    status: 0,
-    name: '未退款'
-  },
-  SOME: {
-    status: 10,
-    name: '部分退款'
-  },
-  ALL: {
-    status: 20,
-    name: '全部退款'
-  }
+export const PayType = {
+  WECHAT: 'WECHAT',
+  ALIPAY: 'ALIPAY',
+  MOCK: 'MOCK'
 }
 
 /**
- * 支付退款订单状态枚举
+ * 支付订单状态枚举
  */
-export const PayRefundStatusEnum = {
-  CREATE: {
+export const PayOrderStatusEnum = {
+  WAITING: {
     status: 0,
-    name: '退款订单生成'
+    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: '状态未知,系统查询结果'
+    status: 10,
+    name: '已支付'
   },
-  CLOSE: {
-    status: 99,
-    name: '退款关闭'
+  CLOSED: {
+    status: 20,
+    name: '未支付'
   }
 }
 

+ 4 - 5
src/utils/dict.ts

@@ -130,17 +130,16 @@ 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', // 退款订单状态
   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', // 消息类型

+ 3 - 0
src/views/Login/components/LoginForm.vue

@@ -148,6 +148,8 @@ import { ElLoading } from 'element-plus'
 import LoginFormTitle from './LoginFormTitle.vue'
 import type { RouteLocationNormalizedLoaded } from 'vue-router'
 
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+const { wsCache } = useCache()
 import { useIcon } from '@/hooks/web/useIcon'
 
 import * as authUtil from '@/utils/auth'
@@ -244,6 +246,7 @@ const handleLogin = async (params) => {
     if (!res) {
       return
     }
+    wsCache.delete(CACHE_KEY.USER) // 清除上次登录用户信息
     ElLoading.service({
       lock: true,
       text: '正在加载系统中...',

+ 1 - 1
src/views/infra/fileConfig/FileConfigForm.vue

@@ -67,7 +67,7 @@
       <el-form-item v-if="formData.storage === 11" label="连接模式" prop="config.mode">
         <el-radio-group v-model="formData.config.mode">
           <el-radio key="Active" label="Active">主动模式</el-radio>
-          <el-radio key="Passive" label="Passive">动模式</el-radio>
+          <el-radio key="Passive" label="Passive">动模式</el-radio>
         </el-radio-group>
       </el-form-item>
       <!-- S3 -->

+ 4 - 4
src/views/pay/app/components/AppForm.vue

@@ -21,8 +21,8 @@
           </el-radio>
         </el-radio-group>
       </el-form-item>
-      <el-form-item label="支付结果的回调地址" prop="payNotifyUrl">
-        <el-input v-model="formData.payNotifyUrl" placeholder="请输入支付结果的回调地址" />
+      <el-form-item label="支付结果的回调地址" prop="orderNotifyUrl">
+        <el-input v-model="formData.orderNotifyUrl" placeholder="请输入支付结果的回调地址" />
       </el-form-item>
       <el-form-item label="退款结果的回调地址" prop="refundNotifyUrl">
         <el-input v-model="formData.refundNotifyUrl" placeholder="请输入退款结果的回调地址" />
@@ -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()

+ 1 - 23
src/views/pay/app/index.vue

@@ -1,4 +1,5 @@
 <template>
+  <doc-alert title="支付功能开启" url="https://doc.iocoder.cn/pay/build/" />
   <!-- 搜索 -->
   <ContentWrap>
     <el-form
@@ -54,15 +55,6 @@
         >
           <Icon icon="ep:plus" class="mr-5px" /> 新增
         </el-button>
-        <el-button
-          type="success"
-          plain
-          @click="handleExport"
-          :loading="exportLoading"
-          v-hasPermi="['system:tenant:export']"
-        >
-          <Icon icon="ep:download" class="mr-5px" /> 导出
-        </el-button>
       </el-form-item>
     </el-form>
   </ContentWrap>
@@ -392,20 +384,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
-  }
-}
-
 /**
  * 根据渠道编码判断渠道列表中是否存在
  *

+ 482 - 0
src/views/pay/cashier/index.vue

@@ -0,0 +1,482 @@
+<template>
+  <!-- 支付信息 -->
+  <el-card v-loading="loading">
+    <el-descriptions title="支付信息" :column="3" border>
+      <el-descriptions-item label="支付单号">{{ payOrder.id }}</el-descriptions-item>
+      <el-descriptions-item label="商品标题">{{ payOrder.subject }}</el-descriptions-item>
+      <el-descriptions-item label="商品内容">{{ payOrder.body }}</el-descriptions-item>
+      <el-descriptions-item label="支付金额">
+        ¥{{ (payOrder.price / 100.0).toFixed(2) }}
+      </el-descriptions-item>
+      <el-descriptions-item label="创建时间">
+        {{ formatDate(payOrder.createTime) }}
+      </el-descriptions-item>
+      <el-descriptions-item label="过期时间">
+        {{ formatDate(payOrder.expireTime) }}
+      </el-descriptions-item>
+    </el-descriptions>
+  </el-card>
+
+  <!-- 支付选择框 -->
+  <el-card style="margin-top: 10px" v-loading="submitLoading" element-loading-text="提交支付中...">
+    <!-- 支付宝 -->
+    <el-descriptions title="选择支付宝支付" />
+    <div class="pay-channel-container">
+      <div
+        class="box"
+        v-for="channel in channelsAlipay"
+        :key="channel.code"
+        @click="submit(channel.code)"
+      >
+        <img :src="channel.icon" />
+        <div class="title">{{ channel.name }}</div>
+      </div>
+    </div>
+    <!-- 微信支付 -->
+    <el-descriptions title="选择微信支付" style="margin-top: 20px" />
+    <div class="pay-channel-container">
+      <div
+        class="box"
+        v-for="channel in channelsWechat"
+        :key="channel.code"
+        @click="submit(channel.code)"
+      >
+        <img :src="channel.icon" />
+        <div class="title">{{ channel.name }}</div>
+      </div>
+    </div>
+    <!-- 其它支付 -->
+    <el-descriptions title="选择其它支付" style="margin-top: 20px" />
+    <div class="pay-channel-container">
+      <div
+        class="box"
+        v-for="channel in channelsMock"
+        :key="channel.code"
+        @click="submit(channel.code)"
+      >
+        <img :src="channel.icon" />
+        <div class="title">{{ channel.name }}</div>
+      </div>
+    </div>
+  </el-card>
+
+  <!-- 展示形式:二维码 URL -->
+  <Dialog
+    :title="qrCode.title"
+    v-model="qrCode.visible"
+    width="350px"
+    append-to-body
+    :close-on-press-escape="false"
+  >
+    <qrcode-vue :value="qrCode.url" :size="310" level="L" />
+  </Dialog>
+
+  <!-- 展示形式:BarCode 条形码 -->
+  <Dialog
+    :title="barCode.title"
+    v-model="barCode.visible"
+    width="500px"
+    append-to-body
+    :close-on-press-escape="false"
+  >
+    <el-form ref="form" label-width="80px">
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="条形码" prop="name">
+            <el-input v-model="barCode.value" placeholder="请输入条形码" required />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <div style="text-align: right">
+            或使用
+            <el-link
+              type="danger"
+              target="_blank"
+              href="https://baike.baidu.com/item/条码支付/10711903"
+            >
+              (扫码枪/扫码盒)
+            </el-link>
+            扫码
+          </div>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <el-button
+        type="primary"
+        @click="submit0(barCode.channelCode)"
+        :disabled="barCode.value.length === 0"
+      >
+        确认支付
+      </el-button>
+      <el-button @click="barCode.visible = false">取 消</el-button>
+    </template>
+  </Dialog>
+</template>
+
+<script lang="ts" setup>
+import QrcodeVue from 'qrcode.vue'
+import * as PayOrderApi from '@/api/pay/order'
+import { PayChannelEnum, PayDisplayModeEnum, PayOrderStatusEnum } from '@/utils/constants'
+import { formatDate } from '@/utils/formatTime'
+import { useTagsViewStore } from '@/store/modules/tagsView'
+
+// 导入图标
+import svg_alipay_pc from '@/assets/svgs/pay/icon/alipay_pc.svg'
+import svg_alipay_wap from '@/assets/svgs/pay/icon/alipay_wap.svg'
+import svg_alipay_app from '@/assets/svgs/pay/icon/alipay_app.svg'
+import svg_alipay_qr from '@/assets/svgs/pay/icon/alipay_qr.svg'
+import svg_alipay_bar from '@/assets/svgs/pay/icon/alipay_bar.svg'
+import svg_wx_pub from '@/assets/svgs/pay/icon/wx_pub.svg'
+import svg_wx_lite from '@/assets/svgs/pay/icon/wx_lite.svg'
+import svg_wx_app from '@/assets/svgs/pay/icon/wx_app.svg'
+import svg_wx_native from '@/assets/svgs/pay/icon/wx_native.svg'
+import svg_wx_bar from '@/assets/svgs/pay/icon/wx_bar.svg'
+import svg_mock from '@/assets/svgs/pay/icon/mock.svg'
+
+defineOptions({ name: 'PayCashier' })
+
+const message = useMessage() // 消息弹窗
+const route = useRoute() // 路由
+const { push, currentRoute } = useRouter() // 路由
+const { delView } = useTagsViewStore() // 视图操作
+
+const id = ref(undefined) // 支付单号
+const returnUrl = ref<string | undefined>(undefined) // 支付完的回调地址
+const loading = ref(false) // 支付信息的 loading
+const payOrder = ref({}) // 支付信息
+const channelsAlipay = [
+  {
+    name: '支付宝 PC 网站支付',
+    icon: svg_alipay_pc,
+    code: 'alipay_pc'
+  },
+  {
+    name: '支付宝 Wap 网站支付',
+    icon: svg_alipay_wap,
+    code: 'alipay_wap'
+  },
+  {
+    name: '支付宝 App 网站支付',
+    icon: svg_alipay_app,
+    code: 'alipay_app'
+  },
+  {
+    name: '支付宝扫码支付',
+    icon: svg_alipay_qr,
+    code: 'alipay_qr'
+  },
+  {
+    name: '支付宝条码支付',
+    icon: svg_alipay_bar,
+    code: 'alipay_bar'
+  }
+]
+const channelsWechat = [
+  {
+    name: '微信公众号支付',
+    icon: svg_wx_pub,
+    code: 'wx_pub'
+  },
+  {
+    name: '微信小程序支付',
+    icon: svg_wx_lite,
+    code: 'wx_lite'
+  },
+  {
+    name: '微信 App 支付',
+    icon: svg_wx_app,
+    code: 'wx_app'
+  },
+  {
+    name: '微信扫码支付',
+    icon: svg_wx_native,
+    code: 'wx_native'
+  },
+  {
+    name: '微信条码支付',
+    icon: svg_wx_bar,
+    code: 'wx_bar'
+  }
+]
+const channelsMock = [
+  {
+    name: '模拟支付',
+    icon: svg_mock,
+    code: 'mock'
+  }
+]
+
+const submitLoading = ref(false) // 提交支付的 loading
+const interval = ref<any>(undefined) // 定时任务,轮询是否完成支付
+const qrCode = ref({
+  // 展示形式:二维码
+  url: '',
+  title: '',
+  visible: false
+})
+const barCode = ref({
+  // 展示形式:条形码
+  channelCode: '',
+  value: '',
+  title: '',
+  visible: false
+})
+
+/** 获得支付信息 */
+const getDetail = async () => {
+  // 1.1 未传递订单编号
+  if (!id.value) {
+    message.error('未传递支付单号,无法查看对应的支付信息')
+    goReturnUrl('cancel')
+    return
+  }
+  const data = await PayOrderApi.getOrder(id.value)
+  payOrder.value = data
+  // 1.2 无法查询到支付信息
+  if (!data) {
+    message.error('支付订单不存在,请检查!')
+    goReturnUrl('cancel')
+    return
+  }
+  // 1.3 如果已支付、或者已关闭,则直接跳转
+  if (data.status === PayOrderStatusEnum.SUCCESS.status) {
+    message.success('支付成功')
+    goReturnUrl('success')
+    return
+  } else if (data.status === PayOrderStatusEnum.CLOSED.status) {
+    message.error('无法支付,原因:订单已关闭')
+    goReturnUrl('close')
+    return
+  }
+}
+
+/** 提交支付 */
+const submit = (channelCode) => {
+  // 条形码支付,需要特殊处理
+  if (channelCode === PayChannelEnum.ALIPAY_BAR.code) {
+    barCode.value = {
+      channelCode: channelCode,
+      value: '',
+      title: '“支付宝”条码支付',
+      visible: true
+    }
+    return
+  }
+  if (channelCode === PayChannelEnum.WX_BAR.code) {
+    barCode.value = {
+      channelCode: channelCode,
+      value: '',
+      title: '“微信”条码支付',
+      visible: true
+    }
+    return
+  }
+
+  // 微信公众号、小程序支付,无法在 PC 网页中进行
+  if (channelCode === PayChannelEnum.WX_PUB.code) {
+    message.error('微信公众号支付:不支持 PC 网站')
+    return
+  }
+  if (channelCode === PayChannelEnum.WX_LITE.code) {
+    message.error('微信小程序:不支持 PC 网站')
+    return
+  }
+
+  // 默认的提交处理
+  submit0(channelCode)
+}
+
+const submit0 = async (channelCode) => {
+  submitLoading.value = true
+  try {
+    const formData = {
+      id: id.value,
+      channelCode: channelCode,
+      returnUrl: location.href, // 支付成功后,支付渠道跳转回当前页;再由当前页,跳转回 {@link returnUrl} 对应的地址
+      ...buildSubmitParam(channelCode)
+    }
+    const data = await PayOrderApi.submitOrder(formData)
+    // 直接返回已支付的情况,例如说扫码支付
+    if (data.status === PayOrderStatusEnum.SUCCESS.status) {
+      clearQueryInterval()
+      message.success('支付成功!')
+      goReturnUrl('success')
+      return
+    }
+
+    // 展示对应的界面
+    if (data.displayMode === PayDisplayModeEnum.URL.mode) {
+      displayUrl(channelCode, data)
+    } else if (data.displayMode === PayDisplayModeEnum.QR_CODE.mode) {
+      displayQrCode(channelCode, data)
+    } else if (data.displayMode === PayDisplayModeEnum.APP.mode) {
+      displayApp(channelCode)
+    }
+
+    // 打开轮询任务
+    createQueryInterval()
+  } finally {
+    submitLoading.value = false
+  }
+}
+
+/** 构建提交支付的额外参数 */
+const buildSubmitParam = (channelCode) => {
+  // ① 支付宝 BarCode 支付时,需要传递 authCode 条形码
+  if (channelCode === PayChannelEnum.ALIPAY_BAR.code) {
+    return {
+      channelExtras: {
+        auth_code: barCode.value.value
+      }
+    }
+  }
+  // ② 微信 BarCode 支付时,需要传递 authCode 条形码
+  if (channelCode === PayChannelEnum.WX_BAR.code) {
+    return {
+      channelExtras: {
+        authCode: barCode.value.value
+      }
+    }
+  }
+  return {}
+}
+
+/** 提交支付后,URL 的展示形式 */
+const displayUrl = (_channelCode, data) => {
+  location.href = data.displayContent
+  submitLoading.value = false
+}
+
+/** 提交支付后(扫码支付) */
+const displayQrCode = (channelCode, data) => {
+  let title = '请使用手机浏览器“扫一扫”'
+  if (channelCode === PayChannelEnum.ALIPAY_WAP.code) {
+    // 考虑到 WAP 测试,所以引导手机浏览器搞
+  } else if (channelCode.indexOf('alipay_') === 0) {
+    title = '请使用支付宝“扫一扫”扫码支付'
+  } else if (channelCode.indexOf('wx_') === 0) {
+    title = '请使用微信“扫一扫”扫码支付'
+  }
+  qrCode.value = {
+    title: title,
+    url: data.displayContent,
+    visible: true
+  }
+  submitLoading.value = false
+}
+
+/** 提交支付后(App) */
+const displayApp = (channelCode) => {
+  if (channelCode === PayChannelEnum.ALIPAY_APP.code) {
+    message.error('支付宝 App 支付:无法在网页支付!')
+  }
+  if (channelCode === PayChannelEnum.WX_APP.code) {
+    message.error('微信 App 支付:无法在网页支付!')
+  }
+  submitLoading.value = false
+}
+
+/** 轮询查询任务 */
+const createQueryInterval = () => {
+  if (interval.value) {
+    return
+  }
+  interval.value = setInterval(async () => {
+    const data = await PayOrderApi.getOrder(id.value)
+    // 已支付
+    if (data.status === PayOrderStatusEnum.SUCCESS.status) {
+      clearQueryInterval()
+      message.success('支付成功!')
+      goReturnUrl('success')
+    }
+    // 已取消
+    if (data.status === PayOrderStatusEnum.CLOSED.status) {
+      clearQueryInterval()
+      message.error('支付已关闭!')
+      goReturnUrl('close')
+    }
+  }, 1000 * 2)
+}
+
+/** 清空查询任务 */
+const clearQueryInterval = () => {
+  // 清空各种弹窗
+  qrCode.value = {
+    title: '',
+    url: '',
+    visible: false
+  }
+  // 清空任务
+  clearInterval(interval.value)
+  interval.value = undefined
+}
+
+/**
+ * 回到业务的 URL
+ *
+ * @param payResult 支付结果
+ *                  ① success:支付成功
+ *                  ② cancel:取消支付
+ *                  ③ close:支付已关闭
+ */
+const goReturnUrl = (payResult) => {
+  // 清理任务
+  clearQueryInterval()
+
+  // 未配置的情况下,只能关闭
+  if (!returnUrl.value) {
+    delView(unref(currentRoute))
+    return
+  }
+
+  const url =
+    returnUrl.value.indexOf('?') >= 0
+      ? returnUrl.value + '&payResult=' + payResult
+      : returnUrl.value + '?payResult=' + payResult
+  // 如果有配置,且是 http 开头,则浏览器跳转
+  if (returnUrl.value.indexOf('http') === 0) {
+    location.href = url
+  } else {
+    delView(unref(currentRoute))
+    push({
+      path: url
+    })
+  }
+}
+
+/** 初始化 */
+onMounted(() => {
+  id.value = route.query.id
+  if (route.query.returnUrl) {
+    returnUrl.value = decodeURIComponent(route.query.returnUrl)
+  }
+  getDetail()
+})
+</script>
+
+<style lang="scss" scoped>
+.pay-channel-container {
+  display: flex;
+  margin-top: -10px;
+
+  .box {
+    width: 160px;
+    border: 1px solid #e6ebf5;
+    cursor: pointer;
+    text-align: center;
+    padding-top: 10px;
+    padding-bottom: 5px;
+    margin-right: 10px;
+
+    img {
+      width: 40px;
+      height: 40px;
+    }
+
+    .title {
+      padding-top: 5px;
+    }
+  }
+}
+</style>

+ 238 - 0
src/views/pay/demo/index.vue

@@ -0,0 +1,238 @@
+<template>
+  <doc-alert title="支付宝支付接入" url="https://doc.iocoder.cn/pay/alipay-pay-demo/" />
+  <doc-alert title="支付宝、微信退款接入" url="https://doc.iocoder.cn/pay/refund-demo/" />
+  <doc-alert title="微信公众号支付接入" url="https://doc.iocoder.cn/pay/wx-pub-pay-demo/" />
+  <doc-alert title="微信小程序支付接入" url="https://doc.iocoder.cn/pay/wx-lite-pay-demo/" />
+
+  <!-- 操作工具栏 -->
+  <el-row :gutter="10" class="mb8">
+    <el-col :span="1.5">
+      <el-button type="primary" plain @click="openForm"><Icon icon="ep:plus" />发起订单</el-button>
+    </el-col>
+  </el-row>
+
+  <!-- 列表 -->
+  <ContentWrap>
+    <el-table v-loading="loading" :data="list">
+      <el-table-column label="订单编号" align="center" prop="id" />
+      <el-table-column label="用户编号" align="center" prop="userId" />
+      <el-table-column label="商品名字" align="center" prop="spuName" />
+      <el-table-column label="支付价格" align="center" prop="price">
+        <template #default="scope">
+          <span>¥{{ (scope.row.price / 100.0).toFixed(2) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="退款金额" align="center" prop="refundPrice">
+        <template #default="scope">
+          <span>¥{{ (scope.row.refundPrice / 100.0).toFixed(2) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+        width="180"
+        :formatter="dateFormatter"
+      />
+      <el-table-column label="支付单号" align="center" prop="payOrderId" />
+      <el-table-column label="是否支付" align="center" prop="payStatus">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.payStatus" />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="支付时间"
+        align="center"
+        prop="payTime"
+        width="180"
+        :formatter="dateFormatter"
+      />
+      <el-table-column label="退款时间" align="center" prop="refundTime" width="180">
+        <template #default="scope">
+          <span v-if="scope.row.refundTime">{{ formatDate(scope.row.refundTime) }}</span>
+          <span v-else-if="scope.row.payRefundId">退款中,等待退款结果</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template #default="scope">
+          <el-button link type="primary" @click="handlePay(scope.row)" v-if="!scope.row.payStatus">
+            前往支付
+          </el-button>
+          <el-button
+            link
+            type="danger"
+            @click="handleRefund(scope.row)"
+            v-if="scope.row.payStatus && !scope.row.payRefundId"
+          >
+            发起退款
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 分页组件 -->
+    <Pagination
+      :total="total"
+      v-model:page="queryParams.pageNo"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </ContentWrap>
+
+  <!-- 对话框(添加 / 修改) -->
+  <Dialog title="发起订单" v-model="dialogVisible" width="500px">
+    <el-form
+      ref="formRef"
+      v-loading="formLoading"
+      :model="formData"
+      :rules="formRules"
+      label-width="80px"
+    >
+      <el-form-item label="商品" prop="spuId">
+        <el-select
+          v-model="formData.spuId"
+          placeholder="请输入下单商品"
+          clearable
+          style="width: 380px"
+        >
+          <el-option v-for="item in spus" :key="item.id" :label="item.name" :value="item.id">
+            <span style="float: left">{{ item.name }}</span>
+            <span style="float: right; color: #8492a6; font-size: 13px">
+              ¥{{ (item.price / 100.0).toFixed(2) }}
+            </span>
+          </el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="dialogVisible = false">取 消</el-button>
+    </template>
+  </Dialog>
+</template>
+<script lang="ts" setup name="PayDemoOrder">
+import * as PayDemoApi from '@/api/pay/demo'
+import { dateFormatter, formatDate } from '@/utils/formatTime'
+import { DICT_TYPE } from '@/utils/dict'
+
+const { t } = useI18n() // 国际化
+const router = useRouter() // 路由对象
+const message = useMessage() // 消息弹窗
+
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数据
+const queryParams = ref({
+  pageNo: 1,
+  pageSize: 10
+})
+
+const formRef = ref()
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await PayDemoApi.getDemoOrderPage(queryParams)
+    list.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 支付按钮操作 */
+const handlePay = (row) => {
+  router.push({
+    name: 'PayCashier',
+    query: {
+      id: row.payOrderId,
+      returnUrl: encodeURIComponent('/pay/demo-order?id=' + row.id)
+    }
+  })
+}
+
+/** 退款按钮操作 */
+const handleRefund = async (row: any) => {
+  const id = row.id
+  try {
+    await message.confirm('是否确认退款编号为"' + id + '"的示例订单?')
+    await PayDemoApi.refundDemoOrder(id)
+    await getList()
+    message.success('发起退款成功!')
+  } catch {}
+}
+
+// ========== 弹窗 ==========
+
+// 商品数组
+const spus = ref([
+  {
+    id: 1,
+    name: '华为手机',
+    price: 1
+  },
+  {
+    id: 2,
+    name: '小米电视',
+    price: 10
+  },
+  {
+    id: 3,
+    name: '苹果手表',
+    price: 100
+  },
+  {
+    id: 4,
+    name: '华硕笔记本',
+    price: 1000
+  },
+  {
+    id: 5,
+    name: '蔚来汽车',
+    price: 200000
+  }
+])
+
+const dialogVisible = ref(false) // 弹窗的是否展示
+const formLoading = ref(false) // 表单的加载中
+const formData = ref({}) // 表单数据
+const formRules = {
+  spuId: [{ required: true, message: '商品编号不能为空', trigger: 'blur' }]
+}
+
+/** 表单重置 */
+const reset = () => {
+  formData.value = {
+    spuId: undefined
+  }
+  formRef.value?.resetFields()
+}
+
+/** 新增按钮操作 */
+const openForm = () => {
+  reset()
+  dialogVisible.value = true
+}
+
+/** 提交按钮 */
+const submitForm = async () => {
+  // 校验表单
+  if (!formRef) return
+  const valid = await formRef.value.validate()
+  if (!valid) return
+  // 提交请求
+  formLoading.value = true
+  try {
+    await PayDemoApi.createDemoOrder(formData.value)
+    message.success(t('common.createSuccess'))
+    dialogVisible.value = false
+  } finally {
+    formLoading.value = false
+  }
+}
+
+/** 初始化 **/
+onMounted(() => {
+  getList()
+})
+</script>

+ 0 - 113
src/views/pay/merchant/MerchantForm.vue

@@ -1,113 +0,0 @@
-<template>
-  <Dialog v-model="dialogVisible" :title="dialogTitle">
-    <el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
-      <el-form-item label="商户全称" prop="name">
-        <el-input v-model="formData.name" placeholder="请输入商户全称" />
-      </el-form-item>
-      <el-form-item label="商户简称" prop="shortName">
-        <el-input v-model="formData.shortName" placeholder="请输入商户简称" />
-      </el-form-item>
-      <el-form-item label="开启状态" prop="status">
-        <el-select v-model="formData.status" clearable placeholder="请选择状态">
-          <el-option
-            v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="备注" prop="remark">
-        <el-input v-model="formData.remark" placeholder="请输入备注" type="textarea" />
-      </el-form-item>
-    </el-form>
-    <template #footer>
-      <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
-      <el-button @click="dialogVisible = false">取 消</el-button>
-    </template>
-  </Dialog>
-</template>
-<script lang="ts" setup>
-import * as MerchantApi from '@/api/pay/merchant'
-import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
-import { CommonStatusEnum } from '@/utils/constants'
-
-defineOptions({ name: 'PayMerchantForm' })
-
-const { t } = useI18n() // 国际化
-const message = useMessage() // 消息弹窗
-
-const dialogVisible = ref(false) // 弹窗的是否展示
-const dialogTitle = ref('') // 弹窗的标题
-const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
-const formType = ref('') // 表单的类型:create - 新增;update - 修改
-const formData = ref({
-  id: undefined,
-  name: '',
-  shortName: '',
-  status: CommonStatusEnum.ENABLE,
-  remark: ''
-})
-const formRules = reactive({
-  name: [{ required: true, message: '商户名称不能为空', trigger: 'blur' }],
-  shortName: [{ required: true, message: '商户简称不能为空', trigger: 'blur' }],
-  status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
-})
-const formRef = ref() // 表单 Ref
-
-/** 打开弹窗 */
-const open = async (type: string, id?: number) => {
-  dialogVisible.value = true
-  dialogTitle.value = t('action.' + type)
-  formType.value = type
-  resetForm()
-  // 修改时,设置数据
-  if (id) {
-    formLoading.value = true
-    try {
-      formData.value = await MerchantApi.getMerchant(id)
-    } finally {
-      formLoading.value = false
-    }
-  }
-}
-defineExpose({ open }) // 提供 open 方法,用于打开弹窗
-
-/** 提交表单 */
-const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
-const submitForm = async () => {
-  // 校验表单
-  if (!formRef) return
-  const valid = await formRef.value.validate()
-  if (!valid) return
-  // 提交请求
-  formLoading.value = true
-  try {
-    const data = formData.value as unknown as MerchantApi.MerchantVO
-    if (formType.value === 'create') {
-      await MerchantApi.createMerchant(data)
-      message.success(t('common.createSuccess'))
-    } else {
-      await MerchantApi.updateMerchant(data)
-      message.success(t('common.updateSuccess'))
-    }
-    dialogVisible.value = false
-    // 发送操作成功的事件
-    emit('success')
-  } finally {
-    formLoading.value = false
-  }
-}
-
-/** 重置表单 */
-const resetForm = () => {
-  formData.value = {
-    id: undefined,
-    name: '',
-    shortName: '',
-    status: CommonStatusEnum.ENABLE,
-    remark: ''
-  }
-  formRef.value?.resetFields()
-}
-</script>

+ 0 - 245
src/views/pay/merchant/index.vue

@@ -1,245 +0,0 @@
-<template>
-  <ContentWrap>
-    <!-- 搜索工作栏 -->
-    <el-form
-      class="-mb-15px"
-      :model="queryParams"
-      ref="queryFormRef"
-      :inline="true"
-      label-width="68px"
-    >
-      <el-form-item label="商户号" prop="no">
-        <el-input v-model="queryParams.no" placeholder="请输入商户号" clearable class="!w-240px" />
-      </el-form-item>
-      <el-form-item label="商户全称" prop="name">
-        <el-input
-          v-model="queryParams.name"
-          placeholder="请输入商户全称"
-          clearable
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="商户简称" prop="shortName">
-        <el-input
-          v-model="queryParams.shortName"
-          placeholder="请输入商户简称"
-          clearable
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="开启状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="字典状态" clearable class="!w-240px">
-          <el-option
-            v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="备注" prop="remark">
-        <el-input
-          v-model="queryParams.remark"
-          placeholder="请输入备注"
-          clearable
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createTime">
-        <el-date-picker
-          v-model="queryParams.createTime"
-          value-format="YYYY-MM-DD HH:mm:ss"
-          type="datetimerange"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
-        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
-        <el-button
-          plain
-          type="primary"
-          @click="openForm('create')"
-          v-hasPermi="['pay:merchant:create']"
-        >
-          <Icon icon="ep:plus" class="mr-5px" /> 新增
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          @click="handleExport"
-          :loading="exportLoading"
-          v-hasPermi="['pay:merchant:export']"
-        >
-          <Icon icon="ep:download" class="mr-5px" /> 导出
-        </el-button>
-      </el-form-item>
-    </el-form>
-  </ContentWrap>
-
-  <!-- 列表 -->
-  <ContentWrap>
-    <el-table v-loading="loading" :data="list">
-      <el-table-column label="商户编号" align="center" prop="id" />
-      <el-table-column label="商户号" align="center" prop="no" />
-      <el-table-column label="商户全称" align="center" prop="name" />
-      <el-table-column label="商户简称" align="center" prop="shortName" />
-      <el-table-column label="开启状态" align="center" prop="status">
-        <template #default="scope">
-          <el-switch
-            v-model="scope.row.status"
-            :active-value="0"
-            :inactive-value="1"
-            @change="handleStatusChange(scope.row)"
-          />
-        </template>
-      </el-table-column>
-      <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column
-        label="创建时间"
-        align="center"
-        prop="createTime"
-        :formatter="dateFormatter"
-        width="180"
-      />
-      <el-table-column label="操作" align="center">
-        <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            @click="openForm('update', scope.row.id)"
-            v-hasPermi="['pay:merchant:update']"
-          >
-            修改
-          </el-button>
-          <el-button
-            link
-            type="danger"
-            @click="handleDelete(scope.row.id)"
-            v-hasPermi="['pay:merchant:delete']"
-          >
-            删除
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <!-- 分页 -->
-    <Pagination
-      :total="total"
-      v-model:page="queryParams.pageNo"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-  </ContentWrap>
-
-  <!-- 表单弹窗:添加/修改 -->
-  <MerchantForm ref="formRef" @success="getList" />
-</template>
-<script lang="ts" setup>
-import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
-import { CommonStatusEnum } from '@/utils/constants'
-import { dateFormatter } from '@/utils/formatTime'
-import download from '@/utils/download'
-import * as MerchantApi from '@/api/pay/merchant'
-import MerchantForm from './MerchantForm.vue'
-
-defineOptions({ name: 'PayMerchant' })
-
-const message = useMessage() // 消息弹窗
-const { t } = useI18n() // 国际化
-
-const loading = ref(true) // 列表的加载中
-const total = ref(0) // 列表的总页数
-const list = ref([]) // 列表的数据
-const queryParams = reactive({
-  pageNo: 1,
-  pageSize: 10,
-  name: '',
-  shortName: '',
-  status: undefined
-})
-const queryFormRef = ref() // 搜索的表单
-const exportLoading = ref(false) // 导出的加载中
-
-/** 查询列表 */
-const getList = async () => {
-  loading.value = true
-  try {
-    const data = await MerchantApi.getMerchantPage(queryParams)
-    list.value = data.list
-    total.value = data.total
-  } finally {
-    loading.value = false
-  }
-}
-
-/** 搜索按钮操作 */
-const handleQuery = () => {
-  queryParams.pageNo = 1
-  getList()
-}
-
-/** 重置按钮操作 */
-const resetQuery = () => {
-  queryFormRef.value.resetFields()
-  handleQuery()
-}
-
-/** 添加/修改操作 */
-const formRef = ref()
-const openForm = (type: string, id?: number) => {
-  formRef.value.open(type, id)
-}
-
-/** 删除按钮操作 */
-const handleDelete = async (id: number) => {
-  try {
-    // 删除的二次确认
-    await message.delConfirm()
-    // 发起删除
-    await MerchantApi.deleteMerchant(id)
-    message.success(t('common.delSuccess'))
-    // 刷新列表
-    await getList()
-  } catch {}
-}
-
-/** 修改状态操作 */
-const handleStatusChange = async (row: MerchantApi.MerchantVO) => {
-  try {
-    // 修改状态的二次确认
-    const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
-    await message.confirm('确认要"' + text + '""' + row.name + '"商户吗?', t('common.reminder'))
-    // 发起修改状态
-    await MerchantApi.updateMerchantStatus(row.id, row.status)
-    // 刷新列表
-    await getList()
-  } catch {
-    // 取消后,进行恢复按钮
-    row.status =
-      row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
-  }
-}
-
-/** 导出按钮操作 */
-const handleExport = async () => {
-  try {
-    // 导出的二次确认
-    await message.exportConfirm()
-    // 发起导出
-    exportLoading.value = true
-    const data = await MerchantApi.exportMerchant(queryParams)
-    download.excel(data, '商户信息.xls')
-  } catch {
-  } finally {
-    exportLoading.value = false
-  }
-}
-
-/** 初始化 **/
-onMounted(() => {
-  getList()
-})
-</script>

+ 89 - 0
src/views/pay/notify/NotifyDetail.vue

@@ -0,0 +1,89 @@
+<template>
+  <Dialog v-model="dialogVisible" title="通知详情" width="50%">
+    <el-descriptions :column="2">
+      <el-descriptions-item label="商户订单编号">
+        <el-tag>{{ detailData.merchantOrderId }}</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="通知状态">
+        <dict-tag :type="DICT_TYPE.PAY_NOTIFY_STATUS" :value="detailData.status" />
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2">
+      <el-descriptions-item label="应用编号">{{ detailData.appId }}</el-descriptions-item>
+      <el-descriptions-item label="应用名称">{{ detailData.appName }}</el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2">
+      <el-descriptions-item label="关联编号">{{ detailData.dataId }}</el-descriptions-item>
+      <el-descriptions-item label="通知类型">
+        <dict-tag :type="DICT_TYPE.PAY_NOTIFY_TYPE" :value="detailData.type" />
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2">
+      <el-descriptions-item label="通知次数">{{ detailData.notifyTimes }}</el-descriptions-item>
+      <el-descriptions-item label="最大通知次数">
+        {{ detailData.maxNotifyTimes }}
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2">
+      <el-descriptions-item label="最后通知时间">
+        {{ formatDate(detailData.lastExecuteTime) }}
+      </el-descriptions-item>
+      <el-descriptions-item label="下次通知时间">
+        {{ formatDate(detailData.nextNotifyTime) }}
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2">
+      <el-descriptions-item label="创建时间">
+        {{ formatDate(detailData.createTime) }}
+      </el-descriptions-item>
+      <el-descriptions-item label="更新时间">
+        {{ formatDate(detailData.updateTime) }}
+      </el-descriptions-item>
+    </el-descriptions>
+    <!-- 分割线 -->
+    <el-divider />
+    <el-descriptions :column="1" direction="vertical" border>
+      <el-descriptions-item label="回调日志">
+        <el-table :data="detailData.logs">
+          <el-table-column label="日志编号" align="center" prop="id" />
+          <el-table-column label="通知状态" align="center" prop="status">
+            <template #default="scope">
+              <dict-tag :type="DICT_TYPE.PAY_NOTIFY_STATUS" :value="scope.row.status" />
+            </template>
+          </el-table-column>
+          <el-table-column label="通知次数" align="center" prop="notifyTimes" />
+          <el-table-column label="通知时间" align="center" prop="lastExecuteTime" width="180">
+            <template #default="scope">
+              <span>{{ formatDate(scope.row.createTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="响应结果" align="center" prop="response" />
+        </el-table>
+      </el-descriptions-item>
+    </el-descriptions>
+  </Dialog>
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE } from '@/utils/dict'
+import * as PayNotifyApi from '@/api/pay/notify'
+import { formatDate } from '@/utils/formatTime'
+
+defineOptions({ name: 'PayNotifyDetail' })
+
+const dialogVisible = ref(false) // 弹窗的是否展示
+const detailLoading = ref(false) // 表单的加载中
+const detailData = ref({})
+
+/** 打开弹窗 */
+const open = async (id: number) => {
+  dialogVisible.value = true
+  // 设置数据
+  detailLoading.value = true
+  try {
+    detailData.value = await PayNotifyApi.getNotifyTaskDetail(id)
+  } finally {
+    detailLoading.value = false
+  }
+}
+defineExpose({ open }) // 提供 open 方法,用于打开弹窗
+</script>

+ 224 - 0
src/views/pay/notify/index.vue

@@ -0,0 +1,224 @@
+<template>
+  <doc-alert title="支付功能开启" url="https://doc.iocoder.cn/pay/build/" />
+
+  <!-- 搜索工作栏 -->
+  <ContentWrap>
+    <el-form
+      class="-mb-15px"
+      :model="queryParams"
+      ref="queryFormRef"
+      :inline="true"
+      label-width="100px"
+    >
+      <el-form-item label="应用编号" prop="appId">
+        <el-select
+          v-model="queryParams.appId"
+          placeholder="请选择应用信息"
+          clearable
+          filterable
+          class="!w-240px"
+        >
+          <el-option v-for="item in appList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="通知类型" prop="type">
+        <el-select
+          v-model="queryParams.type"
+          placeholder="请选择通知类型"
+          clearable
+          class="!w-240px"
+        >
+          <el-option
+            v-for="dict in getIntDictOptions(DICT_TYPE.PAY_NOTIFY_TYPE)"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="关联编号" prop="dataId">
+        <el-input
+          v-model="queryParams.dataId"
+          placeholder="请输入关联编号"
+          clearable
+          @keyup.enter="handleQuery"
+          class="!w-240px"
+        />
+      </el-form-item>
+      <el-form-item label="通知状态" prop="status">
+        <el-select
+          v-model="queryParams.status"
+          placeholder="请选择通知状态"
+          clearable
+          class="!w-240px"
+        >
+          <el-option
+            v-for="dict in getIntDictOptions(DICT_TYPE.PAY_NOTIFY_STATUS)"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="商户订单编号" prop="merchantOrderId">
+        <el-input
+          v-model="queryParams.merchantOrderId"
+          placeholder="请输入商户订单编号"
+          clearable
+          @keyup.enter="handleQuery"
+          class="!w-240px"
+        />
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        <el-date-picker
+          v-model="queryParams.createTime"
+          style="width: 240px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
+          class="!w-240px"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
+      </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+  <!-- 列表 -->
+  <ContentWrap>
+    <el-table v-loading="loading" :data="list">
+      <el-table-column label="任务编号" align="center" prop="id" />
+      <el-table-column label="应用编号" align="center" prop="appName" />
+      <el-table-column label="商户订单编号" align="center" prop="merchantOrderId" />
+      <el-table-column label="通知类型" align="center" prop="type">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.PAY_NOTIFY_TYPE" :value="scope.row.type" />
+        </template>
+      </el-table-column>
+      <el-table-column label="关联编号" align="center" prop="dataId" />
+      <el-table-column label="通知状态" align="center" prop="status">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.PAY_NOTIFY_STATUS" :value="scope.row.status" />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="最后通知时间"
+        align="center"
+        prop="lastExecuteTime"
+        width="180"
+        :formatter="dateFormatter"
+      />
+      <el-table-column
+        label="下次通知时间"
+        align="center"
+        prop="nextNotifyTime"
+        width="180"
+        :formatter="dateFormatter"
+      />
+      <el-table-column label="通知次数" align="center" prop="notifyTimes">
+        <template #default="scope">
+          <el-tag size="small" type="success">
+            {{ scope.row.notifyTimes }} / {{ scope.row.maxNotifyTimes }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template #default="scope">
+          <el-button
+            link
+            type="primary"
+            @click="openDetail(scope.row.id)"
+            v-hasPermi="['pay:notify:query']"
+          >
+            查看详情
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 分页组件 -->
+    <Pagination
+      :total="total"
+      v-model:page="queryParams.pageNo"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </ContentWrap>
+
+  <!-- 表单弹窗:预览 -->
+  <NotifyDetail ref="detailRef" />
+</template>
+
+<script lang="ts" setup>
+import * as PayNotifyApi from '@/api/pay/notify'
+import * as PayAppApi from '@/api/pay/app'
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { dateFormatter } from '@/utils/formatTime'
+import NotifyDetail from './NotifyDetail.vue'
+
+defineOptions({ name: 'PayNotify' })
+
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref() // 列表的数据
+const queryParams = ref({
+  pageNo: 1,
+  pageSize: 10,
+  appId: null,
+  type: null,
+  dataId: null,
+  status: null,
+  merchantOrderId: null,
+  createTime: []
+})
+const queryFormRef = ref() // 搜索的表单
+const appList = ref([]) // 支付应用列表集合
+// 是否显示弹出层
+const open = ref(false)
+// 通知详情
+const notifyDetail = ref<any>({
+  logs: []
+})
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNo = 1
+  getList()
+}
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await PayNotifyApi.getNotifyTaskPage(queryParams.value)
+    list.value = data.list
+    total.value = data.total
+    loading.value = false
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields()
+  handleQuery()
+}
+
+/** 详情按钮操作 */
+const detailRef = ref()
+const openDetail = (id: number) => {
+  detailRef.value.open(id)
+}
+
+/** 初始化 **/
+onMounted(async () => {
+  await getList()
+  // 获得筛选项
+  appList.value = await PayAppApi.getAppList()
+})
+</script>

+ 60 - 50
src/views/pay/order/OrderDetail.vue

@@ -1,79 +1,84 @@
 <template>
-  <Dialog v-model="dialogVisible" title="详情" width="50%">
-    <el-descriptions :column="2">
-      <el-descriptions-item label="商户名称">{{ detailData.merchantName }}</el-descriptions-item>
-      <el-descriptions-item label="应用名称">{{ detailData.appName }}</el-descriptions-item>
-      <el-descriptions-item label="商品名称">{{ detailData.subject }}</el-descriptions-item>
-    </el-descriptions>
-    <el-divider />
-    <el-descriptions :column="2">
-      <el-descriptions-item label="商户订单号">
-        <el-tag>{{ detailData.merchantOrderId }}</el-tag>
+  <Dialog v-model="dialogVisible" title="订单详情" width="700px">
+    <el-descriptions :column="2" label-class-name="desc-label">
+      <el-descriptions-item label="商户单号">
+        <el-tag size="small">{{ detailData.merchantOrderId }}</el-tag>
       </el-descriptions-item>
-      <el-descriptions-item label="渠道订单号">
-        <el-tag class="tag-purple">{{ detailData.channelOrderNo }}</el-tag>
+      <el-descriptions-item label="支付单号">
+        <el-tag type="warning" size="small" v-if="detailData.no">{{ detailData.no }}</el-tag>
       </el-descriptions-item>
-      <el-descriptions-item label="支付订单号">
-        <el-tag v-if="detailData.payOrderExtension" class="tag-pink">
-          {{ detailData.payOrderExtension.no }}
-        </el-tag>
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
+      <el-descriptions-item label="应用编号">{{ detailData.appId }}</el-descriptions-item>
+      <el-descriptions-item label="应用名称">{{ detailData.appName }}</el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
+      <el-descriptions-item label="支付状态">
+        <dict-tag :type="DICT_TYPE.PAY_ORDER_STATUS" :value="detailData.status" size="small" />
       </el-descriptions-item>
-      <el-descriptions-item label="金额">
-        <el-tag type="success">¥{{ parseFloat(detailData.amount / 100, 2).toFixed(2) }}</el-tag>
+      <el-descriptions-item label="支付金额">
+        <el-tag type="success" size="small">¥{{ (detailData.price / 100.0).toFixed(2) }}</el-tag>
       </el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
       <el-descriptions-item label="手续费">
-        <el-tag type="warning">
-          ¥{{ parseFloat(detailData.channelFeeAmount / 100, 2).toFixed(2) }}
+        <el-tag type="warning" size="small">
+          ¥{{ (detailData.channelFeePrice / 100.0).toFixed(2) }}
         </el-tag>
       </el-descriptions-item>
       <el-descriptions-item label="手续费比例">
-        {{ parseFloat(detailData.channelFeeRate / 100, 2) }}%
-      </el-descriptions-item>
-      <el-descriptions-item label="支付状态">
-        <dict-tag :type="DICT_TYPE.PAY_ORDER_STATUS" :value="detailData.status" />
-      </el-descriptions-item>
-      <el-descriptions-item label="回调状态">
-        <dict-tag :type="DICT_TYPE.PAY_ORDER_NOTIFY_STATUS" :value="detailData.notifyStatus" />
-      </el-descriptions-item>
-      <el-descriptions-item label="回调地址">{{ detailData.notifyUrl }}</el-descriptions-item>
-      <el-descriptions-item label="创建时间">
-        {{ formatDate(detailData.createTime) }}
+        {{ (detailData.channelFeeRate / 100.0).toFixed(2) }}%
       </el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
       <el-descriptions-item label="支付时间">
         {{ formatDate(detailData.successTime) }}
       </el-descriptions-item>
       <el-descriptions-item label="失效时间">
         {{ formatDate(detailData.expireTime) }}
       </el-descriptions-item>
-      <el-descriptions-item label="通知时间">
-        {{ formatDate(detailData.notifyTime) }}
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
+      <el-descriptions-item label="创建时间">
+        {{ formatDate(detailData.createTime) }}
+      </el-descriptions-item>
+      <el-descriptions-item label="更新时间">
+        {{ formatDate(detailData.updateTime) }}
       </el-descriptions-item>
     </el-descriptions>
+    <!-- 分割线 -->
     <el-divider />
-    <el-descriptions :column="2">
-      <el-descriptions-item label="支付渠道"
-        >{{ detailData.channelCodeName }}
+    <el-descriptions :column="2" label-class-name="desc-label">
+      <el-descriptions-item label="商品标题">{{ detailData.subject }}</el-descriptions-item>
+      <el-descriptions-item label="商品描述">{{ detailData.body }}</el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
+      <el-descriptions-item label="支付渠道">
+        <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="detailData.channelCode" />
       </el-descriptions-item>
-      <el-descriptions-item label="支付IP">{{ detailData.userIp }}</el-descriptions-item>
-      <el-descriptions-item label="退款状态">
-        <dict-tag :type="DICT_TYPE.PAY_ORDER_REFUND_STATUS" :value="detailData.refundStatus" />
+      <el-descriptions-item label="支付 IP">{{ detailData.userIp }}</el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
+      <el-descriptions-item label="渠道单号">
+        <el-tag size="mini" type="success" v-if="detailData.channelOrderNo">
+          {{ detailData.channelOrderNo }}
+        </el-tag>
       </el-descriptions-item>
-      <el-descriptions-item label="退款次数">{{ detailData.refundTimes }}</el-descriptions-item>
+      <el-descriptions-item label="渠道用户">{{ detailData.channelUserId }}</el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2" label-class-name="desc-label">
       <el-descriptions-item label="退款金额">
-        <el-tag type="warning">
-          {{ parseFloat(detailData.refundAmount / 100, 2) }}
+        <el-tag size="mini" type="danger">
+          ¥{{ (detailData.refundPrice / 100.0).toFixed(2) }}
         </el-tag>
       </el-descriptions-item>
+      <el-descriptions-item label="通知 URL">{{ detailData.notifyUrl }}</el-descriptions-item>
     </el-descriptions>
+    <!-- 分割线 -->
     <el-divider />
-    <el-descriptions :column="1" border direction="vertical">
-      <el-descriptions-item label="商品描述">
-        {{ detailData.body }}
-      </el-descriptions-item>
+    <el-descriptions :column="1" label-class-name="desc-label" direction="vertical" border>
       <el-descriptions-item label="支付通道异步回调内容">
-        <div style="width: 700px; overflow: auto">
-          {{ detailData.payOrderExtension?.channelNotifyData }}
-        </div>
+        {{ detailData.extension.channelNotifyData }}
       </el-descriptions-item>
     </el-descriptions>
   </Dialog>
@@ -87,7 +92,9 @@ defineOptions({ name: 'PayOrderDetail' })
 
 const dialogVisible = ref(false) // 弹窗的是否展示
 const detailLoading = ref(false) // 表单的加载中
-const detailData = ref({})
+const detailData = ref({
+  extension: {}
+})
 
 /** 打开弹窗 */
 const open = async (id: number) => {
@@ -96,6 +103,9 @@ const open = async (id: number) => {
   detailLoading.value = true
   try {
     detailData.value = await OrderApi.getOrderDetail(id)
+    if (!detailData.value.extension) {
+      detailData.value.extension = {}
+    }
   } finally {
     detailLoading.value = false
   }

+ 55 - 121
src/views/pay/order/index.vue

@@ -1,4 +1,8 @@
 <template>
+  <doc-alert title="支付宝支付接入" url="https://doc.iocoder.cn/pay/alipay-pay-demo/" />
+  <doc-alert title="微信公众号支付接入" url="https://doc.iocoder.cn/pay/wx-pub-pay-demo/" />
+  <doc-alert title="微信小程序支付接入" url="https://doc.iocoder.cn/pay/wx-lite-pay-demo/" />
+
   <ContentWrap>
     <el-form
       class="-mb-15px"
@@ -7,21 +11,6 @@
       :inline="true"
       label-width="100px"
     >
-      <el-form-item label="所属商户" prop="merchantId">
-        <el-select
-          v-model="queryParams.merchantId"
-          clearable
-          placeholder="请选择所属商户"
-          class="!w-240px"
-        >
-          <el-option
-            v-for="item in merchantList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          />
-        </el-select>
-      </el-form-item>
       <el-form-item label="应用编号" prop="appId">
         <el-select
           clearable
@@ -32,10 +21,10 @@
           <el-option v-for="item in appList" :key="item.id" :label="item.name" :value="item.id" />
         </el-select>
       </el-form-item>
-      <el-form-item label="渠道编码" prop="channelCode">
+      <el-form-item label="支付渠道" prop="channelCode">
         <el-select
           v-model="queryParams.channelCode"
-          placeholder="请输入渠道编码"
+          placeholder="请选择支付渠道"
           clearable
           class="!w-240px"
         >
@@ -47,19 +36,28 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="商户号" prop="merchantOrderId">
+      <el-form-item label="商户单号" prop="merchantOrderId">
         <el-input
           v-model="queryParams.merchantOrderId"
-          placeholder="请输入商户号"
+          placeholder="请输入商户单号"
           clearable
           @keyup.enter="handleQuery"
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="渠道订单号" prop="channelOrderNo">
+      <el-form-item label="支付单号" prop="no">
+        <el-input
+          v-model="queryParams.no"
+          placeholder="请输入支付单号"
+          clearable
+          @keyup.enter="handleQuery"
+          class="!w-240px"
+        />
+      </el-form-item>
+      <el-form-item label="渠道单号" prop="channelOrderNo">
         <el-input
           v-model="queryParams.channelOrderNo"
-          placeholder="请输入渠道订单号"
+          placeholder="请输入渠道单号"
           clearable
           @keyup.enter="handleQuery"
           class="!w-240px"
@@ -80,36 +78,6 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="退款状态" prop="refundStatus">
-        <el-select
-          v-model="queryParams.refundStatus"
-          placeholder="请选择退款状态"
-          clearable
-          class="!w-240px"
-        >
-          <el-option
-            v-for="dict in getIntDictOptions(DICT_TYPE.PAY_ORDER_REFUND_STATUS)"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="回调商户状态" prop="notifyStatus">
-        <el-select
-          v-model="queryParams.notifyStatus"
-          placeholder="请选择订单回调商户状态"
-          clearable
-          class="!w-240px"
-        >
-          <el-option
-            v-for="dict in getIntDictOptions(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS)"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
       <el-form-item label="创建时间" prop="createTime">
         <el-date-picker
           v-model="queryParams.createTime"
@@ -137,46 +105,41 @@
     </el-form>
   </ContentWrap>
 
+  <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list">
-      <el-table-column label="订单编号" align="center" prop="id" />
-      <el-table-column label="商户名称" align="center" prop="merchantName" width="120" />
-      <el-table-column label="应用名称" align="center" prop="appName" width="120" />
-      <el-table-column label="渠道名称" align="center" prop="channelCodeName" width="120" />
-      <el-table-column label="渠道订单号" align="center" prop="merchantOrderId" width="120" />
-      <el-table-column label="商品标题" align="center" prop="subject" width="250" />
-      <el-table-column label="商品描述" align="center" prop="body" width="250" />
-      <el-table-column label="异步通知地址" align="center" prop="notifyUrl" width="250" />
-      <el-table-column label="回调状态" align="center" prop="notifyStatus">
-        <template #default="scope">
-          <dict-tag :type="DICT_TYPE.PAY_ORDER_NOTIFY_STATUS" :value="scope.row.notifyStatus" />
-        </template>
-      </el-table-column>
-      <el-table-column label="支付订单" width="280">
-        <template #default="scope">
-          <p class="order-font">
-            <el-tag>商户</el-tag>
-            {{ scope.row.merchantOrderId }}
-          </p>
-          <p class="order-font">
-            <el-tag type="warning">支付</el-tag>
-            {{ scope.row.channelOrderNo }}
-          </p>
-        </template>
+      <el-table-column label="编号" align="center" prop="id" width="80" />
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+        width="180"
+        :formatter="dateFormatter"
+      />
+      <el-table-column label="支付金额" align="center" prop="price" width="100">
+        <template #default="scope"> ¥{{ parseFloat(scope.row.price / 100).toFixed(2) }} </template>
       </el-table-column>
-      <el-table-column label="支付金额" align="center" prop="amount">
+      <el-table-column label="退款金额" align="center" prop="refundPrice" width="100">
         <template #default="scope">
-          ¥{{ parseFloat(scope.row.amount / 100).toFixed(2) }}
+          ¥{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }}
         </template>
       </el-table-column>
-      <el-table-column label="手续金额" align="center" prop="channelFeeAmount">
+      <el-table-column label="手续金额" align="center" prop="channelFeePrice" width="100">
         <template #default="scope">
-          ¥{{ parseFloat(scope.row.channelFeeAmount / 100).toFixed(2) }}
+          ¥{{ parseFloat(scope.row.channelFeePrice / 100).toFixed(2) }}
         </template>
       </el-table-column>
-      <el-table-column label="退款金额" align="center" prop="refundAmount">
+      <el-table-column label="订单号" align="left" width="300">
         <template #default="scope">
-          ¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
+          <p class="order-font">
+            <el-tag size="small"> 商户</el-tag> {{ scope.row.merchantOrderId }}
+          </p>
+          <p class="order-font" v-if="scope.row.no">
+            <el-tag size="small" type="warning">支付</el-tag> {{ scope.row.no }}
+          </p>
+          <p class="order-font" v-if="scope.row.channelOrderNo">
+            <el-tag size="small" type="success">渠道</el-tag> {{ scope.row.channelOrderNo }}
+          </p>
         </template>
       </el-table-column>
       <el-table-column label="支付状态" align="center" prop="status">
@@ -184,18 +147,11 @@
           <dict-tag :type="DICT_TYPE.PAY_ORDER_STATUS" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column label="回调状态" align="center" prop="notifyStatus">
+      <el-table-column label="支付渠道" align="center" prop="channelCode" width="140">
         <template #default="scope">
-          <dict-tag :type="DICT_TYPE.PAY_ORDER_NOTIFY_STATUS" :value="scope.row.notifyStatus" />
+          <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="scope.row.channelCode" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="创建时间"
-        align="center"
-        prop="createTime"
-        width="180"
-        :formatter="dateFormatter"
-      />
       <el-table-column
         label="支付时间"
         align="center"
@@ -203,6 +159,8 @@
         width="180"
         :formatter="dateFormatter"
       />
+      <el-table-column label="支付应用" align="center" prop="appName" width="100" />
+      <el-table-column label="商品标题" align="center" prop="subject" width="180" />
       <el-table-column label="操作" align="center" fixed="right">
         <template #default="scope">
           <el-button
@@ -231,7 +189,6 @@
 <script lang="ts" setup>
 import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
 import { dateFormatter } from '@/utils/formatTime'
-import * as MerchantApi from '@/api/pay/merchant'
 import * as OrderApi from '@/api/pay/order'
 import OrderDetail from './OrderDetail.vue'
 import download from '@/utils/download'
@@ -246,34 +203,16 @@ const list = ref([]) // 列表的数据
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
-  merchantId: undefined,
-  appId: undefined,
-  channelId: undefined,
-  channelCode: undefined,
-  merchantOrderId: undefined,
-  subject: undefined,
-  body: undefined,
-  notifyUrl: undefined,
-  notifyStatus: undefined,
-  amount: undefined,
-  channelFeeRate: undefined,
-  channelFeeAmount: undefined,
-  status: undefined,
-  userIp: undefined,
-  successExtensionId: undefined,
-  refundStatus: undefined,
-  refundTimes: undefined,
-  refundAmount: undefined,
-  channelUserId: undefined,
-  channelOrderNo: undefined,
-  expireTime: [],
-  successTime: [],
-  notifyTime: [],
+  appId: null,
+  channelCode: null,
+  merchantOrderId: null,
+  channelOrderNo: null,
+  no: null,
+  status: null,
   createTime: []
 })
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出等待
-const merchantList = ref([]) // 商户列表
 const appList = ref([]) // 支付应用列表集合
 
 /** 搜索按钮操作 */
@@ -324,16 +263,11 @@ const openDetail = (id: number) => {
 /** 初始化 **/
 onMounted(async () => {
   await getList()
-  // 加载商户列表
-  // merchantList.value = await MerchantApi.getMerchantListByName()
-  // 加载 App 列表
-  // TODO 芋艿:候选少一个查询应用列表的接口
-  // appList.value = await AppApi.getAppListByMerchantId()
 })
 </script>
 <style>
 .order-font {
-  padding: 2px 0;
   font-size: 12px;
+  padding: 2px 0;
 }
 </style>

+ 4 - 2
src/views/pay/refund/index.vue

@@ -1,4 +1,6 @@
 <template>
+  <doc-alert title="支付宝、微信退款接入" url="https://doc.iocoder.cn/pay/refund-demo/" />
+
   <!-- 搜索工作栏 -->
   <ContentWrap>
     <el-form
@@ -235,7 +237,7 @@
 <script lang="ts" setup>
 import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
 import { dateFormatter } from '@/utils/formatTime'
-import * as MerchantApi from '@/api/pay/merchant'
+// import * as MerchantApi from '@/api/pay/merchant'
 import * as RefundApi from '@/api/pay/refund'
 import RefundDetail from './RefundDetail.vue'
 import download from '@/utils/download'
@@ -330,7 +332,7 @@ const openDetail = (id: number) => {
 onMounted(async () => {
   await getList()
   // 加载商户列表
-  merchantList.value = await MerchantApi.getMerchantListByName()
+  // merchantList.value = await MerchantApi.getMerchantListByName()
   // TODO 芋艿:候选少一个查询应用列表的接口
   // appList.value = await AppApi.getAppListByMerchantId()
 })

部分文件因文件數量過多而無法顯示