From 5d0bdef65037e8398734885dd5dba16bb80f6763 Mon Sep 17 00:00:00 2001
From: qiube <18969599531@163.com>
Date: Mon, 22 Dec 2025 17:10:54 +0800
Subject: [PATCH] =?UTF-8?q?feat(payment):=20=E6=96=B0=E5=A2=9E=E6=94=AF?=
=?UTF-8?q?=E4=BB=98=E8=AE=A2=E5=8D=95=E5=88=9B=E5=BB=BA=E5=92=8C=E7=8A=B6?=
=?UTF-8?q?=E6=80=81=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加创建支付订单接口
- 添加查询订单状态接口
- 添加获取收银台页面URL方法
- 创建支付结果展示页面 PaymentResult.vue
- 实现订单信息展示和状态判断逻辑
- 添加支付成功、失败、审核中等状态显示
- 集成 Element Plus 的结果页组件和描述列表
- 实现继续支付和查询订单操作按钮
---
src/api/payment.js | 30 +++++++
src/views/PaymentResult.vue | 171 ++++++++++++++++++++++++++++++++++++
2 files changed, 201 insertions(+)
create mode 100644 src/api/payment.js
create mode 100644 src/views/PaymentResult.vue
diff --git a/src/api/payment.js b/src/api/payment.js
new file mode 100644
index 0000000..1ab2c68
--- /dev/null
+++ b/src/api/payment.js
@@ -0,0 +1,30 @@
+import request from './request'
+
+/**
+ * 创建支付订单
+ */
+export function createPaymentOrder(data) {
+ return request({
+ url: '/payment/checkout',
+ method: 'post',
+ data
+ })
+}
+
+/**
+ * 查询订单状态
+ */
+export function getOrderStatus(merchantTransactionId) {
+ return request({
+ url: `/payment/order/${merchantTransactionId}`,
+ method: 'get'
+ })
+}
+
+/**
+ * 获取收银台页面URL
+ */
+export function getCheckoutPageUrl(token) {
+ return `/api/payment/checkout/page?token=${token}`
+}
+
diff --git a/src/views/PaymentResult.vue b/src/views/PaymentResult.vue
new file mode 100644
index 0000000..444df52
--- /dev/null
+++ b/src/views/PaymentResult.vue
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+ {{ orderInfo.merchantTransactionId || '未知' }}
+
+
+ {{ orderInfo.transactionId || '暂无' }}
+
+
+ {{ orderInfo.statusText }}
+
+
+ {{ orderInfo.amount }} {{ orderInfo.currency }}
+
+
+ {{ orderInfo.createTime }}
+
+
+
+
+ 继续支付
+ 查询订单
+
+
+
+
+
+
+
+
+
+
+
+