diff --git a/backend/app/http/v1/dto/user.go b/backend/app/http/v1/dto/user.go index 24d3afb..7b2da6f 100644 --- a/backend/app/http/v1/dto/user.go +++ b/backend/app/http/v1/dto/user.go @@ -40,16 +40,19 @@ type RechargeResponse struct { } type Order struct { - ID string `json:"id"` - CreateTime string `json:"create_time"` - PayTime string `json:"pay_time"` - Status string `json:"status"` - Amount float64 `json:"amount"` - Quantity int `json:"quantity"` - Items []ContentItem `json:"items"` - TenantID string `json:"tenant_id"` - TenantName string `json:"tenant_name"` - IsVirtual bool `json:"is_virtual"` + ID string `json:"id"` + Type string `json:"type"` // consts.OrderType... + TypeDescription string `json:"type_description"` + CreateTime string `json:"create_time"` + PayTime string `json:"pay_time"` + Status string `json:"status"` + StatusDescription string `json:"status_description"` + Amount float64 `json:"amount"` + Quantity int `json:"quantity"` + Items []ContentItem `json:"items"` + TenantID string `json:"tenant_id"` + TenantName string `json:"tenant_name"` + IsVirtual bool `json:"is_virtual"` } type Notification struct { diff --git a/backend/app/services/order.go b/backend/app/services/order.go index 7d09444..5a9ce33 100644 --- a/backend/app/services/order.go +++ b/backend/app/services/order.go @@ -353,11 +353,14 @@ func (s *order) Status(ctx context.Context, id string) (*transaction_dto.OrderSt func (s *order) composeOrderDTO(ctx context.Context, o *models.Order) (user_dto.Order, error) { dto := user_dto.Order{ - ID: cast.ToString(o.ID), - Status: string(o.Status), - Amount: float64(o.AmountPaid) / 100.0, - CreateTime: o.CreatedAt.Format(time.RFC3339), - TenantID: cast.ToString(o.TenantID), + ID: cast.ToString(o.ID), + Type: string(o.Type), + TypeDescription: o.Type.Description(), + Status: string(o.Status), + StatusDescription: o.Status.Description(), + Amount: float64(o.AmountPaid) / 100.0, + CreateTime: o.CreatedAt.Format(time.RFC3339), + TenantID: cast.ToString(o.TenantID), } // Fetch Tenant Name diff --git a/frontend/portal/src/views/order/DetailView.vue b/frontend/portal/src/views/order/DetailView.vue index 31e761d..6e9581d 100644 --- a/frontend/portal/src/views/order/DetailView.vue +++ b/frontend/portal/src/views/order/DetailView.vue @@ -10,8 +10,9 @@
订单号: {{ order.id }}
订单编号: {{ order.id }}
-创建时间: {{ order.createTime }}
-付款时间: {{ order.payTime }}
+创建时间: {{ order.create_time }}
+付款时间: {{ order.pay_time }}
张三 138****8888
@@ -123,13 +140,13 @@