init: 孕妈日程管理 H5

This commit is contained in:
xiexiaobao 2026-07-28 22:06:50 +08:00
commit 5dd0bc2664
21 changed files with 2309 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

3
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Vue 3 + Vite
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).

13
index.html Normal file
View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>mom-daily</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

1208
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "mom-daily",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"dayjs": "^1.11.21",
"pinia": "^4.0.2",
"vue": "^3.5.39",
"vue-router": "^4.6.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^6.0.7",
"vite": "^8.1.1"
}
}

1
public/favicon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.3 KiB

24
public/icons.svg Normal file
View File

@ -0,0 +1,24 @@
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="bluesky-icon" viewBox="0 0 16 17">
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
</symbol>
<symbol id="discord-icon" viewBox="0 0 20 19">
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
</symbol>
<symbol id="documentation-icon" viewBox="0 0 21 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
</symbol>
<symbol id="github-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
</symbol>
<symbol id="social-icon" viewBox="0 0 20 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
</symbol>
<symbol id="x-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

106
src/App.vue Normal file
View File

@ -0,0 +1,106 @@
<template>
<div class="app-container">
<div class="header">
<div class="header-left" @click="$router.push('/profile')">
<span class="avatar">{{ store.name?.[0] || '👤' }}</span>
</div>
<div class="header-title">🌿 孕妈日常</div>
<div class="header-right"></div>
</div>
<div class="main-content">
<router-view />
</div>
<div class="bottom-nav">
<div v-for="tab in tabs" :key="tab.path"
:class="['nav-item', { active: $route.path === tab.path }]"
@click="$router.push(tab.path)">
<span class="nav-icon">{{ tab.icon }}</span>
<span class="nav-label">{{ tab.label }}</span>
</div>
</div>
</div>
</template>
<script setup>
import { usePregnancyStore } from './stores'
const store = usePregnancyStore()
const tabs = [
{ path: '/', icon: '🏠', label: '首页' },
{ path: '/calendar', icon: '📅', label: '产检' },
{ path: '/tracker', icon: '📊', label: '记录' },
{ path: '/reminder', icon: '⏰', label: '提醒' },
{ path: '/profile', icon: '👤', label: '我的' },
]
</script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #f8f9fa;
color: #333;
-webkit-font-smoothing: antialiased;
}
.app-container {
max-width: 480px;
margin: 0 auto;
min-height: 100vh;
background: #fff;
display: flex;
flex-direction: column;
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
color: white;
position: sticky;
top: 0;
z-index: 100;
}
.header-title { font-size: 18px; font-weight: 600; }
.avatar { font-size: 24px; cursor: pointer; }
.main-content {
flex: 1;
padding: 16px;
padding-bottom: 80px;
overflow-y: auto;
}
.bottom-nav {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
max-width: 480px;
width: 100%;
display: flex;
background: white;
border-top: 1px solid #eee;
padding: 8px 0;
padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.nav-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
cursor: pointer;
color: #999;
transition: color 0.2s;
}
.nav-item.active { color: #f5576c; }
.nav-icon { font-size: 22px; }
.nav-label { font-size: 11px; }
</style>

BIN
src/assets/hero.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

1
src/assets/vite.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.5 KiB

10
src/main.js Normal file
View File

@ -0,0 +1,10 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router'
import App from './App.vue'
import './style.css'
const app = createApp(App)
app.use(createPinia())
app.use(router)
app.mount('#app')

14
src/router/index.js Normal file
View File

@ -0,0 +1,14 @@
import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
{ path: '/', name: 'home', component: () => import('../views/Home.vue') },
{ path: '/calendar', name: 'calendar', component: () => import('../views/Calendar.vue') },
{ path: '/tracker', name: 'tracker', component: () => import('../views/Tracker.vue') },
{ path: '/reminder', name: 'reminder', component: () => import('../views/Reminder.vue') },
{ path: '/profile', name: 'profile', component: () => import('../views/Profile.vue') },
]
export default createRouter({
history: createWebHashHistory(),
routes,
})

69
src/stores/index.js Normal file
View File

