diff --git a/index.html b/index.html index 93c0043..85cb935 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,18 @@ 常青树健康管理 +
diff --git a/src/components/AppTabBar.vue b/src/components/AppTabBar.vue index ef46279..24ba2c9 100644 --- a/src/components/AppTabBar.vue +++ b/src/components/AppTabBar.vue @@ -14,11 +14,11 @@ const currentTab = computed(() => { function navigate(target: string) { if (target === 'home' && route.path !== '/dashboard') { - router.push('/dashboard') + router.replace('/dashboard') } else if (target === 'assessment' && route.path !== '/assessment') { - router.push('/assessment') + router.replace('/assessment') } else if (target === 'profile' && route.path !== '/profile') { - router.push('/profile') + router.replace('/profile') } } @@ -80,15 +80,19 @@ function navigate(target: string) { transform: translateX(-50%); width: 100%; max-width: 480px; - height: 60px; - background: rgba(255, 255, 255, 0.96); + min-height: 56px; + height: calc(56px + env(safe-area-inset-bottom, 0px)); + box-sizing: border-box; + background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); border-top: 1px solid rgba(18, 63, 55, 0.08); display: flex; justify-content: space-around; - align-items: center; - z-index: 99; + align-items: flex-start; + padding-top: 6px; padding-bottom: env(safe-area-inset-bottom, 0px); + z-index: 999; box-shadow: 0 -4px 16px rgba(18, 63, 55, 0.04); } @@ -98,35 +102,33 @@ function navigate(target: string) { align-items: center; justify-content: center; flex: 1; - height: 100%; + height: 44px; color: #7d8e87; cursor: pointer; - transition: all 0.2s ease; + transition: color 0.2s ease; user-select: none; } .tab-icon { - margin-bottom: 2px; + width: 22px; + height: 22px; display: flex; align-items: center; justify-content: center; - transition: transform 0.2s ease; } .tab-label { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; + margin-top: 2px; + line-height: 1.2; } .tab-item.active { color: #0c5045; } -.tab-item.active .tab-icon { - transform: translateY(-1px); -} - .tab-item.active .tab-label { font-weight: 700; } diff --git a/src/router.ts b/src/router.ts index 0a38049..d31918e 100644 --- a/src/router.ts +++ b/src/router.ts @@ -24,4 +24,10 @@ router.beforeEach((to) => { if (to.meta.guest && hasToken()) return '/dashboard' }) +router.afterEach(() => { + if (typeof (window as any).WeixinJSBridge !== 'undefined' && (window as any).WeixinJSBridge.call) { + (window as any).WeixinJSBridge.call('hideToolbar') + } +}) + export default router diff --git a/src/services/health.ts b/src/services/health.ts index adf68a6..6d9c99b 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -171,6 +171,7 @@ export type HomeAssistantDeviceSwitchOutput = { deviceId: string entityId: string state: string + isMuted?: boolean | null message: string } diff --git a/src/styles.css b/src/styles.css index 3264ffe..504b157 100644 --- a/src/styles.css +++ b/src/styles.css @@ -11,7 +11,15 @@ } * { box-sizing: border-box; } -body { margin: 0; min-width: 320px; min-height: 100vh; background: #e8e6df; } +html, body { + margin: 0; + padding: 0; + min-width: 320px; + min-height: 100vh; + background: #e8e6df; + overflow-x: hidden; + -webkit-text-size-adjust: 100%; +} #app { max-width: 480px; margin: 0 auto; @@ -19,6 +27,7 @@ body { margin: 0; min-width: 320px; min-height: 100vh; background: #e8e6df; } position: relative; background: #f2f0e9; box-shadow: 0 0 30px rgba(0, 0, 0, 0.08); + overflow-x: hidden; } button, input, textarea { font: inherit; } button { cursor: pointer; } diff --git a/src/views/AssessmentView.vue b/src/views/AssessmentView.vue index adc7ccb..a221378 100644 --- a/src/views/AssessmentView.vue +++ b/src/views/AssessmentView.vue @@ -245,7 +245,7 @@ async function handleSave() { answers: { ...answers } }) showToast({ type: 'success', message: '评估已完成,已更新智能设备方案' }) - router.push('/dashboard') + router.replace('/dashboard') } catch (err) { showToast(err instanceof Error ? err.message : '保存失败,请重试') } finally { diff --git a/src/views/DashboardView.vue b/src/views/DashboardView.vue index fc312ce..6843374 100644 --- a/src/views/DashboardView.vue +++ b/src/views/DashboardView.vue @@ -88,14 +88,14 @@ onMounted(load) round color="#f1c37a" text-color="#183b34" - @click="router.push('/assessment')" + @click="router.replace('/assessment')" > 去健康评估 -
+
重要提醒
diff --git a/src/views/DeviceControlView.vue b/src/views/DeviceControlView.vue index a8189d8..f42efdf 100644 --- a/src/views/DeviceControlView.vue +++ b/src/views/DeviceControlView.vue @@ -1,7 +1,13 @@