welcome.vue 4.6 KB
<template>
  <div class="welcome-container">
    <div class="welcome-bg" />

    <!-- 顶部大标题区:铺满宽度 -->
    <section class="welcome-hero">
      <div class="hero-inner">
        <div class="hero-icon-wrap">
          <i class="el-icon-office-building hero-icon" />
        </div>
        <h1 class="hero-title">欢迎使用绿纤美业ERP系统</h1>
        <p class="hero-subtitle">Welcome to Lvqian Beauty ERP System</p>
      </div>
    </section>

    <!-- 快捷入口:全宽网格,多列 -->
    <section class="welcome-actions">
      <div class="actions-inner">
        <div v-for="(item, index) in featureList" :key="index" class="action-card" @click="handleFeatureClick(item)">
          <i :class="item.icon" class="action-icon" />
          <span class="action-label">{{ item.label }}</span>
        </div>
      </div>
    </section>

    <!-- 页脚 -->
    <footer class="welcome-footer">
      <p>如有问题,请联系系统管理员</p>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'Welcome',
  data() {
    return {
      featureList: [
        { label: '美业仪表板', icon: 'el-icon-data-line', path: '/statisticsList/form9' },
        { label: '开单管理', icon: 'el-icon-document-add', path: '/lqKdKdjlb' },
        { label: '消耗管理', icon: 'el-icon-s-operation', path: '/lqXhHyhk' },
        { label: '会员管理', icon: 'el-icon-user', path: '/lqKhxx' },
        { label: '门店管理', icon: 'el-icon-office-building', path: '/lqMdxx' },
      ],
    }
  },
  methods: {
    handleFeatureClick(item) {
      if (item.path && this.$router) {
        this.$router.push(item.path).catch(() => { })
      }
    },
  },
}
</script>

<style lang="scss" scoped>
.welcome-container {
  min-height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #e8f4ff 0%, #f5f9ff 28%, #fff 55%, #f8fafc 100%);
  pointer-events: none;
}

/* 顶部大标题区:全宽、留白充足 */
.welcome-hero {
  position: relative;
  flex: 0 0 auto;
  padding: 64px 24px 48px;
  text-align: center;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.hero-icon-wrap {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(64, 158, 255, 0.35);
}

.hero-icon {
  font-size: 44px;
  color: #fff;
}

.hero-title {
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #303133;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 16px;
  margin: 0;
  color: #909399;
  font-weight: 400;
}

/* 快捷入口:全宽网格,多列卡片 */
.welcome-actions {
  position: relative;
  flex: 1 1 auto;
  padding: 0 24px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.actions-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 24px 20px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ebeef5;
  color: #606266;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;

  &:hover {
    background: #ecf5ff;
    color: #409eff;
    border-color: #d9ecff;
    box-shadow: 0 4px 20px rgba(64, 158, 255, 0.15);
  }
}

.action-icon {
  font-size: 28px;
  color: #409eff;
  margin-bottom: 12px;
}

.action-label {
  font-weight: 500;
  text-align: center;
}

/* 页脚 */
.welcome-footer {
  position: relative;
  flex: 0 0 auto;
  text-align: center;
  padding: 24px 20px;

  p {
    margin: 0;
    color: #909399;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .welcome-hero {
    padding: 48px 16px 32px;
  }

  .hero-icon-wrap {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
  }

  .hero-icon {
    font-size: 36px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .welcome-actions {
    padding: 0 16px 32px;
  }

  .actions-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
  }

  .action-card {
    min-height: 88px;
    padding: 20px 16px;
    font-size: 14px;
  }

  .action-icon {
    font-size: 24px;
    margin-bottom: 8px;
  }
}
</style>