From 66ea2f558db021dd90055c264e09abf2a9c82baa Mon Sep 17 00:00:00 2001 From: li Date: Sat, 14 Mar 2026 20:38:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20H5=E5=BE=AE=E5=AE=A2=E5=AE=9DUI?= =?UTF-8?q?=E5=85=A8=E9=9D=A2=E5=8D=87=E7=BA=A7=20-=20=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=E5=8E=9F=E5=9E=8B=E5=9B=BE=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/views/grow/index.vue | 181 +++++++++----- client/src/views/home/index.vue | 338 ++++++++++++++++++-------- client/src/views/layout/TabLayout.vue | 108 ++++++-- client/src/views/meal/index.vue | 129 ++++++---- client/src/views/my/index.vue | 144 +++++++---- 5 files changed, 624 insertions(+), 276 deletions(-) diff --git a/client/src/views/grow/index.vue b/client/src/views/grow/index.vue index 9aa7e8d..5b0b777 100644 --- a/client/src/views/grow/index.vue +++ b/client/src/views/grow/index.vue @@ -10,100 +10,153 @@ const loading = ref(true) const metricTypeLabel = { 1: '体温', 2: '体重', 3: '血压', 4: '黄疸', 5: '宝宝体重', 6: '宝宝体温' } const metricUnit = { 1: '℃', 2: 'kg', 3: 'mmHg', 4: 'mg/dL', 5: 'kg', 6: '℃' } +const metricColor = { 1: '#f43f5e', 2: '#3b82f6', 3: '#8b5cf6', 4: '#f59e0b', 5: '#10b981', 6: '#ec4899' } onMounted(async () => { try { - const [pRes, mRes] = await Promise.all([ - careApi.profile(), - careApi.metrics({ limit: 10 }), - ]) + const [pRes, mRes] = await Promise.all([careApi.profile(), careApi.metrics({ limit: 10 })]) profile.value = pRes.data?.data metrics.value = mRes.data?.data || [] - } catch { } finally { - loading.value = false } + } catch { } finally { loading.value = false } }) diff --git a/client/src/views/home/index.vue b/client/src/views/home/index.vue index f283911..b9ce254 100644 --- a/client/src/views/home/index.vue +++ b/client/src/views/home/index.vue @@ -13,9 +13,7 @@ onMounted(async () => { try { const res = await homeApi.index() homeData.value = res.data?.data - } catch { } finally { - loading.value = false - } + } catch { } finally { loading.value = false } }) const customer = computed(() => homeData.value?.customer || store.info) @@ -26,125 +24,265 @@ const nannyOrder = computed(() => homeData.value?.nanny_order) const mealTypeLabel = { 1: '早餐', 2: '上午茶', 3: '午餐', 4: '下午茶', 5: '晚餐', 6: '宵夜' } const features = [ - { icon: 'records', label: '护理记录', color: '#ff8fa3', path: '/care/records' }, - { icon: 'chart-trending-o', label: '健康指标', color: '#7ec8e3', path: '/care/metrics' }, - { icon: 'balance-list-o', label: '我的服务', color: '#a8d8a8', path: '/service/orders' }, - { icon: 'user-o', label: '我的月嫂', color: '#c9b8f0', path: '/nanny' }, - { icon: 'gold-coin-o', label: '我的账户', color: '#ffd580', path: '/account' }, - { icon: 'chat-o', label: '投诉反馈', color: '#ffb085', path: '/complaints' }, + { label: '月子餐', bg: '#fff0f4', color: '#f43f5e', icon: 'food-o', path: '/meal' }, + { label: '服务包', bg: '#eff6ff', color: '#3b82f6', icon: 'balance-list-o', path: '/service/orders' }, + { label: '护理记录', bg: '#fffbeb', color: '#f59e0b', icon: 'orders-o', path: '/care/records' }, + { label: '我的月嫂', bg: '#f5f3ff', color: '#8b5cf6', icon: 'user-circle-o', path: '/nanny' }, ] + +const today = new Date().toLocaleDateString('zh-CN', { month: 'long', day: 'numeric' }) diff --git a/client/src/views/layout/TabLayout.vue b/client/src/views/layout/TabLayout.vue index 9aeee61..62bfe49 100644 --- a/client/src/views/layout/TabLayout.vue +++ b/client/src/views/layout/TabLayout.vue @@ -1,37 +1,113 @@ diff --git a/client/src/views/meal/index.vue b/client/src/views/meal/index.vue index 8fc60ed..3283859 100644 --- a/client/src/views/meal/index.vue +++ b/client/src/views/meal/index.vue @@ -11,7 +11,8 @@ const reviewForm = ref({ rating: 5, content: '' }) const submitting = ref(false) const mealTypeLabel = { 1: '早餐', 2: '上午茶', 3: '午餐', 4: '下午茶', 5: '晚餐', 6: '宵夜' } -const mealTypeColor = { 1: '#ff8c69', 2: '#ffd166', 3: '#06d6a0', 4: '#a8dadc', 5: '#457b9d', 6: '#6d6875' } +const mealTypeBg = { 1: '#fff0f4', 2: '#fffbeb', 3: '#f0fdf4', 4: '#f0f9ff', 5: '#eff6ff', 6: '#faf5ff' } +const mealTypeColor = { 1: '#f43f5e', 2: '#f59e0b', 3: '#10b981', 4: '#0ea5e9', 5: '#3b82f6', 6: '#8b5cf6' } onMounted(fetchList) @@ -20,8 +21,7 @@ async function fetchList() { try { const res = await mealApi.list({ days: 7 }) plans.value = res.data?.data?.list || [] - } catch { } finally { - loading.value = false } + } catch { } finally { loading.value = false } } function openReview(plan) { @@ -38,13 +38,10 @@ async function submitReview() { showToast({ type: 'success', message: '评价成功' }) reviewVisible.value = false fetchList() - } catch { - showToast('评价失败,请重试') - } finally { - submitting.value = false } + } catch { showToast('评价失败,请重试') } + finally { submitting.value = false } } -// 按日期分组 const grouped = computed(() => { const map = {} plans.value.forEach(p => { @@ -58,62 +55,68 @@ const grouped = computed(() => { diff --git a/client/src/views/my/index.vue b/client/src/views/my/index.vue index 0c5e744..fbba034 100644 --- a/client/src/views/my/index.vue +++ b/client/src/views/my/index.vue @@ -10,10 +10,10 @@ const store = useCustomerStore() const customer = computed(() => store.info) const menus = [ - { icon: 'balance-list-o', label: '我的服务', color: '#5b8ff9', path: '/service/orders' }, - { icon: 'gold-coin-o', label: '账户余额', color: '#f59e0b', path: '/account' }, - { icon: 'user-o', label: '我的月嫂', color: '#c084fc', path: '/nanny' }, - { icon: 'chat-o', label: '投诉反馈', color: '#f87171', path: '/complaints' }, + { icon: 'balance-list-o', label: '我的服务', desc: '服务订单与执行记录', color: '#3b82f6', bg: '#eff6ff', path: '/service/orders' }, + { icon: 'gold-coin-o', label: '账户余额', desc: '充值与消费流水', color: '#f59e0b', bg: '#fffbeb', path: '/account' }, + { icon: 'user-circle-o', label: '我的月嫂', desc: '月嫂信息与排班', color: '#8b5cf6', bg: '#f5f3ff', path: '/nanny' }, + { icon: 'chat-o', label: '投诉反馈', desc: '问题与建议反馈', color: '#f43f5e', bg: '#fff0f4', path: '/complaints' }, ] async function doLogout() { @@ -28,63 +28,65 @@ async function doLogout() {