@ -0,0 +1,69 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
import dayjs from 'dayjs'
export const usePregnancyStore = defineStore('pregnancy', () => {
const dueDate = ref(localStorage.getItem('mom_due_date') || '')
const name = ref(localStorage.getItem('mom_name') || '')
// 孕周计算
const weeksInfo = computed(() => {
if (!dueDate.value) return null
const due = dayjs(dueDate.value)
const now = dayjs()
const totalDays = 280 // 40周
const pastDays = due.diff(now, 'day') * -1 + 280
const week = Math.floor(pastDays / 7)
const day = pastDays % 7
return { week, day, remaining: 40 - week, dueDate: dueDate.value }
})
const currentWeek = computed(() => weeksInfo.value?.week || 0)
// 产检计划
const checkupPlan = computed(() => {
const w = currentWeek.value
const plan = [
{ week: '6-8', items: '确认妊娠、B超检查', urgent: true },
{ week: '11-13', items: 'NT检查、建档', urgent: true },
{ week: '16-20', items: '唐氏筛查/无创DNA', urgent: true },
{ week: '20-24', items: '大排畸、糖耐量', urgent: true },
{ week: '24-28', items: '糖耐量筛查(OGTT)', urgent: true },
{ week: '28-32', items: '小排畸B超', urgent: false },
{ week: '32-34', items: '胎心监护', urgent: false },
{ week: '34-36', items: 'B族链球菌筛查', urgent: false },
{ week: '36-40', items: '每周胎心监护', urgent: true },
]
return plan.map(p => {
const [start] = p.week.split('-').map(Number)
return { ...p, active: w >= start && w <= (p.week.includes('-') ? Number(p.week.split('-')[1]) : start) }
})
})
function setDueDate(date) {
dueDate.value = date
localStorage.setItem('mom_due_date', date)
}
function setName(n) {
name.value = n
localStorage.setItem('mom_name', n)
}
return { dueDate, name, weeksInfo, currentWeek, checkupPlan, setDueDate, setName }
})
export const useRecordsStore = defineStore('records', () => {
const records = ref(JSON.parse(localStorage.getItem('mom_records') || '[]'))
function addRecord(type, data) {
records.value.unshift({ id: Date.now(), type, date: dayjs().format('YYYY-MM-DD HH:mm'), ...data })
localStorage.setItem('mom_records', JSON.stringify(records.value))
}
function getByType(type) {
return records.value.filter(r => r.type === type)
}
return { records, addRecord, getByType }
})

34
src/style.css Normal file
View File

