fix(miniprogram): 审计修复 — P0/P1 共 16 个问题
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

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:
iven
2026-04-24 01:37:34 +08:00
parent 6fbe7ec530
commit 7b7677dfec
16 changed files with 171 additions and 87 deletions

View File

@@ -11,6 +11,21 @@ export interface Appointment {
version: number;
}
export interface Doctor {
id: string;
name: string;
department: string;
title?: string;
}
export interface DoctorSchedule {
id: string;
doctor_id: string;
date: string;
time_slot: string;
available_count: number;
}
export async function listAppointments(page = 1) {
return api.get<{ data: Appointment[]; total: number }>(`/health/appointments?page=${page}&page_size=20`);
}
@@ -34,17 +49,17 @@ export async function cancelAppointment(id: string, version: number) {
}
export async function getDoctorSchedules(doctorId: string, startDate: string, endDate: string) {
return api.get<{ data: any[]; total: number }>(
return api.get<{ data: DoctorSchedule[]; total: number }>(
`/health/doctor-schedules?doctor_id=${doctorId}&start_date=${startDate}&end_date=${endDate}&page_size=50`
);
}
export async function listDoctors(department?: string) {
const deptParam = department ? `&department=${department}` : '';
return api.get<{ data: any[]; total: number }>(`/health/doctors?page_size=100${deptParam}`);
return api.get<{ data: Doctor[]; total: number }>(`/health/doctors?page_size=100${deptParam}`);
}
export async function calendarView(startDate: string, endDate: string, doctorId?: string) {
const docParam = doctorId ? `&doctor_id=${doctorId}` : '';
return api.get<any[]>(`/health/doctor-schedules/calendar?start_date=${startDate}&end_date=${endDate}${docParam}`);
return api.get<DoctorSchedule[]>(`/health/doctor-schedules/calendar?start_date=${startDate}&end_date=${endDate}${docParam}`);
}

View File

@@ -8,6 +8,7 @@ export interface Article {
cover_image?: string;
category?: string;
published_at?: string;
author?: string;
}
export async function listArticles(page = 1) {

View File

@@ -10,10 +10,15 @@ export interface FollowUpTask {
version: number;
}
export interface FollowUpContent {
text: string;
[key: string]: string;
}
export interface FollowUpRecord {
id: string;
task_id: string;
content: any;
content: FollowUpContent;
created_at: string;
}
@@ -24,7 +29,7 @@ export async function listTasks(status?: string) {
);
}
export async function submitRecord(data: { task_id: string; content: any }) {
export async function submitRecord(data: { task_id: string; content: FollowUpContent }) {
return api.post<FollowUpRecord>('/health/follow-up-records', data);
}

View File

@@ -5,6 +5,7 @@ export interface VitalSignInput {
value: number;
measured_at?: string;
note?: string;
extra?: Record<string, number>;
}
export interface TodaySummary {

View File

@@ -25,6 +25,15 @@ export async function createPatient(data: {
return api.post<Patient>('/health/patients', data);
}
export async function updatePatient(id: string, data: any, version: number) {
export interface PatientUpdateInput {
name?: string;
gender?: string;
birthday?: string;
phone?: string;
id_number?: string;
relation?: string;
}
export async function updatePatient(id: string, data: PatientUpdateInput, version: number) {
return api.put<Patient>(`/health/patients/${id}`, { ...data, version });
}

View File

@@ -1,10 +1,18 @@
import { api } from './request';
export interface IndicatorDetail {
value: number;
unit?: string;
reference_min?: number;
reference_max?: number;
status?: string;
}
export interface LabReport {
id: string;
report_date: string;
report_type: string;
indicators: any;
indicators: Record<string, IndicatorDetail>;
doctor_interpretation?: string;
image_urls?: string[];
version: number;