优化显示样式
This commit is contained in:
1 parent
65c4642444
commit
c21b66bd38
6 files changed
+895
-365
No files matched your search
@@ -26,6 +26,7 @@ const behaviorFilters = ref<BehaviorFilter[]>([])
|
||||
const sortOrder = ref<'desc' | 'asc'>('desc')
|
||||
const manageMode = ref(false)
|
||||
const selectedRecordIds = ref<string[]>([])
|
||||
const showFilterSheet = ref(false)
|
||||
|
||||
// 补录弹窗控制
|
||||
const showManualModal = ref(false)
|
||||
@@ -71,10 +72,6 @@ watch(() => store.baby?.babyId || store.selectedBabyId, (newId) => {
|
||||
}
|
||||
})
|
||||
|
||||
function clearFilter() {
|
||||
filterDate.value = ''
|
||||
}
|
||||
|
||||
function toggleBehaviorFilter(type: BehaviorFilter) {
|
||||
behaviorFilters.value = behaviorFilters.value.includes(type)
|
||||
? behaviorFilters.value.filter(item => item !== type)
|
||||
@@ -86,6 +83,25 @@ function clearAllFilters() {
|
||||
behaviorFilters.value = []
|
||||
}
|
||||
|
||||
const behaviorFilterOptions: Array<{ type: BehaviorFilter; label: string }> = [
|
||||
{ type: 'feeding', label: '喂奶' },
|
||||
{ type: 'sleep', label: '睡眠' },
|
||||
{ type: 'pee', label: '小便' },
|
||||
{ type: 'poop', label: '大便' }
|
||||
]
|
||||
|
||||
const activeBehaviorFilterText = computed(() => {
|
||||
if (!behaviorFilters.value.length) return ''
|
||||
return behaviorFilterOptions
|
||||
.filter(option => behaviorFilters.value.includes(option.type))
|
||||
.map(option => option.label)
|
||||
.join('、')
|
||||
})
|
||||
|
||||
const activeFilterCount = computed(() => {
|
||||
return (filterDate.value ? 1 : 0) + behaviorFilters.value.length
|
||||
})
|
||||
|
||||
function matchesBehaviorFilter(record: CareRecord) {
|
||||
if (!behaviorFilters.value.length) return true
|
||||
return behaviorFilters.value.some(type => {
|
||||
@@ -216,99 +232,35 @@ const groupedRecords = computed<RecordDayGroup[]>(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const totalCount = computed(() => filteredRecords.value.length)
|
||||
const hasActiveFilter = computed(() => Boolean(filterDate.value) || behaviorFilters.value.length > 0)
|
||||
const selectedCount = computed(() => selectedRecordIds.value.length)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="page">
|
||||
<header class="page-header">
|
||||
<h1>记录</h1>
|
||||
</header>
|
||||
|
||||
<!-- 顶部过滤与排序工具栏 -->
|
||||
<!-- 顶部日期、补录与轻量工具栏 -->
|
||||
<div class="timeline-toolbar">
|
||||
<div class="timeline-toolbar-top">
|
||||
<!-- 日期过滤输入框 -->
|
||||
<div class="date-filter-box">
|
||||
<span class="filter-icon">📅</span>
|
||||
<input
|
||||
v-model="filterDate"
|
||||
type="date"
|
||||
class="filter-date-input"
|
||||
aria-label="筛选特定日期"
|
||||
/>
|
||||
<button
|
||||
v-if="filterDate"
|
||||
type="button"
|
||||
class="clear-filter-btn"
|
||||
title="查看全部日期"
|
||||
@click="clearFilter"
|
||||
>
|
||||
✕ 全部
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="timeline-count-summary">
|
||||
<span v-if="hasActiveFilter">
|
||||
已筛选 <strong>{{ totalCount }}</strong> 项
|
||||
</span>
|
||||
<span v-else>
|
||||
共 <strong>{{ totalCount }}</strong> 项
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="behavior-filter-row" aria-label="按行为筛选">
|
||||
<button
|
||||
type="button"
|
||||
class="behavior-filter-chip"
|
||||
:class="{ active: behaviorFilters.includes('feeding') }"
|
||||
@click="toggleBehaviorFilter('feeding')"
|
||||
>
|
||||
喂奶
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="behavior-filter-chip"
|
||||
:class="{ active: behaviorFilters.includes('sleep') }"
|
||||
@click="toggleBehaviorFilter('sleep')"
|
||||
>
|
||||
睡眠
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="behavior-filter-chip"
|
||||
:class="{ active: behaviorFilters.includes('pee') }"
|
||||
@click="toggleBehaviorFilter('pee')"
|
||||
>
|
||||
小便
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="behavior-filter-chip"
|
||||
:class="{ active: behaviorFilters.includes('poop') }"
|
||||
@click="toggleBehaviorFilter('poop')"
|
||||
>
|
||||
大便
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 右侧操作项:天内排序切换与补录 -->
|
||||
<div class="toolbar-actions">
|
||||
<div class="record-action-row primary">
|
||||
<button class="primary-pill-button" @click="openManualModal('quick')">
|
||||
+ 补记照护
|
||||
+ 补一组记录
|
||||
</button>
|
||||
<button class="secondary-pill-button" @click="openManualModal('detail')">
|
||||
补单次
|
||||
补一条记录
|
||||
</button>
|
||||
</div>
|
||||
<div class="record-action-row subtle">
|
||||
<button
|
||||
type="button"
|
||||
class="sort-toggle-btn"
|
||||
class="toolbar-text-btn"
|
||||
:class="{ active: hasActiveFilter }"
|
||||
@click="showFilterSheet = true"
|
||||
>
|
||||
筛选<span v-if="activeFilterCount">·{{ activeFilterCount }}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="toolbar-text-btn"
|
||||
:class="{ active: sortOrder === 'asc' }"
|
||||
:title="sortOrder === 'desc' ? '当前:当天内由晚到早(倒序),点击切换为正序' : '当前:当天内由早到晚(正序),点击切换为倒序'"
|
||||
@click="toggleSortOrder"
|
||||
@@ -317,7 +269,7 @@ const selectedCount = computed(() => selectedRecordIds.value.length)
|
||||
{{ sortOrder === 'desc' ? '倒序' : '正序' }}
|
||||
</button>
|
||||
<button
|
||||
class="manage-toggle-btn"
|
||||
class="toolbar-text-btn"
|
||||
:class="{ active: manageMode }"
|
||||
@click="toggleManageMode"
|
||||
>
|
||||
@@ -330,7 +282,7 @@ const selectedCount = computed(() => selectedRecordIds.value.length)
|
||||
<div v-if="hasActiveFilter" class="timeline-meta-bar">
|
||||
<span v-if="hasActiveFilter" class="meta-filter-active">
|
||||
<span v-if="filterDate"><strong>{{ filterDate }}</strong></span>
|
||||
<span v-if="behaviorFilters.length"> 已选 {{ behaviorFilters.length }} 类行为</span>
|
||||
<span v-if="activeBehaviorFilterText"> {{ activeBehaviorFilterText }}</span>
|
||||
</span>
|
||||
<button class="clear-filter-btn" type="button" @click="clearAllFilters">清空筛选</button>
|
||||
</div>
|
||||
@@ -438,11 +390,54 @@ const selectedCount = computed(() => selectedRecordIds.value.length)
|
||||
</p>
|
||||
<div style="display: flex; gap: 10px; justify-content: center;">
|
||||
<button v-if="hasActiveFilter" class="secondary-btn" @click="clearAllFilters">查看全部记录</button>
|
||||
<button class="primary-pill-button" @click="openManualModal('quick')">+ 补记照护</button>
|
||||
<button class="secondary-pill-button" @click="openManualModal('detail')">补单次</button>
|
||||
<button class="primary-pill-button" @click="openManualModal('quick')">+ 补一组记录</button>
|
||||
<button class="secondary-pill-button" @click="openManualModal('detail')">补一条记录</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<van-popup
|
||||
v-model:show="showFilterSheet"
|
||||
position="bottom"
|
||||
round
|
||||
safe-area-inset-bottom
|
||||
teleport="body"
|
||||
>
|
||||
<div class="timeline-filter-sheet">
|
||||
<div class="timeline-filter-sheet-head">
|
||||
<div>
|
||||
<h3>筛选记录</h3>
|
||||
<p>按日期或照护行为缩小范围</p>
|
||||
</div>
|
||||
<button type="button" class="sheet-close-btn" @click="showFilterSheet = false">完成</button>
|
||||
</div>
|
||||
<label class="timeline-filter-date-field">
|
||||
<span>日期</span>
|
||||
<input
|
||||
v-model="filterDate"
|
||||
type="date"
|
||||
class="filter-date-input"
|
||||
aria-label="筛选特定日期"
|
||||
/>
|
||||
</label>
|
||||
<div class="behavior-filter-row sheet" aria-label="按行为筛选">
|
||||
<button
|
||||
v-for="option in behaviorFilterOptions"
|
||||
:key="option.type"
|
||||
type="button"
|
||||
class="behavior-filter-chip"
|
||||
:class="{ active: behaviorFilters.includes(option.type) }"
|
||||
@click="toggleBehaviorFilter(option.type)"
|
||||
>
|
||||
{{ option.label }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="timeline-filter-sheet-actions">
|
||||
<button type="button" class="secondary-pill-button" @click="clearAllFilters">查看全部</button>
|
||||
<button type="button" class="primary-pill-button" @click="showFilterSheet = false">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
<!-- 弹窗:补录记录维护组件 -->
|
||||
<TimelineManualModal v-model:show="showManualModal" :initial-mode="manualInitialMode" @success="handleRecordChanged" />
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { showToast } from 'vant'
|
||||
import { useCareStore } from '../stores/careStore'
|
||||
@@ -29,8 +29,16 @@ const breastSide = ref<'left' | 'right'>(store.preferences.defaultBreastSide ||
|
||||
// 切换抽屉状态
|
||||
const showBabyPicker = ref(false)
|
||||
const showMemberPicker = ref(false)
|
||||
const showSleepSheet = ref(false)
|
||||
|
||||
const oneClickDuration = ref(20)
|
||||
const sleepQuickDuration = ref(60)
|
||||
const sleepStartDate = ref('')
|
||||
const sleepStartTimeStr = ref('')
|
||||
|
||||
const todayMilkAmount = computed(() => {
|
||||
return (store.summary?.timeline || []).reduce((sum, record) => sum + (record.amountMl || 0), 0)
|
||||
})
|
||||
|
||||
watch(
|
||||
() => store.preferences.defaultBottleAmount,
|
||||
@@ -180,69 +188,87 @@ async function handleOneClickBreastfeeding() {
|
||||
`已记录亲喂 ${dur}分钟(${startStr} ~ ${endStr})`
|
||||
)
|
||||
}
|
||||
|
||||
function openSleepAssist() {
|
||||
const activeSleep = store.summary?.activeSleep
|
||||
if (activeSleep?.startTime) {
|
||||
const start = new Date(activeSleep.startTime)
|
||||
sleepStartDate.value = getLocalDateStr(start)
|
||||
sleepStartTimeStr.value = getLocalTimeStr(start)
|
||||
} else {
|
||||
const now = store.getServerNow()
|
||||
sleepStartDate.value = getLocalDateStr(now)
|
||||
sleepStartTimeStr.value = getLocalTimeStr(now)
|
||||
}
|
||||
showSleepSheet.value = true
|
||||
}
|
||||
|
||||
async function handleQuickSleepLog() {
|
||||
const dur = sleepQuickDuration.value || 60
|
||||
const now = store.getServerNow()
|
||||
const start = new Date(now.getTime() - dur * 60000)
|
||||
const startTime = `${getLocalDateStr(start)}T${getLocalTimeStr(start)}:00`
|
||||
const endTime = `${getLocalDateStr(now)}T${getLocalTimeStr(now)}:00`
|
||||
await runWithTip(
|
||||
async () => {
|
||||
await store.manualLog({
|
||||
recordType: 'sleep',
|
||||
startTime,
|
||||
endTime,
|
||||
durationMinutes: dur,
|
||||
operatorName: store.operatorName
|
||||
})
|
||||
},
|
||||
`已速记睡眠 ${dur}分钟`
|
||||
)
|
||||
showSleepSheet.value = false
|
||||
}
|
||||
|
||||
async function handleAdjustSleepStart() {
|
||||
const activeSleep = store.summary?.activeSleep
|
||||
if (!activeSleep?.recordId || !sleepStartDate.value || !sleepStartTimeStr.value) return
|
||||
const startTime = `${sleepStartDate.value}T${sleepStartTimeStr.value}:00`
|
||||
await runWithTip(
|
||||
async () => {
|
||||
await store.editRecord(activeSleep.recordId, {
|
||||
recordType: 'sleep',
|
||||
startTime,
|
||||
endTime: null,
|
||||
durationMinutes: null,
|
||||
operatorName: store.operatorName
|
||||
})
|
||||
},
|
||||
'已调整入睡时间'
|
||||
)
|
||||
showSleepSheet.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="page">
|
||||
<!-- 顶部一体化温润状态卡片 -->
|
||||
<!-- 顶部轻量上下文 -->
|
||||
<header class="today-top-card">
|
||||
<!-- 顶栏:家庭名称与记录人切换胶囊 -->
|
||||
<div class="top-row">
|
||||
<div class="family-badge">
|
||||
<span class="family-icon">🏡</span>
|
||||
<span class="family-name">{{ store.context?.family.name || '新生儿照护家庭' }}</span>
|
||||
<button class="baby-main-row" type="button" @click="showBabyPicker = true">
|
||||
<div class="baby-meta">
|
||||
<div class="baby-name-row">
|
||||
<strong class="baby-name">{{ store.baby?.name || '宝宝' }}</strong>
|
||||
<span class="baby-age-chip">{{ store.baby?.ageText || '出生第 3 天' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="operator-pill" type="button" @click="showMemberPicker = true">
|
||||
</button>
|
||||
<button class="operator-pill" type="button" @click="showMemberPicker = true">
|
||||
<span class="operator-avatar">{{ getRoleIcon(store.operatorName) }}</span>
|
||||
<span class="operator-text">{{ store.operatorName }}</span>
|
||||
<span class="pill-arrow">▾</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 主体:宝宝信息与切换入口 -->
|
||||
<div class="baby-main-row" @click="showBabyPicker = true">
|
||||
<div class="baby-avatar-wrap">
|
||||
<span class="baby-avatar-emoji">👶</span>
|
||||
<span class="gender-dot" :class="store.baby?.gender || 'boy'"></span>
|
||||
</div>
|
||||
<div class="baby-meta">
|
||||
<div class="baby-name-row">
|
||||
<h1 class="baby-name">{{ store.baby?.name || '宝宝' }}</h1>
|
||||
<span class="baby-switch-tag">切换宝宝 ▾</span>
|
||||
</div>
|
||||
<div class="baby-tags">
|
||||
<span class="baby-age-chip">{{ store.baby?.ageText || '出生第 3 天' }}</span>
|
||||
<span v-if="store.baby?.deliveryType === 'natural'" class="baby-sub-chip">顺产</span>
|
||||
<span v-else-if="store.baby?.deliveryType === 'c_section'" class="baby-sub-chip">剖腹产</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<p v-if="store.error" class="notice error">{{ store.error }}</p>
|
||||
<p v-if="store.loading" class="notice">正在加载今日记录...</p>
|
||||
|
||||
<section class="summary-grid">
|
||||
<article class="metric-card">
|
||||
<span>喂奶</span>
|
||||
<strong>{{ store.summary?.feedingCount ?? 0 }}</strong>
|
||||
<small>今日次数</small>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>睡眠</span>
|
||||
<strong>{{ formatMinutes(store.summary?.sleepTotalMinutes ?? 0) }}</strong>
|
||||
<small>累计时长</small>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>小便</span>
|
||||
<strong>{{ store.summary?.peeCount ?? 0 }}</strong>
|
||||
<small>今日次数</small>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<span>大便</span>
|
||||
<strong>{{ store.summary?.poopCount ?? 0 }}</strong>
|
||||
<small>今日次数</small>
|
||||
</article>
|
||||
<section class="summary-grid" aria-label="今日摘要">
|
||||
<strong class="summary-primary-line">喂奶 {{ store.summary?.feedingCount ?? 0 }} 次 · 奶量 {{ todayMilkAmount }}ml</strong>
|
||||
<span class="summary-secondary-line">睡眠 {{ formatMinutes(store.summary?.sleepTotalMinutes ?? 0) }} · 小便 {{ store.summary?.peeCount ?? 0 }} · 大便 {{ store.summary?.poopCount ?? 0 }}</span>
|
||||
</section>
|
||||
|
||||
<!-- 统一喂养聚合面板 -->
|
||||
@@ -347,10 +373,6 @@ async function handleOneClickBreastfeeding() {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bf-quick-hint">
|
||||
一键补记会按当前优先侧分配:左侧 {{ breastSide === 'left' ? Math.ceil(oneClickDuration / 2) : Math.floor(oneClickDuration / 2) }}分 · 右侧 {{ breastSide === 'right' ? Math.ceil(oneClickDuration / 2) : Math.floor(oneClickDuration / 2) }}分
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区 -->
|
||||
@@ -374,7 +396,7 @@ async function handleOneClickBreastfeeding() {
|
||||
:disabled="operating"
|
||||
@click="handleOneClickBreastfeeding"
|
||||
>
|
||||
补记 {{ oneClickDuration }}分钟
|
||||
速记 {{ oneClickDuration }}分钟
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
@@ -517,34 +539,125 @@ async function handleOneClickBreastfeeding() {
|
||||
<div class="panel-title">
|
||||
<h2>快速记录</h2>
|
||||
</div>
|
||||
<div class="action-grid compact-actions">
|
||||
<button
|
||||
class="primary-action sleep"
|
||||
:disabled="operating"
|
||||
@click="runWithTip(() => store.toggleSleep(), store.summary?.activeSleep ? '已结束睡眠记录' : '已开始睡眠记录')"
|
||||
>
|
||||
<strong>{{ store.summary?.activeSleep ? '结束睡眠' : '开始睡眠' }}</strong>
|
||||
<span>{{ store.summary?.activeSleep ? '自动计算时长' : '宝宝睡下了' }}</span>
|
||||
</button>
|
||||
<button
|
||||
class="primary-action pee"
|
||||
:disabled="operating"
|
||||
@click="runWithTip(() => store.logPee(), '已记录一次小便')"
|
||||
>
|
||||
<strong>小便</strong>
|
||||
<span>记录一次</span>
|
||||
</button>
|
||||
<button
|
||||
class="primary-action poop"
|
||||
:disabled="operating"
|
||||
@click="runWithTip(() => store.logPoop(), '已记录一次大便')"
|
||||
>
|
||||
<strong>大便</strong>
|
||||
<span>记录一次</span>
|
||||
</button>
|
||||
<div class="quick-record-actions">
|
||||
<div v-if="store.summary?.activeSleep" class="sleep-active-row">
|
||||
<div class="sleep-active-main">
|
||||
<strong>睡眠中 · {{ formatTime(store.summary.activeSleep.startTime) }} 入睡</strong>
|
||||
<button
|
||||
type="button"
|
||||
:disabled="operating"
|
||||
@click="runWithTip(() => store.toggleSleep(), '已结束睡眠记录')"
|
||||
>
|
||||
结束睡眠
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="sleep-adjust-link"
|
||||
type="button"
|
||||
:disabled="operating"
|
||||
@click="openSleepAssist"
|
||||
>
|
||||
调整入睡时间
|
||||
</button>
|
||||
</div>
|
||||
<template v-else>
|
||||
<button
|
||||
class="primary-action sleep quick-sleep-action"
|
||||
:disabled="operating"
|
||||
@click="runWithTip(() => store.toggleSleep(), '已开始睡眠记录')"
|
||||
>
|
||||
<strong>开始睡眠</strong>
|
||||
<span>宝宝睡下了</span>
|
||||
</button>
|
||||
<button
|
||||
class="quick-sleep-secondary"
|
||||
type="button"
|
||||
:disabled="operating"
|
||||
@click="openSleepAssist"
|
||||
>
|
||||
速记睡眠
|
||||
</button>
|
||||
</template>
|
||||
<div class="quick-excretion-row">
|
||||
<button
|
||||
class="primary-action pee"
|
||||
:disabled="operating"
|
||||
@click="runWithTip(() => store.logPee(), '已记录一次小便')"
|
||||
>
|
||||
<strong>小便</strong>
|
||||
<span>记录一次</span>
|
||||
</button>
|
||||
<button
|
||||
class="primary-action poop"
|
||||
:disabled="operating"
|
||||
@click="runWithTip(() => store.logPoop(), '已记录一次大便')"
|
||||
>
|
||||
<strong>大便</strong>
|
||||
<span>记录一次</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<van-popup
|
||||
v-model:show="showSleepSheet"
|
||||
position="bottom"
|
||||
round
|
||||
safe-area-inset-bottom
|
||||
teleport="body"
|
||||
>
|
||||
<div class="sleep-action-sheet">
|
||||
<div class="sleep-action-sheet-head">
|
||||
<h3>{{ store.summary?.activeSleep ? '调整入睡时间' : '速记睡眠' }}</h3>
|
||||
<button type="button" class="sheet-close-btn" @click="showSleepSheet = false">完成</button>
|
||||
</div>
|
||||
|
||||
<template v-if="store.summary?.activeSleep">
|
||||
<div class="sleep-time-fields">
|
||||
<label>
|
||||
<span>入睡日期</span>
|
||||
<input v-model="sleepStartDate" type="date" />
|
||||
</label>
|
||||
<label>
|
||||
<span>入睡时间</span>
|
||||
<input v-model="sleepStartTimeStr" type="time" />
|
||||
</label>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="primary-pill-button sleep-sheet-submit"
|
||||
:disabled="operating"
|
||||
@click="handleAdjustSleepStart"
|
||||
>
|
||||
保存调整
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div class="sleep-duration-grid" aria-label="选择睡眠时长">
|
||||
<button
|
||||
v-for="duration in [30, 60, 90, 120]"
|
||||
:key="duration"
|
||||
type="button"
|
||||
class="bf-duration-chip"
|
||||
:class="{ active: sleepQuickDuration === duration }"
|
||||
@click="sleepQuickDuration = duration"
|
||||
>
|
||||
{{ duration }}分
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="primary-pill-button sleep-sheet-submit"
|
||||
:disabled="operating"
|
||||
@click="handleQuickSleepLog"
|
||||
>
|
||||
速记 {{ sleepQuickDuration }}分钟
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-title">
|
||||
<h2>最近状态</h2>
|
||||
|
||||
+321
-70
@@ -79,21 +79,13 @@ button {
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
/* 顶部一体化温润状态卡片 */
|
||||
/* 今日页轻量上下文 */
|
||||
.today-top-card {
|
||||
background: linear-gradient(135deg, #fffbf0 0%, #fff6df 100%);
|
||||
border: 1px solid #f6e6c4;
|
||||
border-radius: 16px;
|
||||
padding: 14px 16px;
|
||||
box-shadow: 0 4px 14px rgba(184, 134, 11, 0.06);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
gap: 10px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.family-badge {
|
||||
@@ -113,12 +105,13 @@ button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
background: #ffffff;
|
||||
flex: 0 0 auto;
|
||||
min-height: 34px;
|
||||
background: #fffaf0;
|
||||
border: 1px solid #ebd8b2;
|
||||
border-radius: 999px;
|
||||
padding: 4px 10px 4px 7px;
|
||||
padding: 5px 10px 5px 7px;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
@@ -145,19 +138,20 @@ button {
|
||||
}
|
||||
|
||||
.baby-main-row {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 12px;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
border: 1px solid rgba(246, 230, 196, 0.6);
|
||||
justify-content: flex-start;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.baby-main-row:active {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
@@ -205,15 +199,19 @@ button {
|
||||
.baby-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 7px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.baby-name {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-size: 17px;
|
||||
font-weight: 800;
|
||||
color: #2c2518;
|
||||
line-height: 1.2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.baby-switch-tag {
|
||||
@@ -234,6 +232,7 @@ button {
|
||||
}
|
||||
|
||||
.baby-age-chip {
|
||||
flex: 0 0 auto;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #b45309;
|
||||
@@ -436,9 +435,29 @@ button {
|
||||
|
||||
.summary-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
margin: 16px 0;
|
||||
gap: 3px;
|
||||
margin: 6px 0 12px;
|
||||
padding: 9px 12px;
|
||||
border-radius: 12px;
|
||||
background: #fffdf8;
|
||||
border: 1px solid #f2dfba;
|
||||
box-shadow: inset 3px 0 0 #f0b74f;
|
||||
}
|
||||
|
||||
.summary-primary-line {
|
||||
color: #17202a;
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
line-height: 1.35;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.summary-secondary-line {
|
||||
color: #667085;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
line-height: 1.35;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.metric-card,
|
||||
@@ -520,6 +539,170 @@ button {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.quick-record-actions {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.quick-record-actions .primary-action {
|
||||
min-height: 76px;
|
||||
padding: 13px 16px;
|
||||
}
|
||||
|
||||
.quick-sleep-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.quick-sleep-action strong,
|
||||
.quick-sleep-action span {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.quick-sleep-secondary {
|
||||
min-height: 42px;
|
||||
border-radius: 999px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #d7e5f5;
|
||||
color: #2364b5;
|
||||
font-size: 14px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.quick-sleep-secondary:disabled {
|
||||
opacity: 0.55;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.sleep-active-row {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
background: #ede7ff;
|
||||
}
|
||||
|
||||
.sleep-active-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.sleep-active-main strong {
|
||||
min-width: 0;
|
||||
color: #17202a;
|
||||
font-size: 16px;
|
||||
line-height: 1.25;
|
||||
font-weight: 900;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sleep-active-main button {
|
||||
flex: 0 0 auto;
|
||||
min-height: 34px;
|
||||
padding: 6px 13px;
|
||||
border-radius: 999px;
|
||||
background: #ffffff;
|
||||
color: #4c1d95;
|
||||
border: 1px solid rgba(124, 58, 237, 0.18);
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.sleep-active-main button:disabled,
|
||||
.sleep-adjust-link:disabled {
|
||||
opacity: 0.55;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.sleep-adjust-link {
|
||||
justify-self: start;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: #2364b5;
|
||||
font-size: 13px;
|
||||
line-height: 1.3;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.quick-excretion-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.quick-excretion-row .primary-action {
|
||||
min-height: 82px;
|
||||
}
|
||||
|
||||
.sleep-action-sheet {
|
||||
padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
|
||||
background: #fffdfa;
|
||||
}
|
||||
|
||||
.sleep-action-sheet-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.sleep-action-sheet-head h3 {
|
||||
margin: 0;
|
||||
color: #17202a;
|
||||
font-size: 18px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.sleep-duration-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.sleep-time-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.sleep-time-fields label {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.sleep-time-fields span {
|
||||
color: #4b5563;
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.sleep-time-fields input {
|
||||
width: 100%;
|
||||
min-height: 42px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #e2dbcd;
|
||||
border-radius: 10px;
|
||||
background: #ffffff;
|
||||
padding: 8px 10px;
|
||||
color: #17202a;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.sleep-sheet-submit {
|
||||
width: 100%;
|
||||
min-height: 42px;
|
||||
justify-content: center;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.feeding {
|
||||
background: #fff1cf;
|
||||
}
|
||||
@@ -1131,17 +1314,6 @@ button {
|
||||
box-shadow: 0 8px 16px rgba(164, 98, 8, 0.18);
|
||||
}
|
||||
|
||||
.bf-quick-hint {
|
||||
margin-top: 10px;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
padding: 9px 10px;
|
||||
box-shadow: inset 0 0 0 1px #e8eef6;
|
||||
}
|
||||
|
||||
.bf-live-actions {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
@@ -2224,10 +2396,10 @@ button {
|
||||
|
||||
/* 照护记录工具栏与按日分组样式 */
|
||||
.timeline-toolbar {
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 14px;
|
||||
background: #ffffff;
|
||||
border-radius: 14px;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ede8de;
|
||||
}
|
||||
|
||||
@@ -2239,35 +2411,16 @@ button {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.timeline-toolbar-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.date-filter-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fdfbf7;
|
||||
border: 1px solid #e2dbcd;
|
||||
border-radius: 8px;
|
||||
padding: 3px 8px;
|
||||
border-radius: 9px;
|
||||
padding: 2px 8px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.timeline-count-summary {
|
||||
flex: 0 0 auto;
|
||||
color: #65707d;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.timeline-count-summary strong {
|
||||
color: #8a540d;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.behavior-filter-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -2279,14 +2432,21 @@ button {
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.behavior-filter-row.sheet {
|
||||
margin-top: 16px;
|
||||
padding-bottom: 0;
|
||||
flex-wrap: wrap;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.behavior-filter-row::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.behavior-filter-chip {
|
||||
flex: 0 0 auto;
|
||||
min-height: 30px;
|
||||
padding: 6px 11px;
|
||||
min-height: 34px;
|
||||
padding: 7px 13px;
|
||||
border-radius: 999px;
|
||||
background: #f4efe6;
|
||||
color: #5d6470;
|
||||
@@ -2335,15 +2495,13 @@ button {
|
||||
|
||||
.toolbar-actions {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
gap: 7px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.toolbar-actions .primary-pill-button,
|
||||
.toolbar-actions .secondary-pill-button,
|
||||
.toolbar-actions .sort-toggle-btn,
|
||||
.toolbar-actions .manage-toggle-btn {
|
||||
min-height: 34px;
|
||||
.toolbar-actions .secondary-pill-button {
|
||||
min-height: 38px;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -2356,13 +2514,34 @@ button {
|
||||
|
||||
.record-action-row.primary {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
|
||||
grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
|
||||
}
|
||||
|
||||
.record-action-row.subtle {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.toolbar-text-btn {
|
||||
min-height: 30px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 999px;
|
||||
background: #f8fafc;
|
||||
color: #596575;
|
||||
border: 1px solid #d7e0ea;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.toolbar-text-btn.active {
|
||||
background: #fff7df;
|
||||
color: #8a540d;
|
||||
border-color: #ead09d;
|
||||
}
|
||||
|
||||
.sort-toggle-btn {
|
||||
background: #f8fafc;
|
||||
color: #475569;
|
||||
@@ -2410,7 +2589,7 @@ button {
|
||||
}
|
||||
|
||||
.timeline-meta-bar {
|
||||
margin-top: 8px;
|
||||
margin-top: 7px;
|
||||
font-size: 12px;
|
||||
color: #65707d;
|
||||
display: flex;
|
||||
@@ -2428,6 +2607,78 @@ button {
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.timeline-filter-sheet {
|
||||
padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
|
||||
background: #fffdfa;
|
||||
}
|
||||
|
||||
.timeline-filter-sheet-head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.timeline-filter-sheet-head h3 {
|
||||
margin: 0;
|
||||
color: #17202a;
|
||||
font-size: 18px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.timeline-filter-sheet-head p {
|
||||
margin: 4px 0 0;
|
||||
color: #72808f;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.timeline-filter-date-field {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.timeline-filter-date-field span {
|
||||
color: #4b5563;
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.timeline-filter-date-field .filter-date-input {
|
||||
width: 100%;
|
||||
min-height: 42px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #e2dbcd;
|
||||
border-radius: 10px;
|
||||
background: #ffffff;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
.sheet-close-btn {
|
||||
flex: 0 0 auto;
|
||||
min-height: 32px;
|
||||
padding: 5px 13px;
|
||||
border-radius: 999px;
|
||||
background: #f4efe6;
|
||||
color: #6f4b16;
|
||||
font-size: 12px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.timeline-filter-sheet-actions {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
gap: 10px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.timeline-filter-sheet-actions .primary-pill-button,
|
||||
.timeline-filter-sheet-actions .secondary-pill-button {
|
||||
min-height: 40px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.timeline-groups {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in new issue
Block a user