= {
pending_payment: '待支付', pending_confirm: '待确认', pending_ship: '待发货',
shipped: '已发货', completed: '已完成', refunding: '退款中', refunded: '已退款', cancelled: '已取消',
@@ -73,6 +189,16 @@ async function fetchOrders() {
orders.value = res.data || []
}
+async function viewDetail(row: any) {
+ try {
+ const res: any = await adminApi.getOrderById(row.id)
+ currentOrder.value = res.data
+ detailVisible.value = true
+ } catch {
+ ElMessage.error('获取订单详情失败')
+ }
+}
+
async function processRefund(id: number, status: string) {
await adminApi.processRefund(id, { status })
ElMessage.success('已处理')
@@ -164,4 +290,93 @@ onMounted(fetchOrders)
.pagination-wrap :deep(.el-pagination__total) {
color: rgba(255, 255, 255, 0.5);
}
+
+// 订单详情样式
+.order-detail {
+ .detail-section {
+ margin-bottom: 24px;
+
+ h4 {
+ color: #fff;
+ font-size: 15px;
+ font-weight: 600;
+ margin: 0 0 12px 0;
+ padding-bottom: 8px;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);
+ }
+ }
+
+ .detail-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 12px;
+ }
+
+ .detail-item {
+ .label {
+ color: rgba(255, 255, 255, 0.5);
+ font-size: 13px;
+ }
+ .value {
+ color: rgba(255, 255, 255, 0.9);
+ font-size: 14px;
+ }
+ }
+
+ .address-info {
+ background: rgba(255, 255, 255, 0.03);
+ padding: 12px 16px;
+ border-radius: 8px;
+
+ p {
+ color: rgba(255, 255, 255, 0.8);
+ margin: 0;
+ line-height: 1.6;
+
+ &:first-child {
+ margin-bottom: 4px;
+ }
+
+ strong {
+ color: #fff;
+ }
+ }
+ }
+
+ .product-info {
+ .product-name {
+ color: rgba(255, 255, 255, 0.9);
+ }
+ }
+
+ .fee-list {
+ .fee-item {
+ display: flex;
+ justify-content: space-between;
+ padding: 8px 0;
+ color: rgba(255, 255, 255, 0.7);
+ font-size: 14px;
+
+ &.total {
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
+ margin-top: 8px;
+ padding-top: 12px;
+ color: #fff;
+ font-weight: 500;
+
+ .total-amount {
+ color: #f56c6c;
+ font-size: 18px;
+ font-weight: 700;
+ }
+ }
+ }
+ }
+}
+
+@media (max-width: 768px) {
+ .detail-grid {
+ grid-template-columns: 1fr !important;
+ }
+}
diff --git a/frontend/src/views/admin/Users.vue b/frontend/src/views/admin/Users.vue
index 5383d9e..aeb6d79 100644
--- a/frontend/src/views/admin/Users.vue
+++ b/frontend/src/views/admin/Users.vue
@@ -3,8 +3,8 @@
-
-
+
+
@@ -12,7 +12,16 @@
-
+
+
+ {{ row.purchase_credits }}
+
+
+
+
+ ¥{{ (row.total_spent || 0).toFixed(2) }}
+
+
@@ -20,7 +29,7 @@
-
+
{{ formatDate(row.created_at) }}
@@ -58,6 +67,9 @@
+
+
+
@@ -126,6 +138,7 @@ async function handleEdit() {
username: editForm.value.username,
email: editForm.value.email,
role: editForm.value.role,
+ purchase_credits: editForm.value.purchase_credits,
is_active: editForm.value.is_active,
})
ElMessage.success('更新成功')
@@ -152,6 +165,16 @@ async function handleDelete(row: any) {
.users-page { padding: 0; }
.table-card { background: #2d2d44; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 20px; }
+.credit-value {
+ color: #f59e0b;
+ font-weight: 600;
+}
+
+.spent-value {
+ color: #10b981;
+ font-weight: 600;
+}
+
.pagination-wrap {
margin-top: 20px;
display: flex;