Index.vue
4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<template>
<div class="welcome-container">
<!-- 顶部欢迎卡片 -->
<el-card class="welcome-card" shadow="never">
<div class="welcome-content">
<div class="welcome-text">
<h2>{{ greetingText }},系统管理员 👋</h2>
<p class="slogan">“汗水不会骗人,每一滴都是对健康的投资。”</p>
<div class="quick-info">
<span class="info-item">
<el-icon>
<Calendar />
</el-icon> 今天是:{{ currentDate }}
</span>
<span class="info-item">
<el-icon>
<Sunset />
</el-icon> 适宜运动指数:极佳
</span>
</div>
</div>
<div class="welcome-visual">
<div class="fitness-badge">
🏃♂️ 保持活力
</div>
</div>
</div>
</el-card>
<!-- 底部温馨提示 -->
<el-row :gutter="20" class="tip-row">
<el-col :span="24">
<el-card shadow="hover" class="tip-card">
<template #header>
<div class="tip-header">
<el-icon color="#409EFF">
<CircleCheck />
</el-icon>
<span>今日健身管理提示</span>
</div>
</template>
<div class="tip-content">
<p>🏋️♂️ <strong>合理安排课程:</strong> 建议合理分配今日私教与团课的消课节奏,并在课后提醒会员进行充分的肌肉拉伸与水分补充。</p>
<p>🥗 <strong>健康膳食建议:</strong> 三分练,七分吃。可在会员交流群或宣传板中普及高蛋白、优质碳水的低油盐搭配方案,帮助大家更好维持身形。</p>
<p>🧹 <strong>场馆环境:</strong> 请确保力量区与有氧区的器械及时消毒,并保持通风良好,为会员提供安全放心的锻炼空间。</p>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script setup>
import { computed } from 'vue'
import { Calendar, Sunset, CircleCheck } from '@element-plus/icons-vue'
// 动态获取当前日期
const currentDate = computed(() => {
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
const week = weekDays[date.getDay()]
return `${year}年${month}月${day}日 (${week})`
})
// 根据当前时间生成亲切的问候语
const greetingText = computed(() => {
const hour = new Date().getHours()
if (hour < 6) return '凌晨好'
if (hour < 9) return '早上好'
if (hour < 12) return '上午好'
if (hour < 14) return '中午好'
if (hour < 18) return '下午好'
return '晚上好'
})
</script>
<style lang="scss" scoped>
.welcome-container {
padding: 24px;
background: #f8fafc;
min-height: 100vh;
box-sizing: border-box;
}
/* 顶部背景卡片,使用带有运动气息的暗色渐变 */
.welcome-card {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
color: #ffffff;
border: none;
border-radius: 12px;
margin-bottom: 24px;
padding: 8px;
:deep(.el-card__body) {
padding: 20px;
}
.welcome-content {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 20px;
}
.welcome-text {
h2 {
font-size: 24px;
margin: 0 0 12px 0;
font-weight: 600;
color: #ffffff;
}
.slogan {
font-size: 15px;
color: #94a3b8;
margin: 0 0 20px 0;
font-style: italic;
}
.quick-info {
display: flex;
gap: 24px;
flex-wrap: wrap;
font-size: 14px;
color: #cbd5e1;
.info-item {
display: flex;
align-items: center;
gap: 6px;
}
}
}
.welcome-visual {
.fitness-badge {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
padding: 12px 24px;
border-radius: 30px;
font-size: 14px;
font-weight: 500;
color: #38bdf8;
backdrop-filter: blur(4px);
}
}
}
/* 底部温馨提示卡片样式 */
.tip-row {
margin-top: 8px;
}
.tip-card {
border-radius: 12px;
border: 1px solid #e2e8f0;
.tip-header {
display: flex;
align-items: center;
gap: 8px;
font-weight: 600;
color: #0f172a;
}
.tip-content {
p {
margin: 12px 0;
font-size: 14px;
color: #475569;
line-height: 1.6;
strong {
color: #0f172a;
}
}
}
}
</style>