fix(miniprogram): 审计修复 — P0/P1 共 16 个问题
P0 功能阻断: - 修复 login→bindPhone openid 状态传递断裂 - 首页健康卡片对接 useHealthStore 真实数据 - 血压录入改为收缩压/舒张压双输入 - 快捷服务路径修正(报告→/pages/report、随访→/pages/followup) P1 类型安全 + 组件: - 替换所有 <input>/<image>/<textarea> 为 Taro 组件 - service 层 any 类型全部替换(Doctor/DoctorSchedule/IndicatorDetail/FollowUpContent/PatientUpdateInput) - 预约详情数据传递简化为纯 Storage 缓存 - Article 接口添加 author 字段
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import Taro, { useDidShow } from '@tarojs/taro';
|
||||
import { useAuthStore } from '../../stores/auth';
|
||||
import { useHealthStore } from '../../stores/health';
|
||||
import EmptyState from '../../components/EmptyState';
|
||||
import './index.scss';
|
||||
|
||||
export default function Index() {
|
||||
const { user, restore } = useAuthStore();
|
||||
const { todaySummary, refreshToday } = useHealthStore();
|
||||
|
||||
useDidShow(() => {
|
||||
restore();
|
||||
refreshToday();
|
||||
});
|
||||
|
||||
const s = todaySummary || {};
|
||||
|
||||
const greeting = () => {
|
||||
const h = new Date().getHours();
|
||||
if (h < 6) return '凌晨好';
|
||||
@@ -38,10 +43,10 @@ export default function Index() {
|
||||
<Text className='section-title'>今日健康</Text>
|
||||
<View className='health-grid'>
|
||||
{[
|
||||
{ label: '血压', value: '--/--', unit: 'mmHg', status: '' },
|
||||
{ label: '心率', value: '--', unit: 'bpm', status: '' },
|
||||
{ label: '血糖', value: '--', unit: 'mmol/L', status: '' },
|
||||
{ label: '体重', value: '--', unit: 'kg', status: '' },
|
||||
{ label: '血压', value: s.blood_pressure ? `${s.blood_pressure.systolic}/${s.blood_pressure.diastolic}` : '--/--', unit: 'mmHg' },
|
||||
{ label: '心率', value: s.heart_rate ? `${s.heart_rate.value}` : '--', unit: 'bpm' },
|
||||
{ label: '血糖', value: s.blood_sugar ? `${s.blood_sugar.value}` : '--', unit: 'mmol/L' },
|
||||
{ label: '体重', value: s.weight ? `${s.weight.value}` : '--', unit: 'kg' },
|
||||
].map((item) => (
|
||||
<View className='health-item' key={item.label}>
|
||||
<Text className='health-label'>{item.label}</Text>
|
||||
@@ -57,15 +62,21 @@ export default function Index() {
|
||||
<Text className='section-title'>快捷服务</Text>
|
||||
<View className='service-grid'>
|
||||
{[
|
||||
{ label: '录数据', icon: '📝', path: '/pages/health/index' },
|
||||
{ label: '预约', icon: '📅', path: '/pages/appointment/index' },
|
||||
{ label: '报告', icon: '📋', path: '/pages/profile/index' },
|
||||
{ label: '随访', icon: '💬', path: '/pages/profile/index' },
|
||||
{ label: '录数据', icon: '📝', path: '/pages/health/index', isTab: true },
|
||||
{ label: '预约', icon: '📅', path: '/pages/appointment/index', isTab: true },
|
||||
{ label: '报告', icon: '📋', path: '/pages/report/index', isTab: false },
|
||||
{ label: '随访', icon: '💬', path: '/pages/followup/index', isTab: false },
|
||||
].map((item) => (
|
||||
<View
|
||||
className='service-item'
|
||||
key={item.label}
|
||||
onClick={() => Taro.switchTab({ url: item.path })}
|
||||
onClick={() => {
|
||||
if (item.isTab) {
|
||||
Taro.switchTab({ url: item.path });
|
||||
} else {
|
||||
Taro.navigateTo({ url: item.path });
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Text className='service-icon'>{item.icon}</Text>
|
||||
<Text className='service-label'>{item.label}</Text>
|
||||
|
||||
Reference in New Issue
Block a user