fix(mobile): align module buttons, fix input placeholder truncation, and improve button aesthetics

This commit is contained in:
fuenmao
2026-09-21 16:05:59 +08:00
parent e4070f207c
commit b362f627f1
3 changed files with 76 additions and 28 deletions
+62 -14
View File
@@ -59,19 +59,57 @@ button { cursor: pointer; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title > span { font-size: 18px; font-weight: 700; }
.section-title small { color: #82908c; }
.section-title button { border: 0; background: transparent; color: var(--green); }
.section-title button {
border: 0;
background: rgba(12, 80, 69, 0.08);
color: var(--green);
padding: 4px 10px;
border-radius: 12px;
font-size: 12px;
font-weight: 600;
}
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.module-card { min-height: 160px; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: #f8f8f4; color: var(--deep); transition: .2s; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.module-card {
min-height: 164px;
padding: 14px 6px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid var(--line);
border-radius: 16px;
background: #f8f8f4;
color: var(--deep);
transition: .2s;
}
.module-card.selected { color: #fff; background: var(--green); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(12,80,69,.18); }
.module-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 18px; border: 1px solid currentColor; border-radius: 50%; font-size: 20px; }
.module-card strong, .module-card small { display: block; }
.module-card small { min-height: 36px; margin-top: 7px; opacity: .7; line-height: 1.5; }
.module-card i { display: block; margin-top: 12px; font-size: 11px; font-style: normal; opacity: .75; }
.form-card .van-field { padding: 14px 0; border-bottom: 1px solid #eee; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.module-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border: 1px solid currentColor; border-radius: 50%; font-size: 20px; flex-shrink: 0; }
.module-card strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.module-card small { display: flex; align-items: center; justify-content: center; min-height: 28px; margin-top: 2px; opacity: .7; line-height: 1.35; font-size: 11px; }
.module-card i {
display: inline-flex;
align-items: center;
justify-content: center;
margin-top: auto;
padding: 4px 12px;
border-radius: 12px;
font-size: 11px;
font-style: normal;
font-weight: 600;
white-space: nowrap;
background: rgba(18, 63, 55, 0.08);
color: var(--deep);
}
.module-card.selected i {
background: rgba(255, 255, 255, 0.22);
color: #fff;
}
.form-card .van-field { padding: 12px 0; border-bottom: 1px solid #eee; }
.form-card .van-field:last-of-type { border-bottom: 0; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.sticky-action { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); background: rgba(248,246,240,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.sticky-action .van-button { max-width: 720px; height: 50px; margin: 0 auto; }
.sticky-action .van-button { max-width: 720px; height: 50px; margin: 0 auto; font-size: 15px; font-weight: 600; box-shadow: 0 6px 18px rgba(12,80,69,.2); }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; }
.avatar-button { width: 46px; height: 46px; color: #fff; border: 0; border-radius: 50%; background: var(--green); }
@@ -95,14 +133,24 @@ button { cursor: pointer; }
.plan-item p, .scene-row p { margin: 7px 0 0; color: #75847f; font-size: 13px; line-height: 1.6; }
.status-dot { color: #a27639 !important; }
.scene-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; border-radius: 14px; background: #f6f7f3; }
.scene-row button { padding: 9px 12px; border: 0; border-radius: 18px; color: #87918e; background: #e4e7e3; font-size: 11px; }
.scene-row button {
white-space: nowrap;
flex-shrink: 0;
padding: 7px 16px;
border: 1px solid rgba(12, 80, 69, 0.2);
border-radius: 16px;
color: var(--green);
background: #eaf3f0;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: .2s;
}
.scene-row button:active { background: var(--green); color: #fff; }
.medical-note { max-width: 760px; margin: 24px auto; color: #969e9b; font-size: 11px; text-align: center; }
.loading-card { color: #73817d; text-align: center; }
@media (max-width: 520px) {
.module-grid { grid-template-columns: 1fr; }
.module-card { min-height: auto; }
.two-column { grid-template-columns: 1fr; }
.brand-panel { min-height: 390px; }
.auth-card { margin-top: -54px; }
.plan-heading { display: block; }
+1 -1
View File
@@ -112,7 +112,7 @@ onMounted(load)
<strong>舒睡模式</strong>
<p>灯光 · 空调 · 香氛 · 除湿机</p>
</div>
<button type="button" disabled>下一阶段启用</button>
<button type="button">准备就绪</button>
</div>
</section>
+13 -13
View File
@@ -8,9 +8,9 @@ const router = useRouter()
const loading = ref(false)
const selected = ref<string[]>(['sleep', 'exercise', 'diet'])
const modules = [
{ code: 'sleep', icon: '☾', title: '睡眠质量', copy: '睡眠时长、环境与恢复情况' },
{ code: 'exercise', icon: '↗', title: '运动情况', copy: '日常活动、训练与久坐提醒' },
{ code: 'diet', icon: '◒', title: '饮食情况', copy: '三餐、饮水与营养偏好' }
{ code: 'sleep', icon: '☾', title: '睡眠质量', copy: '环境与节律深睡' },
{ code: 'exercise', icon: '↗', title: '运动情况', copy: '日常活动与活力' },
{ code: 'diet', icon: '◒', title: '饮食情况', copy: '三餐热量与偏好' }
]
const profile = reactive({
gender: '',
@@ -59,7 +59,7 @@ async function submit() {
</header>
<section class="section-card">
<div class="section-title"><span>健康板块</span><small>可多选</small></div>
<div class="section-title"><span>健康板块</span><small>可多选,已选 {{ selected.length }}/3</small></div>
<div class="module-grid">
<button
v-for="item in modules"
@@ -72,22 +72,22 @@ async function submit() {
<span class="module-icon">{{ item.icon }}</span>
<strong>{{ item.title }}</strong>
<small>{{ item.copy }}</small>
<i>{{ selected.includes(item.code) ? '已选择' : '选择' }}</i>
<i>{{ selected.includes(item.code) ? '✓ 已选' : '+ 选择' }}</i>
</button>
</div>
</section>
<section class="section-card form-card">
<div class="section-title"><span>基础情况</span><small>用于生成参数</small></div>
<div class="section-title"><span>身体基线数据</span><small>用于生成参数</small></div>
<div class="two-column">
<van-field v-model="profile.gender" label="性别" placeholder="选填" />
<van-field v-model.number="profile.heightCm" type="number" label="身高" placeholder="cm" />
<van-field v-model.number="profile.weightKg" type="number" label="体重" placeholder="kg" />
<van-field v-model.number="profile.averageSleepHours" type="number" label="平均睡眠" placeholder="小时" />
<van-field v-model.number="profile.dailyExerciseMinutes" type="number" label="每日运动" placeholder="分钟" />
<van-field v-model="profile.gender" label="性别" label-width="40px" placeholder="男 / 女" />
<van-field v-model.number="profile.heightCm" type="number" label="身高" label-width="40px" placeholder="厘米(cm)" />
<van-field v-model.number="profile.weightKg" type="number" label="体重" label-width="40px" placeholder="公斤(kg)" />
<van-field v-model.number="profile.averageSleepHours" type="number" label="睡眠" label-width="40px" placeholder="小时/天" />
</div>
<van-field v-model="profile.dietPreference" label="饮食偏好" placeholder="例如清淡、少糖" />
<van-field v-model="profile.healthGoal" label="健康目标" type="textarea" rows="2" placeholder="例如改善睡眠、增加日常活动" />
<van-field v-model.number="profile.dailyExerciseMinutes" type="number" label="日均活动" label-width="70px" placeholder="平均每天中等活动时长(分钟)" />
<van-field v-model="profile.dietPreference" label="饮食偏好" label-width="70px" placeholder="例如:少油清淡、偏面食、少糖" />
<van-field v-model="profile.healthGoal" label="健康目标" label-width="70px" type="textarea" rows="2" placeholder="例如:希望改善晚上入睡困难、提升精力" />
</section>
<div class="sticky-action">