DashboardHome.vue 4.93 KB
<template>
  <div class="dashboard-home">
    <section class="hero-card">
      <div class="hero-copy">
        <div class="hero-pill">Soft-Neo Dashboard</div>
        <h2>欢迎回到地利外卖运营工作台</h2>
        <p>把租户、骑手、订单和分站管理集中在一张更轻盈的首页里,业务页面本身只保留导航与内容,让操作区域更大、更专注。</p>
        <div class="hero-grid">
          <div class="hero-metric">
            <span>Operation Focus</span>
            <strong>租户 · 骑手 · 订单</strong>
          </div>
          <div class="hero-metric">
            <span>Visual Mood</span>
            <strong>Lavender / Warm Glow</strong>
          </div>
        </div>
      </div>
      <div class="hero-visual">
        <div class="orb orb-a"></div>
        <div class="orb orb-b"></div>
        <img :src="heroImage" alt="dashboard illustration" />
      </div>
    </section>

    <section class="content-grid">
      <a-card title="快捷入口" :bordered="false">
        <div class="quick-links">
          <button v-for="item in quickLinks" :key="item.path" class="quick-link" type="button" @click="go(item.path)">
            <strong>{{ item.title }}</strong>
            <span>{{ item.desc }}</span>
          </button>
        </div>
      </a-card>

      <a-card title="界面说明" :bordered="false">
        <ul class="soft-notes">
          <li>首页保留大视觉和信息卡片,适合做总览和快捷入口。</li>
          <li>其他菜单页只保留紧凑头部和内容区,避免公共模块挤压表格空间。</li>
          <li>整体主题继续沿用柔紫渐变、软阴影和圆角卡片。</li>
        </ul>
      </a-card>
    </section>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import heroImage from '@/assets/hero.png'

const router = useRouter()

const quickLinks = [
  { path: '/city', title: '租户管理', desc: '配置配送费、骑手等级与租户信息' },
  { path: '/rider', title: '骑手管理', desc: '查看骑手、设置等级和账号状态' },
  { path: '/order', title: '订单列表', desc: '集中处理配送中的订单流转' },
  { path: '/substation', title: '分站管理', desc: '维护租户站点账号和权限' },
]

function go(path: string) {
  router.push(path)
}
</script>

<style scoped>
.dashboard-home {
  display: grid;
  gap: 16px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.9fr);
  gap: 14px;
  border-radius: 24px;
  padding: 20px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.62)),
    linear-gradient(135deg, rgba(198, 185, 255, 0.72), rgba(255, 217, 236, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 44px rgba(132, 114, 212, 0.14);
}

.hero-pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #6f5fe2;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-copy h2 {
  margin: 12px 0 8px;
  font-size: 28px;
  line-height: 1.15;
  font-family: 'Outfit', sans-serif;
  color: #2f2946;
}

.hero-copy p,
.hero-metric span,
.quick-link span,
.soft-notes {
  color: #8d88a4;
}

.hero-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-metric {
  min-width: 190px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  padding: 12px 14px;
}

.hero-metric span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.hero-metric strong,
.quick-link strong {
  color: #322c4a;
  font-family: 'Outfit', sans-serif;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 220px;
}

.hero-visual img {
  position: relative;
  z-index: 2;
  width: min(100%, 320px);
  filter: drop-shadow(0 24px 36px rgba(135, 119, 212, 0.24));
}

.orb {
  position: absolute;
  border-radius: 999px;
}

.orb-a {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(198, 185, 255, 0.48) 0%, transparent 70%);
  top: 8px;
  right: 50px;
}

.orb-b {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 217, 136, 0.38) 0%, transparent 70%);
  right: 24px;
  top: 40px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-link {
  text-align: left;
  border: 1px solid rgba(202, 193, 240, 0.34);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
}

.soft-notes {
  margin: 0;
  padding-left: 18px;
}

.soft-notes li + li {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .hero-card,
  .content-grid,
  .quick-links {
    grid-template-columns: 1fr;
  }

  .hero-copy h2 {
    font-size: 24px;
  }
}
</style>