Browse Source

style(admin): B-11 组件铺开 - Membership 删死 CSS + GuideStats/Purchase PageHeader/KPI StatCard/状态 StatusTag

liaoxg 1 month ago
parent
commit
2d9c3d3a1d

+ 6 - 9
cfc-web/src/views/admin/GuidePopupStats.vue

@@ -1,16 +1,15 @@
 <template>
   <div class="guide-popup-stats">
     <el-card>
-      <div slot="header">
-        <span>引导弹窗数据看板</span>
-        <el-select v-model="popupId" placeholder="全部弹窗" clearable style="width:220px;float:right" @change="load">
+      <PageHeader slot="header" title="引导弹窗数据看板">
+        <el-select v-model="popupId" placeholder="全部弹窗" clearable style="width:220px" @change="load">
           <el-option v-for="p in popups" :key="p.id" :label="p.slug" :value="p.id" />
         </el-select>
-      </div>
+      </PageHeader>
       <el-row :gutter="16">
-        <el-col :span="6"><el-card shadow="never"><div class="stat-num">{{ stats.totalViews || 0 }}</div><div class="stat-label">总曝光</div></el-card></el-col>
-        <el-col :span="6"><el-card shadow="never"><div class="stat-num">{{ stats.totalClicks || 0 }}</div><div class="stat-label">总点击</div></el-card></el-col>
-        <el-col :span="6"><el-card shadow="never"><div class="stat-num">{{ stats.completionRate || '0.0%' }}</div><div class="stat-label">完成率</div></el-card></el-col>
+        <el-col :span="6"><StatCard label="总曝光" :value="stats.totalViews || 0" /></el-col>
+        <el-col :span="6"><StatCard label="总点击" :value="stats.totalClicks || 0" /></el-col>
+        <el-col :span="6"><StatCard label="完成率" :value="stats.completionRate || '0.0%'" /></el-col>
       </el-row>
             <div class="adm-table-wrap">
 <el-table :data="trend" border style="margin-top:16px" height="100%">
@@ -48,6 +47,4 @@ export default {
 </script>
 
 <style scoped>
-.stat-num { font-size: 28px; font-weight: 700; color: #409EFF; }
-.stat-label { color: #909399; margin-top: 4px; }
 </style>

+ 0 - 41
cfc-web/src/views/admin/MembershipCenter.vue

@@ -596,47 +596,6 @@ export default {
 </script>
 
 <style scoped>
-/* ---- 统计卡片 ---- */
-.stat-card {
-  display: flex;
-  align-items: center;
-  padding: 14px 12px;
-  cursor: default;
-  border-radius: 8px;
-  overflow: hidden;
-}
-.stat-icon-wrap {
-  width: 44px;
-  height: 44px;
-  border-radius: 10px;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size: 20px;
-  flex-shrink: 0;
-  margin-right: 12px;
-}
-.stat-body { flex: 1; min-width: 0; }
-.stat-value {
-  font-size: 22px;
-  font-weight: 700;
-  color: #1e293b;
-  line-height: 1.2;
-}
-.stat-label {
-  font-size: 12px;
-  color: #94a3b8;
-  margin-top: 2px;
-}
-.stat-orange .stat-icon-wrap { background: #fef3c7; color: #f97316; }
-.stat-blue   .stat-icon-wrap { background: #dbeafe; color: #3b82f6; }
-.stat-cyan   .stat-icon-wrap { background: #cffafe; color: #06b6d4; }
-.stat-green  .stat-icon-wrap { background: #d1fae5; color: #10b981; }
-.stat-red    .stat-icon-wrap { background: #fee2e2; color: #ef4444; }
-.stat-purple .stat-icon-wrap { background: #E6F4FF; color: #1677FF; }
-.stat-info   .stat-icon-wrap { background: #f1f5f9; color: #64748b; }
-.stat-primary .stat-icon-wrap { background: #dbeafe; color: #3b82f6; }
-
 /* ---- 升级路径 ---- */
 .level-path {
   display: inline-flex;

+ 3 - 8
cfc-web/src/views/admin/PurchaseManagement.vue

@@ -66,7 +66,7 @@
         </el-table-column>
         <el-table-column prop="status" label="状态" width="100">
           <template slot-scope="{ row }">
-            <el-tag :type="statusType(row.status)" size="small">{{ statusText(row.status) }}</el-tag>
+            <StatusTag :type="statusType(row.status)" :text="statusText(row.status)" size="small" />
           </template>
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
@@ -86,7 +86,7 @@
         </el-table-column>
         <el-table-column prop="isEarlyRenewal" label="早期续费" width="90">
           <template slot-scope="{ row }">
-            <el-tag :type="row.isEarlyRenewal ? 'success' : 'info'" size="small">{{ row.isEarlyRenewal ? '是' : '否' }}</el-tag>
+            <StatusTag :type="row.isEarlyRenewal ? 'success' : 'info'" :text="row.isEarlyRenewal ? '是' : '否'" size="small" />
           </template>
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('isEarlyRenewal', $event)">早期续费<span v-if="sortIndex('isEarlyRenewal') !== null" class="sort-index" :class="sortClass('isEarlyRenewal') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('isEarlyRenewal') }}</span>{{ sortIcon('isEarlyRenewal') }}</span>
@@ -227,11 +227,6 @@ export default {
 
 <style scoped>
 .admin-page { padding: 16px; }
-.admin-page-header { display: flex; justify-content: space-between; align-items: center; }
-.admin-page-title { font-size: 16px; font-weight: bold; }
-.stat-card { text-align: center; }
-.stat-value { font-size: 28rpx; font-weight: bold; color: #F97316; }
-.stat-label { font-size: 12px; color: #999; margin-top: 4px; }
 .sort-header {
   cursor: pointer;
   user-select: none;
@@ -239,7 +234,7 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 .sort-tag {
   margin-left: 8px;