@ -0,0 +1,34 @@
/* 全局样式 - 孕妈日常 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--pink: #f5576c;
--purple: #764ba2;
--gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--bg: #f8f9fa;
--card-bg: #ffffff;
--text: #333333;
--text-secondary: #666666;
--text-hint: #999999;
--border: #e0e0e0;
--radius: 12px;
}
html, body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background: var(--bg);
color: var(--text);
line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
/* 滚动条美化 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

99
src/views/Calendar.vue Normal file
View File

@ -0,0 +1,99 @@
<template>
<div class="calendar-page">
<div class="section-title">📅 产检计划</div>
<div class="checkup-timeline">
<div v-for="p in store.checkupPlan" :key="p.week"
:class="['timeline-item', { done: isDone(p.week), current: p.active }]">
<div class="tl-dot"></div>
<div class="tl-line"></div>
<div class="tl-content">
<div class="tl-week">第 {{ p.week }} 周</div>
<div class="tl-items">{{ p.items }}</div>
<div class="tl-tags">
<span v-if="p.urgent" class="tag tag-urgent">重要</span>
<span v-if="p.active" class="tag tag-current">当前</span>
<span v-if="isDone(p.week)" class="tag tag-done">已完成</span>
</div>
</div>
</div>
</div>
<div class="section-title">📝 产检记录</div>
<div class="add-record">
<input v-model="newRecord.week" type="text" placeholder="孕周(如 12周)" class="input" />
<input v-model="newRecord.content" type="text" placeholder="检查结果" class="input" />
<button class="btn" @click="addCheckup">保存记录</button>
</div>
<div class="record-list">
<div v-for="r in checkups" :key="r.id" class="record-item">
<div class="record-week">{{ r.week }}</div>
<div class="record-content">{{ r.content }}</div>
<div class="record-date">{{ r.date }}</div>
</div>
<div v-if="!checkups.length" class="empty">暂无记录</div>
</div>
</div>
</template>
<script setup>
import { ref, computed } from 'vue'
import { usePregnancyStore } from '../stores'
import dayjs from 'dayjs'
const store = usePregnancyStore()
const newRecord = ref({ week: '', content: '' })
const checkups = ref(JSON.parse(localStorage.getItem('mom_checkups') || '[]'))
function isDone(week) {
return checkups.value.some(c => c.week === `第${week}周`)
}
function addCheckup() {
if (!newRecord.value.week || !newRecord.value.content) return
checkups.value.push({
id: Date.now(),
week: `第${newRecord.value.week}周`,
content: newRecord.value.content,
date: dayjs().format('YYYY-MM-DD'),
})
localStorage.setItem('mom_checkups', JSON.stringify(checkups.value))
newRecord.value = { week: '', content: '' }
}
</script>
<style scoped>
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; margin-top: 8px; }
/* 时间线 */
.checkup-timeline { margin-bottom: 32px; }
.timeline-item { display: flex; align-items: flex-start; gap: 12px; position: relative; padding-bottom: 8px; }
.tl-dot {
width: 12px; height: 12px; border-radius: 50%; background: #ddd;
margin-top: 4px; flex-shrink: 0; z-index: 1;
}
.timeline-item.done .tl-dot { background: #4caf50; }
.timeline-item.current .tl-dot { background: #f5576c; box-shadow: 0 0 0 4px rgba(245,87,108,0.2); }
.tl-line {
position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: #eee;
}
.timeline-item:last-child .tl-line { display: none; }
.tl-content { flex: 1; padding: 4px 0 12px; }
.tl-week { font-size: 13px; color: #666; font-weight: 600; margin-bottom: 2px; }
.tl-items { font-size: 14px; margin-bottom: 4px; }
.tl-tags { display: flex; gap: 6px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 8px; }
.tag-urgent { background: #fce4ec; color: #c62828; }
.tag-current { background: #fff3e0; color: #e65100; }
.tag-done { background: #e8f5e9; color: #2e7d32; }
/* 记录 */
.add-record { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; min-width: 100px; }
.btn { padding: 10px 20px; background: #f5576c; color: white; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.record-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: #f8f9fa; border-radius: 8px; margin-bottom: 8px; }
.record-week { font-size: 13px; font-weight: 600; color: #666; min-width: 60px; }
.record-content { flex: 1; font-size: 14px; }
.record-date { font-size: 12px; color: #999; }
.empty { text-align: center; color: #ccc; padding: 20px; }
</style>

161
src/views/Home.vue Normal file
View File

@ -0,0 +1,161 @@
<template>
<div class="home-page">
<!-- 孕周卡片 -->
<div class="week-card" v-if="store.weeksInfo">
<div class="week-big">{{ store.weeksInfo.week }}<span class="week-unit">周</span></div>
<div class="week-day">第 {{ store.weeksInfo.week }} 周 {{ store.weeksInfo.day }} 天</div>
<div class="week-bar">
<div class="week-fill" :style="{ width: (store.currentWeek/40*100) + '%' }"></div>
</div>
<div class="week-info">预产期:{{ store.weeksInfo.dueDate }} 还剩 {{ store.weeksInfo.remaining }} 周</div>
</div>
<div class="welcome" v-else>
<div class="welcome-icon">🤰</div>
<div class="welcome-title">欢迎来到孕妈日常</div>
<div class="welcome-desc">设置预产期,开始记录孕期生活</div>
</div>
<!-- 快捷入口 -->
<div class="quick-grid">
<div class="quick-item" v-for="item in quickItems" :key="item.label" @click="handleQuick(item.action)">
<span class="qi-icon">{{ item.icon }}</span>
<span class="qi-label">{{ item.label }}</span>
</div>
</div>
<!-- 今日产检提醒 -->
<div class="section-title">📋 本周产检提醒</div>
<div class="checkup-list">
<div v-for="p in store.checkupPlan" :key="p.week"
:class="['checkup-item', { active: p.active }]">
<div class="checkup-week">第{{ p.week }}周</div>
<div class="checkup-info">
<div class="checkup-name">{{ p.items }}</div>
<div v-if="p.active" class="checkup-tag">当前</div>
</div>
</div>
</div>
<!-- 孕期知识 -->
<div class="section-title">💡 小贴士</div>
<div class="tip-card">
<div class="tip-title">{{ currentTip.title }}</div>
<div class="tip-body">{{ currentTip.body }}</div>
</div>
</div>
</template>
<script setup>
import { computed } from 'vue'
import { usePregnancyStore } from '../stores'
import { useRouter } from 'vue-router'
const store = usePregnancyStore()
const router = useRouter()
const quickItems = [
{ icon: '🏋️', label: '体重记录', action: 'weight' },
{ icon: '👶', label: '胎动计数', action: 'kick' },
{ icon: '⏱️', label: '宫缩计时', action: 'contraction' },
{ icon: '💊', label: '补剂提醒', action: 'medicine' },
{ icon: '📝', label: '症状记录', action: 'symptom' },
{ icon: '📊', label: '查看数据', action: 'chart' },
]
function handleQuick(action) {
router.push({ path: '/tracker', query: { tab: action } })
}
const tips = [
{ title: '孕期营养', body: '孕中期每天需要增加300千卡热量,多补充蛋白质、钙、铁。建议每天1个鸡蛋、250ml牛奶、适量红肉。' },
{ title: '胎动监测', body: '28周后开始数胎动,每天固定时间数1小时。正常每小时3-5次,12小时不少于30次。' },
{ title: '孕期运动', body: '每天散步30分钟有助于顺产,也可以做孕妇瑜伽。避免剧烈运动和高风险活动。' },
{ title: '情绪管理', body: '孕期情绪波动正常,多和家人沟通。听轻音乐、深呼吸,保持心情愉快。' },
{ title: '睡眠建议', body: '左侧卧最佳,用孕妇枕支撑腹部和腰部。午睡30-60分钟,避免仰卧。' },
]
const currentTip = computed(() => tips[store.currentWeek % tips.length])
</script>
<style scoped>
.week-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 16px;
padding: 24px;
color: white;
text-align: center;
margin-bottom: 20px;
}
.week-big { font-size: 60px; font-weight: 700; line-height: 1; }
.week-unit { font-size: 24px; font-weight: 400; }
.week-day { font-size: 16px; margin: 8px 0; opacity: 0.9; }
.week-bar { height: 6px; background: rgba(255,255,255,0.3); border-radius: 3px; margin: 12px 0; overflow: hidden; }
.week-fill { height: 100%; background: rgba(255,255,255,0.8); border-radius: 3px; transition: width 0.5s; }
.week-info { font-size: 13px; opacity: 0.8; }
.welcome { text-align: center; padding: 40px 0; }
.welcome-icon { font-size: 64px; margin-bottom: 16px; }
.welcome-title { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.welcome-desc { color: #999; font-size: 14px; }
.quick-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
margin-bottom: 24px;
}
.quick-item {
background: #f8f9fa;
border-radius: 12px;
padding: 16px 8px;
text-align: center;
cursor: pointer;
transition: transform 0.15s;
}
.quick-item:active { transform: scale(0.95); }
.qi-icon { font-size: 28px; display: block; margin-bottom: 4px; }
.qi-label { font-size: 13px; color: #666; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; margin-top: 8px; }
.checkup-list { margin-bottom: 24px; }
.checkup-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
background: #f8f9fa;
border-radius: 10px;
margin-bottom: 8px;
transition: all 0.2s;
}
.checkup-item.active {
background: #fff3e0;
border: 1px solid #ffcc80;
}
.checkup-week {
min-width: 60px;
font-size: 13px;
color: #666;
font-weight: 600;
}
.checkup-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.checkup-name { font-size: 14px; }
.checkup-tag {
background: #f5576c;
color: white;
font-size: 11px;
padding: 2px 8px;
border-radius: 10px;
}
.tip-card {
background: #e3f2fd;
border-radius: 12px;
padding: 16px;
margin-bottom: 24px;
}
.tip-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: #1565c0; }
.tip-body { font-size: 13px; line-height: 1.6; color: #555; }
</style>

126
src/views/Profile.vue Normal file
View File

@ -0,0 +1,126 @@
<template>
<div class="profile-page">
<div class="profile-header">
<div class="profile-avatar">🤰</div>
<div class="profile-name">{{ store.name || '准妈妈' }}</div>
</div>
<div class="profile-section">
<div class="section-title">👤 个人信息</div>
<div class="field">
<label>昵称</label>
<input v-model="localName" class="input" placeholder="输入昵称" />
</div>
<div class="field">
<label>预产期</label>
<input v-model="localDue" type="date" class="input" />
</div>
<button class="btn" @click="saveProfile">保存</button>
</div>
<div class="profile-section">
<div class="section-title">📊 孕期数据</div>
<div v-if="store.weeksInfo" class="stats-grid">
<div class="stat-item">
<div class="stat-val">{{ store.weeksInfo.week }}周</div>
<div class="stat-label">当前孕周</div>
</div>
<div class="stat-item">
<div class="stat-val">{{ store.weeksInfo.remaining }}周</div>
<div class="stat-label">剩余</div>
</div>
<div class="stat-item">
<div class="stat-val">{{ weightCount }}</div>
<div class="stat-label">体重记录</div>
</div>
<div class="stat-item">
<div class="stat-val">{{ kickCount }}</div>
<div class="stat-label">胎动记录</div>
</div>
</div>
</div>
<div class="profile-section">
<div class="section-title">⚙️ 设置</div>
<div class="setting-item" @click="exportData">
<span>📤 导出数据</span>
<span class="arrow">›</span>
</div>
<div class="setting-item" @click="clearData">
<span>🗑️ 清空所有数据</span>
<span class="arrow red">›</span>
</div>
</div>
<div class="footer">🌿 孕妈日常 v1.0</div>
</div>
</template>
<script setup>
import { ref, computed } from 'vue'
import { usePregnancyStore } from '../stores'
const store = usePregnancyStore()
const localName = ref(store.name)
const localDue = ref(store.dueDate)
const weightCount = computed(() => JSON.parse(localStorage.getItem('mom_weights') || '[]').length)
const kickCount = computed(() => JSON.parse(localStorage.getItem('mom_kick_logs') || '[]').length)
function saveProfile() {
store.setName(localName.value)
store.setDueDate(localDue.value)
alert('已保存 ✅')
}
function exportData() {
const data = {
profile: { name: store.name, dueDate: store.dueDate },
weights: JSON.parse(localStorage.getItem('mom_weights') || '[]'),
kicks: JSON.parse(localStorage.getItem('mom_kick_logs') || '[]'),
contractions: JSON.parse(localStorage.getItem('mom_contractions') || '[]'),
symptoms: JSON.parse(localStorage.getItem('mom_symptoms') || '[]'),
checkups: JSON.parse(localStorage.getItem('mom_checkups') || '[]'),
todos: JSON.parse(localStorage.getItem('mom_todos') || '[]'),
}
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url; a.download = `孕妈数据_${new Date().toISOString().slice(0,10)}.json`
a.click()
}
function clearData() {
if (confirm('确定要清空所有数据吗?此操作不可恢复!')) {
const keys = ['mom_weights','mom_kicks','mom_kick_logs','mom_contractions','mom_symptoms','mom_checkups','mom_todos','mom_meds']
keys.forEach(k => localStorage.removeItem(k))
localStorage.removeItem('mom_due_date')
localStorage.removeItem('mom_name')
alert('已清空')
location.reload()
}
}
</script>
<style scoped>
.profile-header { text-align: center; padding: 24px 0; }
.profile-avatar { font-size: 64px; margin-bottom: 8px; }
.profile-name { font-size: 20px; font-weight: 600; }
.profile-section { margin-bottom: 24px; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.btn { width: 100%; padding: 12px; background: #f5576c; color: white; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-item { background: #f8f9fa; border-radius: 12px; padding: 16px; text-align: center; }
.stat-val { font-size: 24px; font-weight: 700; color: #f5576c; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 14px; }
.arrow { font-size: 20px; color: #ccc; }
.arrow.red { color: #f5576c; }
.footer { text-align: center; color: #ccc; font-size: 12px; padding: 32px 0; }
</style>

100
src/views/Reminder.vue Normal file
View File

@ -0,0 +1,100 @@
<template>
<div class="reminder-page">
<div class="section-title">⏰ 今日待办</div>
<div v-for="r in todayTodos" :key="r.id" :class="['todo-item', { done: r.done }]">
<div class="todo-check" @click="toggleTodo(r.id)">
<span class="checkbox">{{ r.done ? '✅' : '⬜' }}</span>
</div>
<div class="todo-content">
<div class="todo-name">{{ r.name }}</div>
<div class="todo-time">{{ r.time }}</div>
</div>
<div class="todo-days">{{ r.days }}天</div>
</div>
<div v-if="!todayTodos.length" class="empty">暂无待办</div>
<div class="section-title">➕ 添加提醒</div>
<div class="add-form">
<input v-model="newTodo.name" placeholder="提醒内容" class="input" />
<select v-model="newTodo.freq" class="input">
<option value="daily">每天</option>
<option value="weekly">每周</option>
<option value="custom">自定义</option>
</select>
<button class="btn" @click="addTodo">添加</button>
</div>
<div class="section-title">📋 所有提醒</div>
<div v-for="t in todos" :key="t.id" :class="['todo-item', { done: t.done }]">
<div class="todo-check" @click="toggleTodo(t.id)">
<span class="checkbox">{{ t.done ? '✅' : '⬜' }}</span>
</div>
<div class="todo-content">
<div class="todo-name">{{ t.name }}</div>
<div class="todo-time">{{ t.freq === 'daily' ? '每天' : '每周' }}</div>
</div>
<div class="todo-del" @click="delTodo(t.id)">🗑️</div>
</div>
</div>
</template>
<script setup>
import { ref, computed } from 'vue'
import dayjs from 'dayjs'
const todos = ref(JSON.parse(localStorage.getItem('mom_todos') || '[]'))
const newTodo = ref({ name: '', freq: 'daily' })
const todayTodos = computed(() => todos.value.filter(t => {
if (t.done && t.date !== dayjs().format('YYYY-MM-DD')) return true
if (!t.done) return true
return false
}))
function addTodo() {
if (!newTodo.value.name) return
todos.value.push({
id: Date.now(),
name: newTodo.value.name,
freq: newTodo.value.freq,
done: false,
date: '',
days: 1,
})
localStorage.setItem('mom_todos', JSON.stringify(todos.value))
newTodo.value = { name: '', freq: 'daily' }
}
function toggleTodo(id) {
const t = todos.value.find(x => x.id === id)
if (!t) return
t.done = !t.done
t.date = dayjs().format('YYYY-MM-DD')
t.days = (t.days || 1) + 1
localStorage.setItem('mom_todos', JSON.stringify(todos.value))
}
function delTodo(id) {
todos.value = todos.value.filter(x => x.id !== id)
localStorage.setItem('mom_todos', JSON.stringify(todos.value))
}
</script>
<style scoped>
.section-title { font-size: 16px; font-weight: 600; margin: 16px 0 12px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f8f9fa; border-radius: 10px; margin-bottom: 8px; }
.todo-item.done { opacity: 0.5; }
.checkbox { font-size: 20px; cursor: pointer; }
.todo-content { flex: 1; }
.todo-name { font-size: 15px; }
.todo-time { font-size: 12px; color: #999; margin-top: 2px; }
.todo-days { font-size: 12px; color: #f5576c; font-weight: 600; }
.todo-del { cursor: pointer; }
.add-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; min-width: 100px; }
select.input { background: white; }
.btn { padding: 10px 20px; background: #f5576c; color: white; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.empty { text-align: center; color: #ccc; padding: 30px; }
</style>

280
src/views/Tracker.vue Normal file
View File

@ -0,0 +1,280 @@
<template>
<div class="tracker-page">
<div class="tab-bar">
<div v-for="t in tabs" :key="t.key"
:class="['tab', { active: activeTab === t.key }]"
@click="activeTab = t.key">{{ t.label }}</div>
</div>
<!-- 体重记录 -->
<div v-if="activeTab === 'weight'" class="tab-content">
<div class="section-title">🏋️ 体重记录</div>
<div class="input-row">
<input v-model="weightVal" type="number" step="0.1" placeholder="今日体重(kg)" class="input" />
<button class="btn" @click="addWeight">记录</button>
</div>
<div class="chart-area">
<div v-for="(w, i) in weightData" :key="w.id" class="chart-bar-wrap">
<div class="chart-bar" :style="{ height: getBarHeight(w.value) + '%' }">
<span class="chart-val">{{ w.value }}</span>
</div>
<div class="chart-label">{{ w.date.slice(5) }}</div>
</div>
</div>
<div v-if="!weightData.length" class="empty">暂无体重记录</div>
</div>
<!-- 胎动计数 -->
<div v-if="activeTab === 'kick'" class="tab-content">
<div class="section-title">👶 胎动计数</div>
<div class="kick-counter">
<div class="kick-num">{{ kicks }}</div>
<div class="kick-label">今日胎动次数</div>
<div class="kick-btns">
<button class="btn-big" @click="addKick">+1 次胎动</button>
<button class="btn-clear" @click="resetKicks">重置</button>
</div>
<div class="kick-timer">计时:{{ kickTimer }}分钟</div>
</div>
<div class="kick-history">
<div v-for="k in kickLogs" :key="k.id" class="history-item">
<span>{{ k.date }}</span>
<span>{{ k.count }}次/小时</span>
</div>
</div>
</div>
<!-- 宫缩计时 -->
<div v-if="activeTab === 'contraction'" class="tab-content">
<div class="section-title">⏱️ 宫缩计时器</div>
<div class="contraction-timer">
<div class="timer-display">{{ formatTime(elapsed) }}</div>
<div class="timer-status">{{ isRunning ? '⏳ 宫缩中…' : '✅ 已停止' }}</div>
<div class="timer-btns">
<button class="btn" @click="startContraction" :disabled="isRunning">开始计时</button>
<button class="btn" @click="stopContraction" :disabled="!isRunning">停止</button>
</div>
<div class="interval-info">
<div v-for="c in contractions" :key="c.id" class="interval-item">
<span>{{ c.start }}</span>
<span>{{ c.duration }}秒</span>
<span v-if="c.interval">间隔 {{ c.interval }}分</span>
</div>
<div v-if="!contractions.length" class="empty">暂无记录</div>
</div>
</div>
</div>
<!-- 症状记录 -->
<div v-if="activeTab === 'symptom'" class="tab-content">
<div class="section-title">📝 症状记录</div>
<div class="symptom-grid">
<div v-for="s in symptoms" :key="s.name"
:class="['symptom-item', { selected: selectedSymptoms.includes(s.name) }]"
@click="toggleSymptom(s.name)">
<span class="s-icon">{{ s.icon }}</span>
<span>{{ s.name }}</span>
</div>
</div>
<textarea v-model="symptomNote" placeholder="补充说明…" class="textarea"></textarea>
<button class="btn" @click="saveSymptoms">保存今日记录</button>
<div v-for="s in symptomLogs" :key="s.id" class="symptom-log">
<div class="sl-date">{{ s.date }}</div>
<div class="sl-items">{{ s.items.join('、') }}</div>
<div v-if="s.note" class="sl-note">{{ s.note }}</div>
</div>
</div>
<!-- 补剂提醒 -->
<div v-if="activeTab === 'medicine'" class="tab-content">
<div class="section-title">💊 补剂提醒</div>
<div v-for="m in meds" :key="m.name" class="med-item">
<div class="med-info">
<div class="med-name">{{ m.name }}</div>
<div class="med-dosage">{{ m.dosage }}</div>
</div>
<div :class="['med-status', { taken: m.taken }]" @click="toggleMed(m.name)">
{{ m.taken ? '✅ 已吃' : '⭕ 未吃' }}
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import dayjs from 'dayjs'
const route = useRoute()
const activeTab = ref(route.query.tab || 'weight')
const tabs = [
{ key: 'weight', label: '体重' },
{ key: 'kick', label: '胎动' },
{ key: 'contraction', label: '宫缩' },
{ key: 'symptom', label: '症状' },
{ key: 'medicine', label: '补剂' },
]
// === 体重 ===
const weightVal = ref('')
const weightData = ref(JSON.parse(localStorage.getItem('mom_weights') || '[]'))
const maxWeight = computed(() => Math.max(...weightData.value.map(w => w.value), 60))
function addWeight() {
if (!weightVal.value) return
weightData.value.push({ id: Date.now(), value: Number(weightVal.value), date: dayjs().format('YYYY-MM-DD') })
localStorage.setItem('mom_weights', JSON.stringify(weightData.value))
weightVal.value = ''
}
function getBarHeight(v) { return (v / maxWeight.value) * 100 }
// === 胎动 ===
const kicks = ref(Number(localStorage.getItem('mom_kicks') || '0'))
const kickTimer = ref(0)
const kickLogs = ref(JSON.parse(localStorage.getItem('mom_kick_logs') || '[]'))
let kickInterval = null
function addKick() {
kicks.value++
localStorage.setItem('mom_kicks', String(kicks.value))
if (!kickInterval) {
kickInterval = setInterval(() => { kickTimer.value++ }, 60000)
}
}
function resetKicks() {
const now = dayjs().format('YYYY-MM-DD HH:mm')
kickLogs.value.unshift({ id: Date.now(), date: now, count: kicks.value })
localStorage.setItem('mom_kick_logs', JSON.stringify(kickLogs.value))
kicks.value = 0; kickTimer.value = 0
clearInterval(kickInterval); kickInterval = null
localStorage.setItem('mom_kicks', '0')
}
// === 宫缩 ===
const isRunning = ref(false)
const elapsed = ref(0)
const startTime = ref(null)
const contractions = ref(JSON.parse(localStorage.getItem('mom_contractions') || '[]'))
let interval = null
function startContraction() {
isRunning.value = true; startTime.value = Date.now(); elapsed.value = 0
interval = setInterval(() => { elapsed.value = Math.floor((Date.now() - startTime.value) / 1000) }, 100)
}
function stopContraction() {
isRunning.value = false; clearInterval(interval)
const last = contractions.value[0]
contractions.value.unshift({
id: Date.now(),
start: dayjs(startTime.value).format('HH:mm:ss'),
duration: elapsed.value,
interval: last ? Math.floor((startTime.value - dayjs(last.start, 'HH:mm:ss').toDate().getTime()) / 60000) : null,
})
localStorage.setItem('mom_contractions', JSON.stringify(contractions.value))
}
function formatTime(s) {
const m = Math.floor(s / 60); const sec = s % 60
return `${String(m).padStart(2, '0')}:${String(sec).padStart(2, '0')}`
}
// === 症状 ===
const symptoms = [
{ name: '孕吐', icon: '🤢' }, { name: '水肿', icon: '🦵' }, { name: '腰酸', icon: '😣' },
{ name: '失眠', icon: '😴' }, { name: '便秘', icon: '💩' }, { name: '头晕', icon: '😵' },
{ name: '胃灼热', icon: '🔥' }, { name: '腿抽筋', icon: '🦵' }, { name: '疲劳', icon: '😫' },
]
const selectedSymptoms = ref([])
const symptomNote = ref('')
const symptomLogs = ref(JSON.parse(localStorage.getItem('mom_symptoms') || '[]'))
function toggleSymptom(name) {
const i = selectedSymptoms.value.indexOf(name)
i >= 0 ? selectedSymptoms.value.splice(i, 1) : selectedSymptoms.value.push(name)
}
function saveSymptoms() {
if (!selectedSymptoms.value.length) return
symptomLogs.value.unshift({
id: Date.now(), date: dayjs().format('YYYY-MM-DD HH:mm'),
items: [...selectedSymptoms.value], note: symptomNote.value,
})
localStorage.setItem('mom_symptoms', JSON.stringify(symptomLogs.value))
selectedSymptoms.value = []; symptomNote.value = ''
}
// === 补剂 ===
const meds = ref(JSON.parse(localStorage.getItem('mom_meds') || '[]'))
onMounted(() => {
const today = dayjs().format('YYYY-MM-DD')
if (meds.value.length === 0) {
meds.value = [
{ name: '叶酸', dosage: '400μg/天', taken: false, date: '' },
{ name: '钙片', dosage: '600mg/天', taken: false, date: '' },
{ name: '铁剂', dosage: '遵医嘱', taken: false, date: '' },
]
}
// 每天重置
meds.value.forEach(m => { if (m.date !== today) { m.taken = false; m.date = today } })
localStorage.setItem('mom_meds', JSON.stringify(meds.value))
})
function toggleMed(name) {
const m = meds.value.find(x => x.name === name)
if (m) { m.taken = !m.taken; m.date = dayjs().format('YYYY-MM-DD') }
localStorage.setItem('mom_meds', JSON.stringify(meds.value))
}
</script>
<style scoped>
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 8px 16px; font-size: 13px; border-radius: 20px; background: #f0f0f0; cursor: pointer; white-space: nowrap; }
.tab.active { background: #f5576c; color: white; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.btn { padding: 10px 20px; background: #f5576c; color: white; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn:disabled { opacity: 0.5; }
.empty { text-align: center; color: #ccc; padding: 20px; }
/* 图表 */
.chart-area { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding: 10px 0; overflow-x: auto; }
.chart-bar-wrap { display: flex; flex-direction: column; align-items: center; min-width: 36px; }
.chart-bar { width: 28px; background: linear-gradient(to top, #667eea, #764ba2); border-radius: 4px 4px 0 0; position: relative; min-height: 4px; transition: height 0.3s; }
.chart-val { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #666; }
.chart-label { font-size: 10px; color: #999; margin-top: 4px; }
/* 胎动 */
.kick-counter { text-align: center; padding: 24px; background: #f8f9fa; border-radius: 16px; margin-bottom: 16px; }
.kick-num { font-size: 72px; font-weight: 700; color: #f5576c; }
.kick-label { font-size: 14px; color: #666; margin-bottom: 16px; }
.kick-btns { display: flex; gap: 12px; justify-content: center; margin-bottom: 12px; }
.btn-big { padding: 14px 32px; background: #f5576c; color: white; border: none; border-radius: 12px; font-size: 16px; cursor: pointer; }
.btn-clear { padding: 14px 24px; background: #eee; color: #666; border: none; border-radius: 12px; font-size: 14px; cursor: pointer; }
.kick-timer { font-size: 13px; color: #999; }
.history-item { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
/* 宫缩 */
.contraction-timer { text-align: center; padding: 24px; background: #f8f9fa; border-radius: 16px; margin-bottom: 16px; }
.timer-display { font-size: 48px; font-weight: 300; font-variant-numeric: tabular-nums; }
.timer-status { font-size: 14px; color: #666; margin-bottom: 16px; }
.timer-btns { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.interval-item { display: flex; gap: 12px; justify-content: center; padding: 6px; font-size: 13px; color: #666; }
/* 症状 */
.symptom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.symptom-item { padding: 12px 8px; text-align: center; background: #f8f9fa; border-radius: 10px; font-size: 13px; cursor: pointer; }
.symptom-item.selected { background: #fce4ec; color: #c62828; border: 1px solid #f5576c; }
.s-icon { display: block; font-size: 24px; margin-bottom: 4px; }
.textarea { width: 100%; height: 60px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 12px; resize: none; }
.symptom-log { padding: 10px; background: #f8f9fa; border-radius: 8px; margin-top: 8px; font-size: 13px; }
.sl-date { color: #999; font-size: 12px; }
.sl-items { margin: 4px 0; }
.sl-note { color: #888; font-size: 12px; }
/* 补剂 */
.med-item { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: #f8f9fa; border-radius: 10px; margin-bottom: 8px; }
.med-name { font-size: 15px; font-weight: 500; }
.med-dosage { font-size: 12px; color: #999; margin-top: 2px; }
.med-status { font-size: 14px; cursor: pointer; padding: 6px 12px; border-radius: 8px; }
.med-status.taken { background: #e8f5e9; }
</style>

10
vite.config.js Normal file
View File

@ -0,0 +1,10 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
server: {
host: '0.0.0.0',
port: 5173,
},
})