diff --git a/src/components/order/Pay.vue b/src/components/order/Pay.vue new file mode 100644 index 00000000..dd75a408 --- /dev/null +++ b/src/components/order/Pay.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/i18n/zh/common/button.ts b/src/i18n/zh/common/button.ts index f79c9337..d94d89d3 100644 --- a/src/i18n/zh/common/button.ts +++ b/src/i18n/zh/common/button.ts @@ -19,5 +19,7 @@ export default { try: '测试', startForFree: '免费体验', apply: '申请', - refresh: '刷新' + refresh: '刷新', + pay: '支付', + repay: '继续支付' }; diff --git a/src/i18n/zh/order/field.ts b/src/i18n/zh/order/field.ts index 920dc980..b9acbbf5 100644 --- a/src/i18n/zh/order/field.ts +++ b/src/i18n/zh/order/field.ts @@ -5,5 +5,6 @@ export default { description: '订单描述', state: '状态', createdAt: '创建时间', - service: '服务名称' + service: '服务名称', + payWay: '支付方式' }; diff --git a/src/i18n/zh/order/message.ts b/src/i18n/zh/order/message.ts index f70a43f8..0a3e7b41 100644 --- a/src/i18n/zh/order/message.ts +++ b/src/i18n/zh/order/message.ts @@ -1,5 +1,6 @@ export default { paidSuccessfully: '支付成功', createFailed: '创建失败', - wechatPayHelp: '请打开手机微信,扫一扫完成支付' + wechatPayHelp: '请打开手机微信,扫一扫完成支付', + free: '免费' }; diff --git a/src/i18n/zh/order/title.ts b/src/i18n/zh/order/title.ts index da1fb373..3b060a17 100644 --- a/src/i18n/zh/order/title.ts +++ b/src/i18n/zh/order/title.ts @@ -1,4 +1,5 @@ export default { info: '订单信息', - payWayWechat: '微信支付' + wechatPay: '微信支付', + aliPay: '支付宝' }; diff --git a/src/operators/order/models.ts b/src/operators/order/models.ts index e6853bbd..6d6b8de4 100644 --- a/src/operators/order/models.ts +++ b/src/operators/order/models.ts @@ -20,6 +20,7 @@ export interface IOrder { application_id?: string; wechatpay_url?: string; alipay_url?: string; + pay_way?: string; } export interface IOrderListResponse { diff --git a/src/operators/order/operator.ts b/src/operators/order/operator.ts index 12c26e44..4cd890c1 100644 --- a/src/operators/order/operator.ts +++ b/src/operators/order/operator.ts @@ -34,6 +34,10 @@ class OrderService { return await httpClient.post(`/${this.key}/${id}/refresh/`); } + async pay(id: string, data: IOrder): Promise> { + return await httpClient.post(`/${this.key}/${id}/pay/`, data); + } + async delete(id: string): Promise> { return await httpClient.delete(`/${this.key}/${id}`); } diff --git a/src/pages/console/order/Detail.vue b/src/pages/console/order/Detail.vue index 78785ae6..96f5c462 100644 --- a/src/pages/console/order/Detail.vue +++ b/src/pages/console/order/Detail.vue @@ -11,7 +11,7 @@ -
+
@@ -29,8 +29,19 @@ {{ $dayjs.format(order?.created_at) }} - - ¥{{ order?.price?.toFixed(2) }} + + + ¥{{ order?.price?.toFixed(2) }} + + {{ $t('order.message.free') }} + + + + {{ $t('order.title.wechatPay') }} + + + {{ $t('order.title.aliPay') }} +
@@ -45,35 +56,40 @@ -
+
- - {{ $t('order.title.payWayWechat') }} + + {{ $t('order.title.wechatPay') }} +
+
+ + {{ $t('order.title.aliPay') }}
- - - - - - -
- -

{{ $t('order.message.wechatPayHelp') }}

-
-
- -
- -
-
-
+
+ {{ + $t('common.button.pay') + }} +
+
+ {{ + $t('common.button.repay') + }} +
@@ -81,13 +97,24 @@ +