美化全站UI: 统计卡片、表格、详情弹窗、响应式适配; Shop续费检测+QQ一致性; 支付延迟; card_id可选

This commit is contained in:
Fei-Qing committed 2026-06-23 18:26:15 +08:00
1 parent 0cd8fc9d64
commit d6d7a1a27e
316 files changed
+3398 -305

No files matched your search

+45 -9
View File
@@ -275,30 +275,66 @@ function handleExport(format) {
<style scoped>
.agents-page { max-width:1600px; margin:0 auto; }
.quota-row { margin-bottom:20px; }
.main-card { margin-bottom:20px; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-used .stat-icon { background:#f5f3ff; color:#8b5cf6; }
.stat-active .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.advanced-search { padding:20px; background:#f5f7fa; border-radius:8px; margin-bottom:20px; }
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.toolbar-left,.toolbar-right { display:flex; gap:12px; flex-wrap:wrap; }
.data-table :deep(.el-table__header th) { font-weight:600; color:#303133; }
.text-success { color:#67C23A; }
.text-danger { color:#F56C6C; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.text-success { color:#16a34a; }
.text-danger { color:#dc2626; }
.reset-pwd-tip { margin:0 0 16px; font-size:14px; }
.reset-pwd-result { margin:16px 0 0; font-size:14px; display:flex; align-items:center; }
.new-pwd { font-size:18px; font-weight:700; background:#fef0f0; padding:4px 10px; border-radius:4px; color:#e74c3c; margin-left:4px; }
.mono-text { font-family:'SF Mono',Cascadia Code,Courier New,monospace; font-size:13px; letter-spacing:.2px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
.column-settings .el-checkbox { display:block; margin-bottom:8px; }
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+139 -25
View File
@@ -74,8 +74,8 @@
<el-table-column prop="contact_name" label="联系人" width="110" v-if="visibleColumns.contact_name"><template #default="{ row }">{{ row.contact_name || '-' }}</template></el-table-column>
<el-table-column prop="card_key" label="卡密" min-width="180" show-overflow-tooltip sortable="custom" v-if="visibleColumns.card_key" />
<el-table-column prop="project_name" label="项目" width="130" sortable="custom" v-if="visibleColumns.project_name" />
<el-table-column prop="duration_days" label="有效天数" width="110" align="center" sortable="custom" v-if="visibleColumns.duration_days"><template #default="{ row }"><el-tag :type="row.duration_days==0?'success':'info'" size="small">{{ row.duration_days==0?'永久':row.duration_days+'天' }}</el-tag></template></el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center" sortable="custom" v-if="visibleColumns.status"><template #default="{ row }"><el-tag v-if="row.status==='active' && !row.is_expired" type="success" size="small">有效</el-tag><el-tag v-else-if="row.is_expired" type="warning" size="small">已过期</el-tag><el-tag v-else-if="row.status==='revoked'" type="danger" size="small">已撤销</el-tag><el-tag v-else type="info" size="small">{{ row.status }}</el-tag></template></el-table-column>
<el-table-column prop="duration_days" label="有效天数" width="100" align="center" sortable="custom" v-if="visibleColumns.duration_days"><template #default="{ row }"><span class="days-pill" :class="row.duration_days==0?'days-permanent':'days-limited'">{{ row.duration_days==0?'永久':row.duration_days+'天' }}</span></template></el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center" sortable="custom" v-if="visibleColumns.status"><template #default="{ row }"><span v-if="row.status==='active' && !row.is_expired" class="status-pill status-active">有效</span><span v-else-if="row.is_expired" class="status-pill status-expired">已过期</span><span v-else-if="row.status==='revoked'" class="status-pill status-revoked">已撤销</span><span v-else class="status-pill status-unknown">{{ row.status }}</span></template></el-table-column>
<el-table-column prop="expire_time" label="过期时间" width="180" sortable="custom" v-if="visibleColumns.expire_time"><template #default="{ row }"><span v-if="row.duration_days==0" class="text-success">永久有效</span><span v-else :class="{'text-danger':row.is_expired}">{{ row.expire_time || '-' }}</span></template></el-table-column>
<el-table-column prop="authorized_at" label="授权时间" width="180" sortable="custom" v-if="visibleColumns.authorized_at" />
<el-table-column label="操作" width="180" fixed="right" align="center">
@@ -121,22 +121,47 @@
</el-dialog>
<!-- 详情弹窗 -->
<el-dialog v-model="detailDialogVisible" title="授权详情" width="600px" destroy-on-close>
<el-descriptions v-if="detail" :column="2" border>
<el-descriptions-item label="ID">{{ detail.id }}</el-descriptions-item>
<el-descriptions-item label="状态"><el-tag v-if="detail.status==='active' && !detail.is_expired" type="success">有效</el-tag><el-tag v-else-if="detail.is_expired" type="warning">已过期</el-tag><el-tag v-else type="danger">{{ detail.status }}</el-tag></el-descriptions-item>
<el-descriptions-item label="卡密" :span="2"><span class="mono-text">{{ detail.card_key }}</span></el-descriptions-item>
<el-descriptions-item label="项目">{{ detail.project_name }}</el-descriptions-item>
<el-descriptions-item label="机器人QQ"><span class="mono-text">{{ detail.bot_qq }}</span></el-descriptions-item>
<el-descriptions-item label="联系人QQ"><span class="mono-text">{{ detail.contact_qq }}</span></el-descriptions-item>
<el-descriptions-item label="联系人">{{ detail.contact_name || '-' }}</el-descriptions-item>
<el-descriptions-item label="有效天数"><el-tag :type="detail.duration_days==0?'success':'info'">{{ detail.duration_days==0?'永久':detail.duration_days+'天' }}</el-tag></el-descriptions-item>
<el-descriptions-item label="授权时间">{{ detail.authorized_at }}</el-descriptions-item>
<el-descriptions-item label="过期时间"><span :class="{'text-danger':detail.is_expired}">{{ detail.duration_days==0?'永久有效':(detail.expire_time||'-') }}</span></el-descriptions-item>
<el-descriptions-item v-if="detail.revoked_at" label="撤销时间">{{ detail.revoked_at }}</el-descriptions-item>
<el-descriptions-item v-if="detail.revoke_reason" label="撤销原因" :span="2">{{ detail.revoke_reason }}</el-descriptions-item>
<el-descriptions-item label="备注" :span="2">{{ detail.remark || '-' }}</el-descriptions-item>
</el-descriptions>
<el-dialog v-model="detailDialogVisible" width="520px" destroy-on-close :show-close="false">
<template #header="{ close }">
<div class="detail-header">
<div class="detail-header-left">
<div class="detail-avatar" :class="detailStatusClass">
<svg v-if="detail?.status === 'active' && !detail?.is_expired" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<svg v-else-if="detail?.is_expired" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
<svg v-else viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>
</div>
<div>
<h4 class="detail-header-title">授权详情 #{{ detail?.id }}</h4>
<p class="detail-header-sub">{{ detail?.project_name || '-' }}</p>
</div>
</div>
<div class="detail-header-right">
<span class="detail-status-badge" :class="detailStatusClass">{{ detailStatusText }}</span>
<button class="detail-close-btn" @click="close" type="button" aria-label="关闭"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>
</div>
</div>
</template>
<div v-if="detail" class="detail-body">
<div class="detail-row-group">
<span class="detail-row-label">机器人与联系人</span>
<div class="detail-row"><span class="detail-row-key">机器人QQ</span><span class="detail-row-val mono">{{ detail.bot_qq }}</span></div>
<div class="detail-row"><span class="detail-row-key">联系人QQ</span><span class="detail-row-val mono">{{ detail.contact_qq }}</span></div>
<div class="detail-row"><span class="detail-row-key">联系人</span><span class="detail-row-val">{{ detail.contact_name || '-' }}</span></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">授权信息</span>
<div class="detail-row"><span class="detail-row-key">项目</span><span class="detail-row-val">{{ detail.project_name || '-' }}</span></div>
<div class="detail-row"><span class="detail-row-key">有效天数</span><span class="detail-row-val"><span v-if="detail.duration_days == 0" class="detail-tag green">永久</span><span v-else class="detail-tag blue">{{ detail.duration_days }}天</span></span></div>
<div class="detail-row"><span class="detail-row-key">授权时间</span><span class="detail-row-val">{{ detail.authorized_at || '-' }}</span></div>
<div class="detail-row"><span class="detail-row-key">过期时间</span><span class="detail-row-val" :class="{ 'text-red': detail.is_expired }">{{ detail.duration_days == 0 ? '永久有效' : (detail.expire_time || '-') }}</span></div>
</div>
<div v-if="detail.revoked_at" class="detail-row-group">
<span class="detail-row-label">撤销记录</span>
<div class="detail-row"><span class="detail-row-key">撤销时间</span><span class="detail-row-val text-red">{{ detail.revoked_at }}</span></div>
<div class="detail-row" v-if="detail.revoke_reason"><span class="detail-row-key">撤销原因</span><span class="detail-row-val">{{ detail.revoke_reason }}</span></div>
</div>
<div v-if="detail.remark" class="detail-row-group"><span class="detail-row-label">备注</span><p class="detail-remark">{{ detail.remark }}</p></div>
</div>
</el-dialog>
<!-- 撤销确认弹窗 -->
@@ -240,6 +265,18 @@ async function submitCreate() {
// 详情
const detailDialogVisible = ref(false)
const detail = ref(null)
const detailStatusClass = computed(() => {
if (!detail.value) return ''
if (detail.value.is_expired) return 'expired'
if (detail.value.status === 'revoked') return 'revoked'
return 'active'
})
const detailStatusText = computed(() => {
if (!detail.value) return ''
if (detail.value.is_expired) return '已过期'
if (detail.value.status === 'revoked') return '已撤销'
return '有效'
})
async function showDetail(row) {
try {
const res = await authorizationApi.detail(row.id)
@@ -308,16 +345,54 @@ onMounted(() => {
<style scoped>
.authorizations-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-active .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-expired .stat-icon { background:#fef3c7; color:#f59e0b; }
.stat-revoked .stat-icon { background:#fef2f2; color:#ef4444; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.advanced-search { padding:20px; background:#f5f7fa; border-radius:8px; margin-bottom:20px; }
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.toolbar-left,.toolbar-right { display:flex; gap:12px; flex-wrap:wrap; }
.data-table :deep(.el-table__header th) { font-weight:600; color:#303133; }
.mono-text { font-family:'Courier New',monospace; }
.text-success { color:#67C23A; }
.text-danger { color:#F56C6C; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
/* 状态 pill */
.status-pill { display:inline-block; padding:3px 12px; border-radius:20px; font-size:12px; font-weight:600; letter-spacing:.2px; }
.status-active { background:#f0fdf4; color:#16a34a; }
.status-expired { background:#fef3c7; color:#d97706; }
.status-revoked { background:#fef2f2; color:#dc2626; }
.status-unknown { background:#f4f4f5; color:#71717a; }
/* 有效天数 pill */
.days-pill { display:inline-block; padding:3px 12px; border-radius:20px; font-size:12px; font-weight:600; }
.days-permanent { background:#f0fdf4; color:#16a34a; }
.days-limited { background:#eff6ff; color:#2563eb; }
.mono-text { font-family:'SF Mono','Cascadia Code','Courier New',monospace; font-size:13px; letter-spacing:.2px; }
.text-success { color:#16a34a; }
.text-danger { color:#dc2626; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
@@ -325,10 +400,49 @@ onMounted(() => {
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
/* ========== 详情弹窗 ========== */
.detail-header { display:flex; align-items:center; justify-content:space-between; padding:4px 0; }
.detail-header-left { display:flex; align-items:center; gap:14px; }
.detail-avatar { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.detail-avatar.active { background:#f0f9eb; color:#67c23a; }
.detail-avatar.expired { background:#fdf6ec; color:#e6a23c; }
.detail-avatar.revoked { background:#fef0f0; color:#f56c6c; }
.detail-header-title { font-size:16px; font-weight:700; color:#1d1d1f; margin:0; line-height:1.3; }
.detail-header-sub { font-size:13px; color:#86868b; margin:2px 0 0; }
.detail-header-right { display:flex; align-items:center; gap:10px; }
.detail-status-badge { font-size:12px; font-weight:600; padding:4px 12px; border-radius:20px; letter-spacing:.3px; }
.detail-status-badge.active { background:#f0f9eb; color:#67c23a; }
.detail-status-badge.expired { background:#fdf6ec; color:#e6a23c; }
.detail-status-badge.revoked { background:#fef0f0; color:#f56c6c; }
.detail-close-btn { width:32px; height:32px; border-radius:50%; border:none; background:#f5f5f7; color:#86868b; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .2s; }
.detail-close-btn:hover { background:#e8e8ed; color:#1d1d1f; }
.detail-body { display:flex; flex-direction:column; gap:20px; margin-top:8px; }
.detail-row-group { background:#f8f9fb; border-radius:12px; padding:16px 18px 14px; }
.detail-row-label { display:block; font-size:11px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:.8px; margin-bottom:10px; }
.detail-row { display:flex; justify-content:space-between; align-items:center; padding:7px 0; }
.detail-row + .detail-row { border-top:1px solid #f0f0f4; }
.detail-row-key { font-size:13px; color:#6e6e73; }
.detail-row-val { font-size:13px; font-weight:600; color:#1d1d1f; text-align:right; max-width:60%; word-break:break-all; }
.detail-row-val.mono { font-family:'SF Mono','Courier New',monospace; font-size:13px; letter-spacing:.3px; }
.detail-tag { display:inline-block; padding:2px 10px; border-radius:6px; font-size:12px; font-weight:600; }
.detail-tag.green { background:#f0f9eb; color:#67c23a; }
.detail-tag.blue { background:#ecf5ff; color:#409eff; }
.text-red { color:#f56c6c !important; }
.detail-remark { font-size:13px; color:#1d1d1f; margin:0; line-height:1.6; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
</style>
+59 -1
View File
@@ -296,5 +296,63 @@ async function handleImportSubmit() {
</script>
<style scoped>
.upload-tip { font-size: 12px; color: #909399; margin-top: 8px; line-height: 1.6; }
.blacklist-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-active .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-expired .stat-icon { background:#fef2f2; color:#ef4444; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.upload-tip { font-size:12px; color:#909399; margin-top:8px; line-height:1.6; }
.mono-text { font-family:'SF Mono',Cascadia Code,Courier New,monospace; font-size:13px; letter-spacing:.2px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
.column-settings .el-checkbox { display:block; margin-bottom:8px; }
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+129 -131
View File
@@ -168,20 +168,8 @@
<span v-else class="text-muted">-</span>
</template>
</el-table-column>
<el-table-column prop="duration_days" label="有效天数" width="110" align="center" sortable="custom" v-if="visibleColumns.duration_days">
<template #default="{ row }">
<el-tag :type="row.duration_days == 0 ? 'success' : 'info'" size="small">
{{ row.duration_days == 0 ? '永久' : row.duration_days + '天' }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center" sortable="custom" v-if="visibleColumns.status">
<template #default="{ row }">
<el-tag v-if="row.status === 'unused'" type="info" size="small">未使用</el-tag>
<el-tag v-else-if="row.status === 'used'" type="success" size="small">已使用</el-tag>
<el-tag v-else type="danger" size="small">已禁用</el-tag>
</template>
</el-table-column>
<el-table-column prop="duration_days" label="有效天数" width="100" align="center" sortable="custom" v-if="visibleColumns.duration_days"><template #default="{ row }"><span class="days-pill" :class="row.duration_days==0?'days-permanent':'days-limited'">{{ row.duration_days==0?'永久':row.duration_days+'天' }}</span></template></el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center" sortable="custom" v-if="visibleColumns.status"><template #default="{ row }"><span class="status-pill" :class="'status-' + row.status">{{ row.status === 'unused' ? '未使用' : row.status === 'used' ? '已使用' : '已禁用' }}</span></template></el-table-column>
<el-table-column prop="expire_time" label="过期时间" width="180" sortable="custom" v-if="visibleColumns.expire_time">
<template #default="{ row }">
<span v-if="row.duration_days == 0" class="text-success">永久有效</span>
@@ -258,42 +246,50 @@
</el-dialog>
<!-- ========== 详情弹窗 ========== -->
<el-dialog v-model="detailVisible" title="卡密详情" width="600px" destroy-on-close>
<el-descriptions :column="2" border v-if="detail">
<el-descriptions-item label="ID" :span="1">{{ detail.id }}</el-descriptions-item>
<el-descriptions-item label="状态" :span="1">
<el-tag v-if="detail.status === 'unused'" type="info">未使用</el-tag>
<el-tag v-else-if="detail.status === 'used'" type="success">已使用</el-tag>
<el-tag v-else type="danger">已禁用</el-tag>
</el-descriptions-item>
<el-descriptions-item label="卡密" :span="2">
<div class="card-key-detail">
<span class="mono-text">{{ detail.card_key }}</span>
<el-button type="primary" size="small" @click="copyToClipboard(detail.card_key)" :icon="DocumentCopy">复制</el-button>
<el-dialog v-model="detailVisible" width="520px" destroy-on-close :show-close="false">
<template #header="{ close }">
<div class="detail-header">
<div class="detail-header-left">
<div class="detail-avatar" :class="detailStatusClass">
<svg v-if="detail?.status === 'unused'" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
<svg v-else-if="detail?.status === 'used'" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<svg v-else viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg>
</div>
<div>
<h4 class="detail-header-title">卡密详情 #{{ detail?.id }}</h4>
<p class="detail-header-sub">{{ detail?.project_name || '-' }}</p>
</div>
</div>
</el-descriptions-item>
<el-descriptions-item label="项目" :span="1">{{ detail.project_name }}</el-descriptions-item>
<el-descriptions-item label="类型" :span="1">{{ detail.card_type_name }}</el-descriptions-item>
<el-descriptions-item label="有效天数" :span="1">
<el-tag :type="detail.duration_days == 0 ? 'success' : 'info'">
{{ detail.duration_days == 0 ? '永久' : detail.duration_days + '天' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="过期时间" :span="1">
<span v-if="detail.duration_days == 0" class="text-success">永久有效</span>
<span v-else>{{ detail.expire_time || '-' }}</span>
</el-descriptions-item>
<el-descriptions-item label="机器人QQ" :span="1">
<span v-if="detail.bot_qq" class="mono-text">{{ detail.bot_qq }}</span>
<span v-else class="text-muted">-</span>
</el-descriptions-item>
<el-descriptions-item label="绑定时间" :span="1">{{ detail.bound_at || '-' }}</el-descriptions-item>
<el-descriptions-item label="生成时间" :span="2">{{ detail.created_at }}</el-descriptions-item>
<el-descriptions-item label="绑定信息" :span="2">
<pre v-if="detail.bind_info && Object.keys(detail.bind_info).length" class="bind-info-pre">{{ JSON.stringify(detail.bind_info, null, 2) }}</pre>
<span v-else class="text-muted">无</span>
</el-descriptions-item>
</el-descriptions>
<div class="detail-header-right">
<span class="detail-status-badge" :class="detailStatusClass">{{ detailStatusText }}</span>
<button class="detail-close-btn" @click="close" type="button" aria-label="关闭"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>
</div>
</div>
</template>
<div v-if="detail" class="detail-body">
<div class="detail-row-group">
<span class="detail-row-label">卡密信息</span>
<div class="detail-row"><span class="detail-row-key">卡密</span><span class="detail-row-val mono">{{ detail.card_key }}</span></div>
<div class="detail-row" style="justify-content:flex-end; border-top:none; padding-top:4px;"><el-button type="primary" size="small" @click="copyToClipboard(detail.card_key)" :icon="DocumentCopy" plain>复制卡密</el-button></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">套餐与项目</span>
<div class="detail-row"><span class="detail-row-key">项目</span><span class="detail-row-val">{{ detail.project_name || '-' }}</span></div>
<div class="detail-row"><span class="detail-row-key">类型</span><span class="detail-row-val">{{ detail.card_type_name }}</span></div>
<div class="detail-row"><span class="detail-row-key">有效天数</span><span class="detail-row-val"><span v-if="detail.duration_days == 0" class="detail-tag green">永久</span><span v-else class="detail-tag blue">{{ detail.duration_days }}天</span></span></div>
<div class="detail-row"><span class="detail-row-key">过期时间</span><span class="detail-row-val">{{ detail.duration_days == 0 ? '永久有效' : (detail.expire_time || '-') }}</span></div>
<div class="detail-row"><span class="detail-row-key">生成时间</span><span class="detail-row-val">{{ detail.created_at }}</span></div>
</div>
<div class="detail-row-group" v-if="detail.status !== 'unused'">
<span class="detail-row-label">使用记录</span>
<div class="detail-row"><span class="detail-row-key">机器人QQ</span><span class="detail-row-val mono">{{ detail.bot_qq || '-' }}</span></div>
<div class="detail-row"><span class="detail-row-key">绑定时间</span><span class="detail-row-val">{{ detail.bound_at || '-' }}</span></div>
</div>
<div class="detail-row-group" v-if="detail.bind_info && Object.keys(detail.bind_info).length">
<span class="detail-row-label">绑定详情</span>
<pre class="detail-remark">{{ JSON.stringify(detail.bind_info, null, 2) }}</pre>
</div>
</div>
</el-dialog>
<!-- ========== 导入弹窗 ========== -->
@@ -383,6 +379,7 @@ const selectedRows = ref([])
const dateRange = ref([])
const showAdvancedSearch = ref(true)
const tableRef = ref(null)
const statusMap = { unused: '未使用', used: '已使用', disabled: '已禁用' }
const tableMaxHeight = ref(500)
const filters = reactive({
@@ -435,6 +432,18 @@ const genCostPreview = computed(() => {
// 详情
const detailVisible = ref(false)
const detail = ref(null)
const detailStatusClass = computed(() => {
if (!detail.value) return ''
if (detail.value.status === 'used') return 'used'
if (detail.value.status === 'disabled') return 'revoked'
return 'unused'
})
const detailStatusText = computed(() => {
if (!detail.value) return ''
if (detail.value.status === 'used') return '已使用'
if (detail.value.status === 'disabled') return '已禁用'
return '未使用'
})
// 导入
const importDialogVisible = ref(false)
@@ -840,96 +849,85 @@ function calculateTableHeight() {
}
/* ========== 工具栏 ========== */
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
flex-wrap: wrap;
gap: 12px;
}
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-unused .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-used .stat-icon { background:#f5f3ff; color:#8b5cf6; }
.stat-disabled .stat-icon { background:#fef2f2; color:#ef4444; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
.toolbar-left,
.toolbar-right {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
/* ========== 主卡片 ========== */
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.cards-table {
width: 100%;
}
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.cards-table :deep(.el-table__header) {
background: #f5f7fa;
}
/* 状态 pill */
.status-pill { display:inline-block; padding:3px 12px; border-radius:20px; font-size:12px; font-weight:600; letter-spacing:.2px; }
.status-unused { background:#f4f4f5; color:#71717a; }
.status-used { background:#f0fdf4; color:#16a34a; }
.status-disabled { background:#fef2f2; color:#dc2626; }
.cards-table :deep(.el-table__header th) {
font-weight: 600;
color: #303133;
}
/* 有效天数 pill */
.days-pill { display:inline-block; padding:3px 12px; border-radius:20px; font-size:12px; font-weight:600; }
.days-permanent { background:#f0fdf4; color:#16a34a; }
.days-limited { background:#eff6ff; color:#2563eb; }
.cards-table :deep(.el-table__row) {
transition: background 0.2s ease;
}
.card-key-cell { display:flex; align-items:center; gap:8px; }
.copy-icon { cursor:pointer; color:#9ca3af; transition:color .2s; font-size:15px; }
.copy-icon:hover { color:#3b82f6; }
.card-key-text { font-family:'SF Mono','Cascadia Code','Courier New',monospace; font-size:13px; letter-spacing:.2px; }
.cards-table :deep(.el-table__row:hover > td) {
background: #ecf5ff !important;
}
.mono-text { font-family:'SF Mono','Cascadia Code','Courier New',monospace; font-size:13px; letter-spacing:.2px; }
.text-muted { color:#d1d5db; }
.text-success { color:#16a34a; }
.text-danger { color:#dc2626; }
.card-key-cell {
display: flex;
align-items: center;
gap: 8px;
}
.copy-icon {
cursor: pointer;
color: #409EFF;
transition: color 0.2s ease;
}
.copy-icon:hover {
color: #66b1ff;
}
.card-key-text {
font-family: 'Courier New', monospace;
font-size: 13px;
}
.mono-text {
font-family: 'Courier New', monospace;
}
.text-muted {
color: #c0c4cc;
}
.text-success {
color: #67C23A;
}
.text-danger {
color: #F56C6C;
}
.card-key-detail {
display: flex;
align-items: center;
gap: 12px;
}
.bind-info-pre {
font-size: 12px;
max-height: 200px;
overflow: auto;
background: #f5f7fa;
padding: 12px;
border-radius: 4px;
margin: 0;
}
/* ========== 详情弹窗 ========== */
.detail-header { display:flex; align-items:center; justify-content:space-between; padding:4px 0; }
.detail-header-left { display:flex; align-items:center; gap:14px; }
.detail-avatar { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.detail-avatar.unused { background:#f4f4f5; color:#909399; }
.detail-avatar.used { background:#f0f9eb; color:#67c23a; }
.detail-avatar.revoked { background:#fef0f0; color:#f56c6c; }
.detail-header-title { font-size:16px; font-weight:700; color:#1d1d1f; margin:0; line-height:1.3; }
.detail-header-sub { font-size:13px; color:#86868b; margin:2px 0 0; }
.detail-header-right { display:flex; align-items:center; gap:10px; }
.detail-status-badge { font-size:12px; font-weight:600; padding:4px 12px; border-radius:20px; letter-spacing:.3px; }
.detail-status-badge.unused { background:#f4f4f5; color:#909399; }
.detail-status-badge.used { background:#f0f9eb; color:#67c23a; }
.detail-status-badge.revoked { background:#fef0f0; color:#f56c6c; }
.detail-close-btn { width:32px; height:32px; border-radius:50%; border:none; background:#f5f5f7; color:#86868b; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .2s; }
.detail-close-btn:hover { background:#e8e8ed; color:#1d1d1f; }
.detail-body { display:flex; flex-direction:column; gap:20px; margin-top:8px; }
.detail-row-group { background:#f8f9fb; border-radius:12px; padding:16px 18px 14px; }
.detail-row-label { display:block; font-size:11px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:.8px; margin-bottom:10px; }
.detail-row { display:flex; justify-content:space-between; align-items:center; padding:7px 0; }
.detail-row + .detail-row { border-top:1px solid #f0f0f4; }
.detail-row-key { font-size:13px; color:#6e6e73; }
.detail-row-val { font-size:13px; font-weight:600; color:#1d1d1f; text-align:right; max-width:60%; word-break:break-all; }
.detail-row-val.mono { font-family:'SF Mono','Courier New',monospace; font-size:13px; letter-spacing:.3px; }
.detail-tag { display:inline-block; padding:2px 10px; border-radius:6px; font-size:12px; font-weight:600; }
.detail-tag.green { background:#f0f9eb; color:#67c23a; }
.detail-tag.blue { background:#ecf5ff; color:#409eff; }
.detail-remark { font-size:12px; color:#1d1d1f; margin:0; line-height:1.6; max-height:200px; overflow:auto; background:#f0f0f4; padding:12px; border-radius:8px; }
/* ========== 分页 ========== */
.pagination-wrapper {
+42 -5
View File
@@ -122,13 +122,39 @@ function handleExport(format) {
<style scoped>
.logs-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-today .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-users .stat-icon { background:#f5f3ff; color:#8b5cf6; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.advanced-search { padding:20px; background:#f5f7fa; border-radius:8px; margin-bottom:20px; }
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.toolbar-left,.toolbar-right { display:flex; gap:12px; flex-wrap:wrap; }
.data-table :deep(.el-table__header th) { font-weight:600; color:#303133; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.mono-text { font-family:'SF Mono',Cascadia Code,Courier New,monospace; font-size:13px; letter-spacing:.2px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
@@ -136,10 +162,21 @@ function handleExport(format) {
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input,.search-form .el-date-picker { width:100% !important; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+122 -22
View File
@@ -82,7 +82,7 @@
<el-table-column prop="card_type_name" label="套餐" width="110" sortable="custom" v-if="visibleColumns.card_type_name" />
<el-table-column prop="amount" label="金额" width="100" sortable="custom" v-if="visibleColumns.amount"><template #default="{ row }"><span class="price-text">¥{{ parseFloat(row.amount||0).toFixed(2) }}</span></template></el-table-column>
<el-table-column prop="pay_type" label="支付方式" width="100" align="center" v-if="visibleColumns.pay_type"><template #default="{ row }"><el-tag v-if="row.pay_type==='alipay'" type="primary" size="small">支付宝</el-tag><el-tag v-else-if="row.pay_type==='wxpay'" type="success" size="small">微信</el-tag><el-tag v-else-if="row.pay_type==='qqpay'" type="info" size="small">QQ</el-tag><span v-else class="text-muted">-</span></template></el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center" sortable="custom" v-if="visibleColumns.status"><template #default="{ row }"><el-tag v-if="row.status==='pending'" type="warning" size="small">待支付</el-tag><el-tag v-else-if="row.status==='paid'" type="success" size="small">已支付</el-tag><el-tag v-else-if="row.status==='expired'" type="info" size="small">已过期</el-tag><el-tag v-else type="danger" size="small">已退款</el-tag></template></el-table-column>
<el-table-column prop="status" label="状态" width="100" align="center" sortable="custom" v-if="visibleColumns.status"><template #default="{ row }"><span class="status-pill" :class="'status-' + row.status">{{ row.status === 'pending' ? '待支付' : row.status === 'paid' ? '已支付' : row.status === 'expired' ? '已过期' : '已退款' }}</span></template></el-table-column>
<el-table-column prop="trade_no" label="交易号" width="200" show-overflow-tooltip sortable="custom" v-if="visibleColumns.trade_no" />
<el-table-column prop="card_key" label="卡密" width="180" show-overflow-tooltip v-if="visibleColumns.card_key"><template #default="{ row }"><span v-if="row.card_key" class="mono-text">{{ row.card_key }}</span><span v-else class="text-muted">-</span></template></el-table-column>
<el-table-column prop="paid_at" label="支付时间" width="180" sortable="custom" v-if="visibleColumns.paid_at" />
@@ -100,21 +100,51 @@
</el-card>
<!-- 详情弹窗 -->
<el-dialog v-model="detailVisible" title="订单详情" width="600px" destroy-on-close>
<el-descriptions :column="2" border v-if="detail">
<el-descriptions-item label="ID" :span="1">{{ detail.id }}</el-descriptions-item>
<el-descriptions-item label="状态" :span="1"><el-tag v-if="detail.status==='pending'" type="warning">待支付</el-tag><el-tag v-else-if="detail.status==='paid'" type="success">已支付</el-tag><el-tag v-else-if="detail.status==='expired'" type="info">已过期</el-tag><el-tag v-else type="danger">已退款</el-tag></el-descriptions-item>
<el-descriptions-item label="订单号" :span="2">{{ detail.order_no }}</el-descriptions-item>
<el-descriptions-item label="交易号" :span="2">{{ detail.trade_no || '-' }}</el-descriptions-item>
<el-descriptions-item label="项目" :span="1">{{ detail.project_name }}</el-descriptions-item>
<el-descriptions-item label="套餐" :span="1">{{ detail.card_type_name }}</el-descriptions-item>
<el-descriptions-item label="金额" :span="1"><span class="price-text">¥{{ parseFloat(detail.amount||0).toFixed(2) }}</span></el-descriptions-item>
<el-descriptions-item label="支付方式" :span="1">{{ detail.pay_type ? {alipay:'支付宝',wxpay:'微信',qqpay:'QQ钱包'}[detail.pay_type] : '-' }}</el-descriptions-item>
<el-descriptions-item label="卡密" :span="2"><span v-if="detail.card_key" class="mono-text">{{ detail.card_key }}</span><span v-else class="text-muted">-</span></el-descriptions-item>
<el-descriptions-item label="联系方式" :span="2">{{ detail.contact_info || '-' }}</el-descriptions-item>
<el-descriptions-item label="支付时间" :span="1">{{ detail.paid_at || '-' }}</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="1">{{ detail.created_at }}</el-descriptions-item>
</el-descriptions>
<el-dialog v-model="detailVisible" width="520px" destroy-on-close :show-close="false">
<template #header="{ close }">
<div class="detail-header">
<div class="detail-header-left">
<div class="detail-avatar" :class="'order-' + detail?.status">
<svg v-if="detail?.status==='paid'" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
<svg v-else-if="detail?.status==='pending'" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
<svg v-else-if="detail?.status==='expired'" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
<svg v-else viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>
</div>
<div>
<h4 class="detail-header-title">订单详情 #{{ detail?.id }}</h4>
<p class="detail-header-sub">{{ detail?.order_no }}</p>
</div>
</div>
<div class="detail-header-right">
<span class="detail-status-badge" :class="'order-' + detail?.status">{{ statusText }}</span>
<button class="detail-close-btn" @click="close" type="button" aria-label="关闭"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>
</div>
</div>
</template>
<div v-if="detail" class="detail-body">
<div class="detail-row-group">
<span class="detail-row-label">订单信息</span>
<div class="detail-row"><span class="detail-row-key">订单号</span><span class="detail-row-val mono">{{ detail.order_no }}</span></div>
<div class="detail-row"><span class="detail-row-key">交易号</span><span class="detail-row-val mono">{{ detail.trade_no || '-' }}</span></div>
<div class="detail-row"><span class="detail-row-key">金额</span><span class="detail-row-val price-text">¥{{ parseFloat(detail.amount||0).toFixed(2) }}</span></div>
<div class="detail-row"><span class="detail-row-key">支付方式</span><span class="detail-row-val">{{ detail.pay_type ? {alipay:'支付宝',wxpay:'微信',qqpay:'QQ钱包'}[detail.pay_type] : '-' }}</span></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">项目与套餐</span>
<div class="detail-row"><span class="detail-row-key">项目</span><span class="detail-row-val">{{ detail.project_name }}</span></div>
<div class="detail-row"><span class="detail-row-key">套餐</span><span class="detail-row-val">{{ detail.card_type_name }}</span></div>
<div class="detail-row"><span class="detail-row-key">卡密</span><span class="detail-row-val"><span v-if="detail.card_key" class="mono-text">{{ detail.card_key }}</span><span v-else class="text-muted">-</span></span></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">联系方式</span>
<div class="detail-row" style="border-top:none"><span class="detail-row-val" style="max-width:100%">{{ detail.contact_info || '-' }}</span></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">时间</span>
<div class="detail-row"><span class="detail-row-key">创建时间</span><span class="detail-row-val">{{ detail.created_at }}</span></div>
<div class="detail-row"><span class="detail-row-key">支付时间</span><span class="detail-row-val">{{ detail.paid_at || '-' }}</span></div>
</div>
</div>
</el-dialog>
</div>
</template>
@@ -136,6 +166,12 @@ const showAdvancedSearch = ref(true)
const detailVisible = ref(false)
const detail = ref(null)
const statusText = computed(() => {
if (!detail.value) return ''
const map = { pending: '待支付', paid: '已支付', expired: '已过期', refunded: '已退款' }
return map[detail.value.status] || detail.value.status
})
const { list, loading, page, pageSize, total, selectedRows, filters, tableMaxHeight, fetchData, handleSelectionChange, handleSortChange, handleSizeChange, handleFilterChange, resetFilters, refreshData } = useList({
apiUrl: '/orders',
defaultFilters: { status: '', pay_type: '', keyword: '' },
@@ -190,16 +226,42 @@ function handleExport(format) {
<style scoped>
.orders-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-paid .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-pending .stat-icon { background:#fef3c7; color:#f59e0b; }
.stat-refunded .stat-icon { background:#fef2f2; color:#ef4444; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.advanced-search { padding:20px; background:#f5f7fa; border-radius:8px; margin-bottom:20px; }
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.toolbar-left,.toolbar-right { display:flex; gap:12px; flex-wrap:wrap; }
.data-table :deep(.el-table__header th) { font-weight:600; color:#303133; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.price-text { color:#F56C6C; font-weight:700; }
.mono-text { font-family:'Courier New',monospace; }
.text-muted { color:#c0c4cc; }
.text-muted { color:#d1d5db; }
.mono-text { font-family:'SF Mono',Cascadia Code,Courier New,monospace; font-size:13px; letter-spacing:.2px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
@@ -207,10 +269,48 @@ function handleExport(format) {
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
/* ========== 详情弹窗 ========== */
.detail-header { display:flex; align-items:center; justify-content:space-between; padding:4px 0; }
.detail-header-left { display:flex; align-items:center; gap:14px; }
.detail-avatar { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.detail-avatar.order-paid { background:#f0f9eb; color:#67c23a; }
.detail-avatar.order-pending { background:#fdf6ec; color:#e6a23c; }
.detail-avatar.order-expired { background:#f4f4f5; color:#909399; }
.detail-avatar.order-refunded { background:#fef0f0; color:#f56c6c; }
.detail-header-title { font-size:16px; font-weight:700; color:#1d1d1f; margin:0; line-height:1.3; }
.detail-header-sub { font-size:12px; color:#86868b; margin:2px 0 0; font-family:'SF Mono',Cascadia Code,Courier New,monospace; }
.detail-header-right { display:flex; align-items:center; gap:10px; }
.detail-status-badge { font-size:12px; font-weight:600; padding:4px 12px; border-radius:20px; letter-spacing:.3px; }
.detail-status-badge.order-paid { background:#f0f9eb; color:#67c23a; }
.detail-status-badge.order-pending { background:#fdf6ec; color:#e6a23c; }
.detail-status-badge.order-expired { background:#f4f4f5; color:#909399; }
.detail-status-badge.order-refunded { background:#fef0f0; color:#f56c6c; }
.detail-close-btn { width:32px; height:32px; border-radius:50%; border:none; background:#f5f5f7; color:#86868b; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .2s; }
.detail-close-btn:hover { background:#e8e8ed; color:#1d1d1f; }
.detail-body { display:flex; flex-direction:column; gap:20px; margin-top:8px; }
.detail-row-group { background:#f8f9fb; border-radius:12px; padding:16px 18px 14px; }
.detail-row-label { display:block; font-size:11px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:.8px; margin-bottom:10px; }
.detail-row { display:flex; justify-content:space-between; align-items:center; padding:7px 0; }
.detail-row + .detail-row { border-top:1px solid #f0f0f4; }
.detail-row-key { font-size:13px; color:#6e6e73; }
.detail-row-val { font-size:13px; font-weight:600; color:#1d1d1f; text-align:right; max-width:60%; word-break:break-all; }
.detail-row-val.mono { font-family:'SF Mono','Courier New',monospace; font-size:12px; letter-spacing:.3px; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+44 -6
View File
@@ -263,15 +263,42 @@ function handleExport(format) {
</script>
<style scoped>
.products-page { max-width: 1600px; margin: 0 auto; }
.stats-row { margin-bottom: 20px; }
.products-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-active .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-inactive .stat-icon { background:#fef2f2; color:#ef4444; }
.stat-forever .stat-icon { background:#f5f3ff; color:#8b5cf6; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.advanced-search { padding:20px; background:#f5f7fa; border-radius:8px; margin-bottom:20px; }
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.toolbar-left,.toolbar-right { display:flex; gap:12px; flex-wrap:wrap; }
.data-table :deep(.el-table__header th) { font-weight:600; color:#303133; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.price-text { color:#F56C6C; font-weight:700; }
.mono-text { font-family:'SF Mono',Cascadia Code,Courier New,monospace; font-size:13px; letter-spacing:.2px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
@@ -279,10 +306,21 @@ function handleExport(format) {
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+43 -6
View File
@@ -235,16 +235,42 @@ async function deleteCardType(row) {
<style scoped>
.projects-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-active .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-inactive .stat-icon { background:#fef2f2; color:#ef4444; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.advanced-search { padding:20px; background:#f5f7fa; border-radius:8px; margin-bottom:20px; }
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.toolbar-left,.toolbar-right { display:flex; gap:12px; flex-wrap:wrap; }
.data-table :deep(.el-table__header th) { font-weight:600; color:#303133; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.key-cell { display:flex; align-items:center; gap:8px; }
.copy-icon { color:#409EFF; cursor:pointer; }
.mono-text { font-family:'Courier New',monospace; }
.copy-icon { color:#9ca3af; cursor:pointer; }
.copy-icon:hover { color:#3b82f6; }
.mono-text { font-family:'SF Mono',Cascadia Code,Courier New,monospace; font-size:13px; letter-spacing:.2px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
@@ -252,10 +278,21 @@ async function deleteCardType(row) {
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+136 -32
View File
@@ -135,35 +135,57 @@
<template #footer><el-button @click="dialogVisible = false">取消</el-button><el-button type="primary" :loading="submitLoading" @click="handleSubmit">{{ isEdit ? '保存修改' : '确认创建' }}</el-button></template>
</el-dialog>
<!-- 详情抽屉 -->
<el-drawer v-model="detailVisible" title="用户详情" size="500px" direction="rtl">
<div v-if="currentUser" class="detail-content">
<!-- 详情弹窗 -->
<el-dialog v-model="detailVisible" width="520px" destroy-on-close :show-close="false">
<template #header="{ close }">
<div class="detail-header">
<el-avatar :size="80" :src="currentUser.avatar" :icon="UserFilled">{{ currentUser.nickname?.charAt(0) || currentUser.username.charAt(0) }}</el-avatar>
<div class="detail-header-info">
<h3>{{ currentUser.nickname || currentUser.username }}</h3>
<el-tag :type="getRoleTagType(currentUser.role)" effect="dark">{{ getRoleLabel(currentUser.role) }}</el-tag>
<el-tag :type="currentUser.status === 1 ? 'success' : 'danger'" size="small">{{ currentUser.status === 1 ? '正常' : '禁用' }}</el-tag>
<div class="detail-header-left">
<div class="detail-avatar" :class="currentUser?.status === 1 ? 'active' : 'disabled'">
<svg v-if="currentUser?.status === 1" viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<svg v-else viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg>
</div>
<div>
<h4 class="detail-header-title">{{ currentUser?.nickname || currentUser?.username }}</h4>
<p class="detail-header-sub">ID: #{{ currentUser?.id }} · {{ currentUser?.username }}</p>
</div>
</div>
<div class="detail-header-right">
<span class="detail-status-badge" :class="currentUser?.status === 1 ? 'active' : 'disabled'">{{ currentUser?.status === 1 ? '正常' : '已禁用' }}</span>
<button class="detail-close-btn" @click="close" type="button" aria-label="关闭"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>
</div>
</div>
<el-descriptions :column="1" border>
<el-descriptions-item label="用户ID">{{ currentUser.id }}</el-descriptions-item>
<el-descriptions-item label="用户名">{{ currentUser.username }}</el-descriptions-item>
<el-descriptions-item label="昵称">{{ currentUser.nickname || '-' }}</el-descriptions-item>
<el-descriptions-item label="邮箱">{{ currentUser.email || '-' }}</el-descriptions-item>
<el-descriptions-item label="角色"><el-tag :type="getRoleTagType(currentUser.role)">{{ getRoleLabel(currentUser.role) }}</el-tag></el-descriptions-item>
<el-descriptions-item label="状态"><el-tag :type="currentUser.status === 1 ? 'success' : 'danger'">{{ currentUser.status === 1 ? '正常' : '禁用' }}</el-tag></el-descriptions-item>
<el-descriptions-item label="最后登录时间">{{ currentUser.last_login_at || '从未登录' }}</el-descriptions-item>
<el-descriptions-item label="最后登录IP">{{ currentUser.last_login_ip || '-' }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ currentUser.created_at }}</el-descriptions-item>
<el-descriptions-item label="备注" v-if="currentUser.remark">{{ currentUser.remark }}</el-descriptions-item>
</el-descriptions>
</template>
<div v-if="currentUser" class="detail-body">
<div class="detail-row-group">
<span class="detail-row-label">基本信息</span>
<div class="detail-row"><span class="detail-row-key">用户名</span><span class="detail-row-val">{{ currentUser.username }}</span></div>
<div class="detail-row"><span class="detail-row-key">昵称</span><span class="detail-row-val">{{ currentUser.nickname || '-' }}</span></div>
<div class="detail-row"><span class="detail-row-key">邮箱</span><span class="detail-row-val">{{ currentUser.email || '-' }}</span></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">角色与状态</span>
<div class="detail-row"><span class="detail-row-key">角色</span><span class="detail-row-val"><span class="role-pill" :class="'role-' + currentUser.role">{{ getRoleLabel(currentUser.role) }}</span></span></div>
<div class="detail-row"><span class="detail-row-key">状态</span><span class="detail-row-val"><span :class="currentUser.status === 1 ? 'text-success' : 'text-danger'">{{ currentUser.status === 1 ? '正常' : '已禁用' }}</span></span></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">登录记录</span>
<div class="detail-row"><span class="detail-row-key">最后登录</span><span class="detail-row-val">{{ currentUser.last_login_at || '从未登录' }}</span></div>
<div class="detail-row"><span class="detail-row-key">登录 IP</span><span class="detail-row-val mono">{{ currentUser.last_login_ip || '-' }}</span></div>
</div>
<div class="detail-row-group">
<span class="detail-row-label">时间</span>
<div class="detail-row"><span class="detail-row-key">创建时间</span><span class="detail-row-val">{{ currentUser.created_at }}</span></div>
</div>
<div v-if="currentUser.remark" class="detail-row-group">
<span class="detail-row-label">备注</span>
<p class="detail-remark">{{ currentUser.remark }}</p>
</div>
<div class="detail-actions">
<el-button type="primary" @click="showEditDialog(currentUser)">编辑用户</el-button>
<el-button type="danger" @click="handleDelete(currentUser)" :disabled="currentUser.role === 'admin'">删除用户</el-button>
</div>
</div>
</el-drawer>
</el-dialog>
</div>
</template>
@@ -382,15 +404,97 @@ onMounted(() => {
</script>
<style scoped>
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 500; }
.user-id { font-size: 12px; color: #909399; }
.time-cell { display: flex; align-items: center; gap: 6px; }
.detail-content { padding: 0 10px; }
.detail-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.detail-header-info h3 { margin: 0 0 10px 0; }
.detail-actions { margin-top: 24px; display: flex; gap: 12px; }
.role-option { display: flex; align-items: center; gap: 8px; }
.role-desc { color: #909399; font-size: 12px; }
.users-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-admin .stat-icon { background:#fef2f2; color:#ef4444; }
.stat-project .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-agent .stat-icon { background:#fef3c7; color:#f59e0b; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.user-cell { display:flex; align-items:center; gap:10px; }
.user-info { display:flex; flex-direction:column; }
.user-name { font-weight:500; }
.user-id { font-size:12px; color:#909399; }
.time-cell { display:flex; align-items:center; gap:6px; }
/* ========== 详情弹窗 ========== */
.detail-header { display:flex; align-items:center; justify-content:space-between; padding:4px 0; }
.detail-header-left { display:flex; align-items:center; gap:14px; }
.detail-avatar { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.detail-avatar.active { background:#f0f9eb; color:#67c23a; }
.detail-avatar.disabled { background:#fef0f0; color:#f56c6c; }
.detail-header-title { font-size:16px; font-weight:700; color:#1d1d1f; margin:0; line-height:1.3; }
.detail-header-sub { font-size:13px; color:#86868b; margin:2px 0 0; }
.detail-header-right { display:flex; align-items:center; gap:10px; }
.detail-status-badge { font-size:12px; font-weight:600; padding:4px 12px; border-radius:20px; letter-spacing:.3px; }
.detail-status-badge.active { background:#f0f9eb; color:#67c23a; }
.detail-status-badge.disabled { background:#fef0f0; color:#f56c6c; }
.detail-close-btn { width:32px; height:32px; border-radius:50%; border:none; background:#f5f5f7; color:#86868b; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .2s; }
.detail-close-btn:hover { background:#e8e8ed; color:#1d1d1f; }
.detail-body { display:flex; flex-direction:column; gap:20px; margin-top:8px; }
.detail-row-group { background:#f8f9fb; border-radius:12px; padding:16px 18px 14px; }
.detail-row-label { display:block; font-size:11px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:.8px; margin-bottom:10px; }
.detail-row { display:flex; justify-content:space-between; align-items:center; padding:7px 0; }
.detail-row + .detail-row { border-top:1px solid #f0f0f4; }
.detail-row-key { font-size:13px; color:#6e6e73; }
.detail-row-val { font-size:13px; font-weight:600; color:#1d1d1f; text-align:right; max-width:60%; word-break:break-all; }
.detail-row-val.mono { font-family:'SF Mono','Courier New',monospace; font-size:13px; letter-spacing:.3px; }
.detail-remark { font-size:13px; color:#1d1d1f; margin:0; line-height:1.6; }
.detail-actions { margin-top:4px; display:flex; gap:12px; justify-content:flex-end; }
/* 角色 pill */
.role-pill { display:inline-block; padding:3px 12px; border-radius:20px; font-size:12px; font-weight:600; letter-spacing:.2px; }
.role-pill.role-admin { background:#fef2f2; color:#dc2626; }
.role-pill.role-project_admin { background:#eff6ff; color:#2563eb; }
.role-pill.role-agent { background:#fef3c7; color:#d97706; }
.role-pill.role-user { background:#f4f4f5; color:#71717a; }
.text-success { color:#16a34a; }
.text-danger { color:#dc2626; }
.role-option { display:flex; align-items:center; gap:8px; }
.role-desc { color:#909399; font-size:12px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+41 -4
View File
@@ -200,13 +200,39 @@ function handleExport(format) {
<style scoped>
.coupons-page { max-width:1600px; margin:0 auto; }
/* ========== 统计卡片 ========== */
.stats-row { margin-bottom:20px; }
.stat-card { display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:12px; background:#fff; border:1px solid #f0f0f4; transition:all .25s; cursor:default; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.05); }
.stat-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stat-icon :deep(.el-icon) { font-size:20px !important; }
.stat-total .stat-icon { background:#eff6ff; color:#3b82f6; }
.stat-active .stat-icon { background:#f0fdf4; color:#22c55e; }
.stat-used .stat-icon { background:#f5f3ff; color:#8b5cf6; }
.stat-info { display:flex; flex-direction:column; min-width:0; }
.stat-value { font-size:22px; font-weight:700; color:#1d1d1f; line-height:1.1; letter-spacing:-.3px; }
.stat-label { font-size:12px; color:#9ca3af; margin-top:2px; font-weight:500; }
/* ========== 主卡片 ========== */
.advanced-search { padding:20px; background:#f5f7fa; border-radius:8px; margin-bottom:20px; }
.main-card { margin-bottom:20px; border-radius:16px; border:1px solid #f0f0f4; }
.main-card:deep(.el-card__body) { padding:24px; }
.advanced-search { padding:20px 24px; background:#f8f9fb; border-radius:14px; margin-bottom:20px; border:1px solid #f0f0f4; }
.search-form { display:flex; flex-wrap:wrap; gap:12px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.toolbar-left,.toolbar-right { display:flex; gap:12px; flex-wrap:wrap; }
.data-table :deep(.el-table__header th) { font-weight:600; color:#303133; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; padding:0; }
.toolbar-left,.toolbar-right { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar :deep(.el-button) { border-radius:10px; font-weight:500; }
/* ========== 表格 ========== */
.data-table { border-radius:12px; overflow:hidden; }
.data-table:deep(.el-table__header-wrapper) { border-radius:12px 12px 0 0; }
.data-table:deep(.el-table__header th) { background:#f8f9fb; font-weight:600; color:#374151; font-size:13px; padding:14px 0; border-color:#f0f0f4; }
.data-table:deep(.el-table__body td) { padding:12px 0; font-size:13px; color:#374151; border-color:#f5f5f7; }
.data-table:deep(.el-table__row:hover > td) { background:#f8faff !important; }
.data-table:deep(.el-table__row--striped td) { background:#fcfcfd; }
.data-table:deep(.el-table__row--striped:hover > td) { background:#f8faff !important; }
.mono-text { font-family:'SF Mono',Cascadia Code,Courier New,monospace; font-size:13px; letter-spacing:.2px; }
.pagination-wrapper { margin-top:20px; display:flex; justify-content:flex-end; }
.column-settings { padding:8px; }
.column-settings-title { font-weight:600; margin-bottom:12px; }
@@ -214,10 +240,21 @@ function handleExport(format) {
.expand-enter-active,.expand-leave-active { transition:all .3s ease; }
.expand-enter-from,.expand-leave-to { opacity:0; max-height:0; overflow:hidden; }
.expand-enter-to,.expand-leave-from { opacity:1; max-height:200px; }
@media(max-width:768px){
.toolbar { flex-direction:column; align-items:stretch; }
.toolbar-left,.toolbar-right { width:100%; }
.search-form { flex-direction:column; }
.search-form .el-form-item,.search-form .el-select,.search-form .el-input { width:100% !important; }
.main-card:deep(.el-card__body) { padding:14px; }
.advanced-search { padding:14px; }
.stat-card { padding:10px 12px; }
.stat-icon { width:36px; height:36px; border-radius:8px; }
.stat-icon :deep(.el-icon) { font-size:18px !important; }
.stat-value { font-size:18px; }
.stat-label { font-size:11px; }
}
@media(max-width:480px){
.stats-row :deep(.el-col) { margin-bottom:12px; }
}
</style>
+152
View File
@@ -0,0 +1,152 @@
<template>
<div class="result-page">
<div class="result-card">
<div class="result-icon" :class="isSuccess ? 'success' : 'fail'">
<svg v-if="isSuccess" viewBox="0 0 24 24" width="56" height="56" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"/><polyline points="16 10 11 15 8 12"/>
</svg>
<svg v-else viewBox="0 0 24 24" width="56" height="56" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/>
</svg>
</div>
<h2 class="result-title">{{ completeResult?.is_renew ? '续费成功' : (isSuccess ? '支付成功' : '支付未完�?) }}</h2>
<p class="result-desc">
<template v-if="completing">正在确认订单�?/template>
<template v-else-if="completeResult">{{ completeResult.is_renew ? '授权有效期已延长�?' + (completeResult.expire_time || '永久') : '授权已创建,机器人QQ: ' + (completeResult.bot_qq || '') }}</template>
<template v-else-if="completeError">{{ completeError }}</template>
<template v-else-if="isSuccess">感谢您的购买,订单已处理</template>
<template v-else>如已付款请等待系统确认,或联系客�?/template>
</p>
<div v-if="params.out_trade_no" class="result-info">
<div class="info-row">
<span class="info-label">订单�?/span>
<span class="info-value mono">{{ params.out_trade_no }}</span>
</div>
<div class="info-row">
<span class="info-label">交易�?/span>
<span class="info-value mono">{{ params.trade_no || '-' }}</span>
</div>
<div class="info-row" v-if="params.money">
<span class="info-label">金额</span>
<span class="info-value">¥{{ params.money }}</span>
</div>
<div class="info-row">
<span class="info-label">状�?/span>
<span class="info-value" :class="isSuccess ? 'text-green' : 'text-orange'">{{ isSuccess ? '交易成功' : params.trade_status || '处理�? }}</span>
</div>
</div>
<div class="result-actions">
<a href="#/shop" class="btn-primary">返回购买中心</a>
</div>
</div>
</div>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const params = computed(() => ({
trade_status: route.query.trade_status || '',
out_trade_no: route.query.out_trade_no || '',
trade_no: route.query.trade_no || '',
money: route.query.money || '',
type: route.query.type || '',
pid: route.query.pid || '',
sign: route.query.sign || '',
sign_type: route.query.sign_type || '',
}))
const isSuccess = computed(() => params.value.trade_status === 'TRADE_SUCCESS')
const completing = ref(false)
const completeResult = ref(null)
const completeError = ref('')
async function tryComplete() {
if (!isSuccess.value || completing.value || completeResult.value) return
completing.value = true
completeError.value = ''
try {
const { default: request } = await import('@/api')
const res = await request.post('/public/payment/complete', {
trade_no: params.value.trade_no,
out_trade_no: params.value.out_trade_no,
trade_status: params.value.trade_status,
money: params.value.money,
type: params.value.type,
pid: params.value.pid,
sign: params.value.sign,
sign_type: params.value.sign_type,
})
completeResult.value = res.data
} catch (err) {
completeError.value = err?.message || '订单确认失败'
} finally {
completing.value = false
}
}
onMounted(() => {
document.title = '支付结果 - CardAuth'
tryComplete()
})
</script>
<style scoped>
.result-page {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #f0f4ff 0%, #e8edf5 100%);
padding: 24px;
}
.result-card {
background: #fff;
border-radius: 16px;
box-shadow: 0 8px 40px rgba(0,0,0,0.08);
padding: 48px 40px;
max-width: 440px;
width: 100%;
text-align: center;
}
.result-icon {
width: 88px; height: 88px;
margin: 0 auto 24px;
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
}
.result-icon.success { background: #ecfdf5; color: #16a34a; }
.result-icon.fail { background: #fef2f2; color: #ef4444; }
.result-title { font-size: 24px; font-weight: 700; color: #1f2937; margin: 0 0 8px; }
.result-desc { font-size: 14px; color: #6b7280; margin: 0 0 28px; }
.result-info {
text-align: left; background: #f9fafb;
border-radius: 10px; padding: 16px 20px;
margin-bottom: 28px;
}
.info-row {
display: flex; justify-content: space-between; align-items: center;
padding: 8px 0;
border-bottom: 1px solid #f3f4f6;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 13px; color: #9ca3af; }
.info-value { font-size: 14px; color: #374151; font-weight: 500; }
.text-green { color: #16a34a !important; }
.text-orange { color: #f97316 !important; }
.result-actions { margin-top: 8px; }
.btn-primary {
display: inline-block; width: 100%; padding: 14px;
background: #3b82f6; color: #fff; border: none;
border-radius: 10px; font-size: 15px; font-weight: 600;
cursor: pointer; text-decoration: none;
transition: background 0.2s;
}
.btn-primary:hover { background: #2563eb; }
.mono { font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; }
</style>
+4 -1
View File
@@ -682,7 +682,10 @@ async function handlePay() {
coupon_code: buyCouponResult.value?.valid ? buyCouponCode.value.trim() : '',
bot_qq: buyBotQq.value.trim(), contact_qq: buyContactQq.value.trim(),
})
if (res.data.pay_url) window.open(res.data.pay_url, '_blank')
if (res.data.pay_url) {
ElMessage.success('订单创建成功,5秒后跳转支付页面')
setTimeout(() => { window.open(res.data.pay_url, '_blank') }, 5000)
}
pollOrderStatus(res.data.order_no)
} catch { /* handled */ }
finally { loading.pay = false }