From afb0623190a6d9666d7d61bb33171c2fd7e6d7bd Mon Sep 17 00:00:00 2001 From: kola-web Date: Tue, 14 Jul 2026 10:41:19 +0800 Subject: [PATCH] =?UTF-8?q?2.0=20=E8=81=94=E8=B0=83&bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/api.md | 173 ++++++++++++++-------------- src/api/request.ts | 47 ++++---- src/app.ts | 1 - src/doctor/pages/d_caseReport/index.wxml | 4 +- src/doctor/pages/d_createTask/index.scss | 4 +- src/doctor/pages/d_createTask/index.ts | 48 ++++++-- src/doctor/pages/d_createTask/index.wxml | 3 +- src/doctor/pages/d_patientDetail/index.scss | 19 +++ src/doctor/pages/d_patientDetail/index.ts | 65 ++++++----- src/doctor/pages/d_patientDetail/index.wxml | 7 +- src/doctor/pages/d_taskDetail/index.ts | 2 +- src/gift/pages/record/index.scss | 28 ++--- src/gift/pages/record/index.ts | 155 +++++++++++++++++-------- src/gift/pages/record/index.wxml | 27 +++-- src/gift/pages/recordDetail/index.scss | 7 ++ src/gift/pages/recordDetail/index.ts | 89 ++++++++------ src/gift/pages/recordDetail/index.wxml | 17 ++- src/gift/pages/recordList/index.scss | 20 ++++ src/gift/pages/recordList/index.ts | 86 ++++++++------ src/gift/pages/recordList/index.wxml | 9 +- src/images/icon117.png | Bin 1761 -> 1337 bytes src/images/icon136.png | Bin 1760 -> 1348 bytes src/pages/caseReport/index.scss | 21 +++- src/pages/caseReport/index.ts | 5 + src/pages/caseReport/index.wxml | 11 +- src/pages/index/index.scss | 14 ++- src/pages/index/index.ts | 10 +- src/pages/index/index.wxml | 19 ++- src/pages/login/index.ts | 3 +- src/pages/qaFormDetail/index.wxml | 4 +- src/utils/tools.wxs | 8 +- 31 files changed, 581 insertions(+), 325 deletions(-) diff --git a/doc/api.md b/doc/api.md index 6d52f27..e719687 100644 --- a/doc/api.md +++ b/doc/api.md @@ -296,12 +296,15 @@ "igG4Value": 135.0, "manualIgG4Value": 135.0, "displayIgG4Value": 135.0, + "lastIgG4Value": 120.0, + "change": 15.0, "totalIgGValue": 1200.0, "igEValue": 50.0, "eosCount": 0.3, "esrValue": 20.0, "crpValue": 5.0, "oralHormoneDosage": 4.0, + "oralHormoneDosageMg": 16.0, "medicationsUsed": [2, 3], "immunosuppressantName": [1, 7], "medicationsUsedOtherText": null, @@ -427,6 +430,8 @@ "immunosuppressantNameOtherText": null, "lastIgG4Value": 120.0, "change": 15.0, + "oralHormoneDosage": 10.0, + "oralHormoneDosageMg": 50.0, "medicalRecordTime": "2026-06-29 09:30:00", "prescriptionTime": "2026-06-29 10:15:00", "reportTime": "2026-06-28 14:20:00" @@ -442,6 +447,8 @@ - 同时传入 `year` 和 `count` 时,先按年份筛选再取最近 N 条 - `lastIgG4Value`:上一次就诊的 IgG4 值,float 类型;无上一次记录时为 null - `change`:本次与上一次 IgG4 值的差值(本次 - 上次),float 类型;任一值为 null 时为 null +- `oralHormoneDosage`:本次就诊的口服激素剂量(片),未录入时为 null +- `oralHormoneDosageMg`:本次就诊的口服激素剂量(float 类型),未录入时为 null - `manualIgG4Value`:患者手动录入的 IgG4 数值(冗余字段),未录入时为 null - `displayIgG4Value`:展示用 IgG4 数值,优先取 manualIgG4Value,为空则取 igG4Value;均为空时为 null - `medicalRecordTime`:病历时间(从门诊病历图片聚合),格式 YYYY-MM-DD 或 YYYY-MM-DD HH:mm:ss,无数据时为 null @@ -796,6 +803,84 @@ --- +### 1.12 获取枚举选项 + +- **路由**:`?r=igg4/medical-visit/get-enums` +- **请求方式**:GET +- **说明**:获取前端所需的全部枚举选项数据,统一返回。无请求参数。 + +#### 响应示例 + +```json +{ + "code": 0, + "message": "success", + "data": { + "recordStatus": [ + {"value": 1, "label": "草稿"}, + {"value": 2, "label": "已提交"} + ], + "oralHormoneDosage": [ + {"value": 1, "label": "1片"}, + {"value": 2, "label": "2片"}, + {"value": 4, "label": "4片"}, + {"value": 6, "label": "6片"}, + {"value": 8, "label": "8片"} + ], + "medicationsUsed": [ + {"value": 1, "label": "没有使用激素"}, + {"value": 2, "label": "激素"}, + {"value": 3, "label": "免疫抑制剂"}, + {"value": 4, "label": "靶向CD19生物制剂(伊奈利珠单抗)"}, + {"value": 5, "label": "靶向CD20生物制剂(利妥昔单抗等)"}, + {"value": 99, "label": "其他"} + ], + "immunosuppressantName": [ + {"value": 1, "label": "吗替麦考酚酯(骁悉、麦考芬)"}, + {"value": 2, "label": "替唑嘌呤"}, + {"value": 3, "label": "环磷酰胺"}, + {"value": 4, "label": "来氟米特"}, + {"value": 5, "label": "甲氨蝶呤"}, + {"value": 6, "label": "环孢素 A"}, + {"value": 7, "label": "他克莫司"}, + {"value": 8, "label": "艾拉莫德"}, + {"value": 99, "label": "其他"} + ], + "imageType": [ + {"value": "outpatientRecord", "label": "门诊病历及处方"}, + {"value": "labReport", "label": "检验报告"}, + {"value": "imagingExam", "label": "影像学检查"}, + {"value": "pathology", "label": "病理诊断及活检"}, + {"value": "immuneFunction", "label": "外周血免疫功能评估"} + ], + "ocrStatus": [ + {"value": 0, "label": "待解析"}, + {"value": 1, "label": "解析中"}, + {"value": 2, "label": "解析完成"}, + {"value": 3, "label": "解析失败"} + ], + "reminder": [ + {"value": 1, "label": "开启复诊提醒"}, + {"value": 2, "label": "关闭复诊提醒"} + ] + } +} +``` + +#### 字段说明 + +| 字段 | 类型 | 说明 | +|------|------|------| +| recordStatus | array | 记录状态枚举,value=状态值,label=中文描述 | +| oralHormoneDosage | array | 口服激素用量预设选项,value=片数,label=中文描述 | +| medicationsUsed | array | 本次就诊已使用药物,value=常量ID,label=中文描述,99=其他需补充文本 | +| immunosuppressantName | array | 免疫抑制剂名称,value=常量ID,label=中文描述,99=其他需补充文本 | +| imageType | array | 图片类型,value=小驼峰标识(用于接口参数),label=中文描述 | +| ocrStatus | array | OCR解析状态,value=状态值,label=中文描述 | +| reminder | array | 复诊提醒开关,value=状态值,label=中文描述 | + +--- + ## 二、医生端接口 模块路由前缀:`igg4/doctor/medical-visit` @@ -1295,94 +1380,6 @@ | ESR | — | mm/h | 不换算 | | CRP | — | mg/L | 不换算 | -### E. 数据库表结构 - -#### t_iggfour_medical_visit_record 就诊记录主表 - -| 字段名 | 类型 | 说明 | -|--------|------|------| -| Id | int AUTO_INCREMENT PK | 主键 | -| UserId | varchar(40) NOT NULL | 用户 ID | -| PatientId | int NOT NULL | 患者 ID | -| VisitDate | date NOT NULL | 就诊日期 | -| NextVisitDate | date DEFAULT NULL | 下次复诊日期 | -| IgG4Value | decimal(10,2) DEFAULT NULL | IgG4 数值(OCR 解析) | -| ManualIgG4Value | decimal(10,2) DEFAULT NULL | IgG4 数值(患者手动录入,冗余字段) | -| TotalIgGValue | decimal(10,2) DEFAULT NULL | 总 IgG 数值 | -| IgEValue | decimal(10,2) DEFAULT NULL | IgE 数值 | -| EosCount | decimal(10,2) DEFAULT NULL | EOS# 计数 | -| ESRValue | decimal(10,2) DEFAULT NULL | ESR 数值 | -| CRPValue | decimal(10,2) DEFAULT NULL | CRP 数值 | -| OralHormoneDosage | decimal(10,2) DEFAULT NULL | 口服激素每日用量(片) | -| MedicationsUsed | varchar(255) DEFAULT NULL | 本次就诊已使用的药物(JSON数组,多选),见附录G | -| ImmunosuppressantName | varchar(255) DEFAULT NULL | 正在使用的免疫抑制剂名称(JSON数组,多选),见附录G | -| MedicationsUsedOtherText | varchar(500) DEFAULT NULL | 本次就诊已使用药物-其他-补充文本 | -| ImmunosuppressantNameOtherText | varchar(500) DEFAULT NULL | 正在使用的免疫抑制剂名称-其他-补充文本 | -| MedicalRecordTime | varchar(30) DEFAULT NULL | 门诊病历时间 | -| PrescriptionTime | varchar(30) DEFAULT NULL | 处方时间 | -| ReportTime | varchar(30) DEFAULT NULL | 检查报告时间 | -| ChiefComplaint | text DEFAULT NULL | 主诉 | -| MedicalHistory | text DEFAULT NULL | 病史 | -| Diagnosis | text DEFAULT NULL | 诊断 | -| TreatmentPlan | text DEFAULT NULL | 处理意见 | -| Prescription | text DEFAULT NULL | 处方内容 | -| ClinicalDiagnosis | varchar(500) DEFAULT NULL | 临床诊断(从处方图片解析) | -| RecordStatus | tinyint NOT NULL DEFAULT 1 | 记录状态:1-草稿,2-已提交 | -| LastRecordId | int DEFAULT NULL | 上一条记录 ID | -| Status | tinyint NOT NULL DEFAULT 1 | 数据状态:1-有效,100-删除 | -| CreateWorkerId | int NOT NULL DEFAULT 0 | 创建人 | -| CreateTime | datetime NOT NULL | 创建时间 | -| UpdateWorkerId | int NOT NULL DEFAULT 0 | 更新人 | -| UpdateTime | datetime NOT NULL | 更新时间 | - -#### t_iggfour_medical_visit_record_image 就诊记录图片表 - -| 字段名 | 类型 | 说明 | -|--------|------|------| -| Id | int AUTO_INCREMENT PK | 主键 | -| RecordId | int NOT NULL | 关联就诊记录 ID | -| ImageType | tinyint NOT NULL | 图片类型:1-门诊病历,2-检验报告,3-影像检查,4-其他 | -| ImageUrl | varchar(500) NOT NULL | 原始图片 URL | -| MaskedImageUrl | varchar(500) DEFAULT NULL | 涂抹后图片 URL | -| OcrStatus | tinyint NOT NULL DEFAULT 0 | OCR 状态:0-未解析,1-解析中,2-解析完成,3-解析失败 | -| OcrText | text DEFAULT NULL | OCR 原始文本 | -| OcrParsedData | text DEFAULT NULL | OCR 解析结果(JSON) | -| IgG4Value | decimal(10,2) DEFAULT NULL | IgG4 数值 | -| TotalIgGValue | decimal(10,2) DEFAULT NULL | 总 IgG 数值 | -| IgEValue | decimal(10,2) DEFAULT NULL | IgE 数值 | -| EosCount | decimal(10,2) DEFAULT NULL | EOS# 计数 | -| ESRValue | decimal(10,2) DEFAULT NULL | ESR 数值 | -| CRPValue | decimal(10,2) DEFAULT NULL | CRP 数值 | -| ChiefComplaint | text DEFAULT NULL | 主诉(从门诊病历图片解析) | -| MedicalHistory | text DEFAULT NULL | 病史(从门诊病历图片解析) | -| Diagnosis | text DEFAULT NULL | 诊断(从门诊病历图片解析) | -| TreatmentPlan | text DEFAULT NULL | 处理意见(从门诊病历图片解析) | -| Prescription | text DEFAULT NULL | 从本图OCR解析的处方内容,仅图片类型=1时有值 | -| ClinicalDiagnosis | varchar(500) DEFAULT NULL | 临床诊断(从处方图片解析) | -| MedicalRecordTime | varchar(30) DEFAULT NULL | 门诊病历时间 | -| PrescriptionTime | varchar(30) DEFAULT NULL | 处方时间 | -| ReportTime | varchar(30) DEFAULT NULL | 检查报告时间 | -| SortOrder | int NOT NULL DEFAULT 0 | 排序序号 | -| Status | tinyint NOT NULL DEFAULT 1 | 数据状态:1-有效,100-删除 | -| CreateWorkerId | int NOT NULL DEFAULT 0 | 创建人 | -| CreateTime | datetime NOT NULL | 创建时间 | -| UpdateWorkerId | int NOT NULL DEFAULT 0 | 更新人 | -| UpdateTime | datetime NOT NULL | 更新时间 | - -#### t_medical_visit_reminder_config 复诊提醒配置表 - -| 字段名 | 类型 | 说明 | -|--------|------|------| -| Id | int AUTO_INCREMENT PK | 主键 | -| PatientId | int NOT NULL | 患者 ID(唯一索引) | -| ReminderEnabled | tinyint NOT NULL DEFAULT 2 | 是否开启复诊提醒:1-开启,2-关闭 | -| Status | tinyint NOT NULL DEFAULT 1 | 数据状态:1-有效,100-删除 | -| CreateWorkerId | int DEFAULT NULL | 创建人 | -| CreateTime | datetime DEFAULT NULL | 创建时间 | -| UpdateWorkerId | int DEFAULT NULL | 更新人 | -| UpdateTime | datetime DEFAULT NULL | 更新时间 | - - ### G. 药物选项枚举 #### MedicationsUsed 本次就诊已使用的药物(多选) diff --git a/src/api/request.ts b/src/api/request.ts index fe5db74..64d9312 100644 --- a/src/api/request.ts +++ b/src/api/request.ts @@ -1,6 +1,6 @@ interface IGlobalParams { - gUrl: string; - version: string; + gUrl: string + version: string } export const request = function ( @@ -10,9 +10,9 @@ export const request = function ( return new Promise((resolve, reject) => { if (loading) { wx.showLoading({ - title: "加载中...", + title: '加载中...', mask: true, - }); + }) } wx.request({ header: { @@ -27,46 +27,47 @@ export const request = function ( }, ...options, success(res: any) { - const { code, data } = res.data; + const { code, data } = res.data if (isJSON) { - resolve(res.data); + resolve(res.data) } else if (code === 0) { - resolve(data); + resolve(data) } else if (showMsg) { - const msg = errPicker(res.data); + const msg = errPicker(res.data) if (loading) { setTimeout(() => { wx.showToast({ title: msg, - icon: "none", - }); - }, 30); + icon: 'none', + }) + }, 30) + reject(res) } else { wx.showToast({ title: msg, - icon: "none", - }); - reject(res); + icon: 'none', + }) + reject(res) } } else { - reject(res); + reject(res) } }, fail(err) { - reject(err); + reject(err) }, complete() { if (loading) { - wx.hideLoading(); + wx.hideLoading() } }, - }); - }); -}; + }) + }) +} function errPicker(err) { - if (typeof err === "string") { - return err; + if (typeof err === 'string') { + return err } - return err.data || err.msg || err.errMsg || (err.detail && err.detail.errMsg) || "未知错误"; + return err.data || err.msg || err.message || err.errMsg || (err.detail && err.detail.errMsg) || '未知错误' } diff --git a/src/app.ts b/src/app.ts index 8426bc9..feb2dca 100644 --- a/src/app.ts +++ b/src/app.ts @@ -248,7 +248,6 @@ App({ verifySys(pub = false) { // 1:患者 2:医生 const { loginType, isLogin, anyWhere } = this.globalData - console.log('DEBUGPRINT[229]: app.ts:246: loginType=', loginType) const pages = getCurrentPages() const currentPage = pages[pages.length - 1] const url = currentPage.route diff --git a/src/doctor/pages/d_caseReport/index.wxml b/src/doctor/pages/d_caseReport/index.wxml index 6f97843..6190eda 100644 --- a/src/doctor/pages/d_caseReport/index.wxml +++ b/src/doctor/pages/d_caseReport/index.wxml @@ -25,7 +25,5 @@ - - 暂无记录 - + diff --git a/src/doctor/pages/d_createTask/index.scss b/src/doctor/pages/d_createTask/index.scss index a1fb6cf..f4d5abb 100644 --- a/src/doctor/pages/d_createTask/index.scss +++ b/src/doctor/pages/d_createTask/index.scss @@ -119,7 +119,9 @@ page { border-color: rgba(22, 121, 203, 1); } &:nth-of-type(4), - &:nth-of-type(5) { + &:nth-of-type(5), + &:nth-of-type(6), + &:nth-of-type(7) { width: 100%; } } diff --git a/src/doctor/pages/d_createTask/index.ts b/src/doctor/pages/d_createTask/index.ts index 3b351d9..d416041 100644 --- a/src/doctor/pages/d_createTask/index.ts +++ b/src/doctor/pages/d_createTask/index.ts @@ -14,8 +14,8 @@ Page({ start: dayjs().format('HH:mm'), end: '19:00', - disabledTime: Number(dayjs().format('HH')) * 1 > 19, - sendDay: 0, // 0 今天 1 明天 + disabledTime: dayjs().format('HH:mm') >= '19:00', + sendDay: dayjs().format('HH:mm') >= '19:00' ? 1 : 0, // 0 今天 1 明天 PushTemplateId: 0, //推送模板 IsSendNow: 0, //是否立即发送 0-定时,1-立即 @@ -37,10 +37,12 @@ Page({ ], MedicationTypeColumn: [ { id: 0, value: '全部' }, - { id: 2, value: '激素' }, - { id: 3, value: '免疫抑制剂' }, - { id: 4, value: '靶向CD19生物制剂(伊奈利珠单抗)' }, - { id: 5, value: '靶向CD20生物制剂(利妥昔单抗等)' }, + {"id": 99, "value": "其他"}, + {"id": 2, "value": "激素"}, + {"id": 1, "value": "没有使用激素"}, + {"id": 3, "value": "免疫抑制剂"}, + {"id": 4, "value": "靶向CD19生物制剂(伊奈利珠单抗)"}, + {"id": 5, "value": "靶向CD20生物制剂(利妥昔单抗等)"}, ], }, onLoad() { @@ -71,8 +73,12 @@ Page({ }, onShow() { this.handleViewMp() + const isAfter19 = dayjs().format('HH:mm') >= '19:00' this.setData({ - time: Number(dayjs().format('HH')) * 1 >= 12 ? dayjs().format('HH:mm') : '12:00', + disabledTime: isAfter19, + sendDay: isAfter19 ? 1 : 0, + start: isAfter19 ? '08:00' : dayjs().format('HH:mm'), + time: isAfter19 ? '12:00' : (Number(dayjs().format('HH')) * 1 >= 12 ? dayjs().format('HH:mm') : '12:00'), }) }, getTemplate() { @@ -171,14 +177,30 @@ Page({ }, handleDay(e) { const { value } = e.currentTarget.dataset + const isAfter19 = dayjs().format('HH:mm') >= '19:00' + if (value === 0 && isAfter19) { + wx.showToast({ title: '已超过今天发送时间', icon: 'none' }) + return + } const currentTime = Number(dayjs().format('HH')) * 1 >= 12 ? dayjs().format('HH:mm') : '12:00' this.setData({ time: value === 0 ? currentTime : '12:00', sendDay: value, start: value === 0 ? dayjs().format('HH:mm') : '08:00', - disabledTime: value === 0 ? Number(dayjs().format('HH')) * 1 > 19 : false, + disabledTime: false, }) }, + handleTimeChange(e) { + const value = e.detail.value as string + const { start, end } = this.data + if (value < start) { + wx.showToast({ title: `发送时间为 ${start}-${end}`, icon: 'none' }) + this.setData({ time: start }) + } else if (value > end) { + wx.showToast({ title: `发送时间为 ${start}-${end}`, icon: 'none' }) + this.setData({ time: end }) + } + }, handleDateToast() { const { disabledTime } = this.data if (disabledTime) { @@ -275,6 +297,16 @@ Page({ }) return } + if (IsSendNow === 0 && time) { + const { start, end } = this.data + if (time < start || time > end) { + wx.showToast({ + icon: 'none', + title: `发送时间为 ${start}-${end}`, + }) + return + } + } if (!PushTemplateId) { wx.showToast({ icon: 'none', diff --git a/src/doctor/pages/d_createTask/index.wxml b/src/doctor/pages/d_createTask/index.wxml index 6920904..5608dae 100644 --- a/src/doctor/pages/d_createTask/index.wxml +++ b/src/doctor/pages/d_createTask/index.wxml @@ -103,7 +103,7 @@ - 今天 + 今天 明天 @@ -114,6 +114,7 @@ mode="time" start="{{start}}" end="{{end}}" + bindchange="handleTimeChange" > {{time}} diff --git a/src/doctor/pages/d_patientDetail/index.scss b/src/doctor/pages/d_patientDetail/index.scss index 0116721..7af568e 100644 --- a/src/doctor/pages/d_patientDetail/index.scss +++ b/src/doctor/pages/d_patientDetail/index.scss @@ -199,6 +199,25 @@ page { } .w-chart { height: 460rpx; + .w-empty { + padding-top: 86rpx; + text-align: center; + .icon { + width: 152rpx; + height: 139rpx; + } + .e-title { + margin-top: 24rpx; + font-size: 32rpx; + color: rgba(34, 34, 34, 0.2); + font-weight: bold; + } + .e-content { + margin-top: 10rpx; + font-size: 28rpx; + color: rgba(34, 34, 34, 0.2); + } + } } } } diff --git a/src/doctor/pages/d_patientDetail/index.ts b/src/doctor/pages/d_patientDetail/index.ts index c829be6..2072235 100644 --- a/src/doctor/pages/d_patientDetail/index.ts +++ b/src/doctor/pages/d_patientDetail/index.ts @@ -4,27 +4,6 @@ const app = getApp() let echarts: any = null -const MEDICATIONS_MAP: Record = { - 1: '没有使用激素', - 2: '激素', - 3: '免疫抑制剂', - 4: '靶向CD19生物制剂', - 5: '靶向CD20生物制剂', - 99: '其他', -} - -const IMMUNOSUPPRESSANT_MAP: Record = { - 1: '吗替麦考酚酯', - 2: '替唑嘌呤', - 3: '环磷酰胺', - 4: '来氟米特', - 5: '甲氨蝶呤', - 6: '环孢素A', - 7: '他克莫司', - 8: '艾拉莫德', - 99: '其他', -} - Page({ data: { toastShow: false, @@ -140,7 +119,8 @@ Page({ BeginMonth: dayjs().subtract(1, 'year').add(1, 'month').format('YYYY-MM'), EndMonth: dayjs().format('YYYY-MM'), chartUnit: '', - chartList: [] as any[], + chartList: [], + chartEmpty: true, // 病历报告 caseReportList: [ @@ -178,6 +158,10 @@ Page({ recordList: [] as any[], recordPagination: { count: 0, page: 1, pages: 1 }, + // 枚举 + medicationsMap: {} as Record, + immunosuppressantMap: {} as Record, + // 导出PPT pptGenerating: false, }, @@ -192,8 +176,8 @@ Page({ app.mpBehavior({ doctor: true, PageName: 'PG_DoctorPatientDetail', detailId: this.data.id }) this.getDoctorDetail() await this.getDetail() + this.getEnums() this.getIndicatorHistory() - this.getRecordList(true) }) }, @@ -386,16 +370,43 @@ Page({ data, }).then((res: any) => { if (!res) return + const chartList = res.list || [] + const chartEmpty = !chartList.length this.setData({ chartUnit: res.unit || 'mg/dL', - chartList: res.list || [], + chartList, + chartEmpty, + }, () => { + if (!chartEmpty) { + this.ecDataTrendComponent = null + this.initChart(chartList.reverse() || []) + } }) - this.initChart(res.list || []) }) }, // ========== 就诊记录列表 ========== + getEnums() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/medical-visit/get-enums', + }).then((res: any) => { + if (!res) return + const medicationsMap: Record = {} + for (const item of res.medicationsUsed || []) { + medicationsMap[item.value] = item.label + } + const immunosuppressantMap: Record = {} + for (const item of res.immunosuppressantName || []) { + immunosuppressantMap[item.value] = item.label + } + this.setData({ medicationsMap, immunosuppressantMap }) + // 枚举加载后刷新列表以应用新映射 + this.getRecordList(true) + }) + }, + getRecordList(reset = false) { const page = reset ? 1 : this.data.recordPagination.page wx.ajax({ @@ -410,9 +421,9 @@ Page({ if (!res) return const list = (res.list || []).map((item: any) => ({ ...item, - medicationLabels: (item.medicationsUsed || []).map((id: number) => MEDICATIONS_MAP[id]).filter(Boolean), + medicationLabels: (item.medicationsUsed || []).map((id: number) => this.data.medicationsMap[id]).filter(Boolean), immunosuppressantLabels: (item.immunosuppressantName || []) - .map((id: number) => IMMUNOSUPPRESSANT_MAP[id]) + .map((id: number) => this.data.immunosuppressantMap[id]) .filter(Boolean), })) diff --git a/src/doctor/pages/d_patientDetail/index.wxml b/src/doctor/pages/d_patientDetail/index.wxml index f6fc465..ed15a16 100644 --- a/src/doctor/pages/d_patientDetail/index.wxml +++ b/src/doctor/pages/d_patientDetail/index.wxml @@ -96,7 +96,12 @@ 单位{{chartUnit}} - + + + + 暂无数据 + 还没有您的记录信息哦~ + diff --git a/src/doctor/pages/d_taskDetail/index.ts b/src/doctor/pages/d_taskDetail/index.ts index 3195a05..572972c 100644 --- a/src/doctor/pages/d_taskDetail/index.ts +++ b/src/doctor/pages/d_taskDetail/index.ts @@ -77,7 +77,7 @@ Page({ BindStartDate: FilterCondition.BindStartDate, BindEndDate: FilterCondition.BindEndDate, ConfirmedIgg4: FilterCondition.ConfirmedIgg4, - MedicationType: FilterCondition.MedicationType, + MedicationType: FilterCondition.MedicationType.split(',').map(Number), }) }, }) diff --git a/src/gift/pages/record/index.scss b/src/gift/pages/record/index.scss index a8759d9..10e2830 100644 --- a/src/gift/pages/record/index.scss +++ b/src/gift/pages/record/index.scss @@ -195,6 +195,7 @@ page { background: transparent; } &::after { + margin-left: 12rpx; padding: 0 16rpx; line-height: 40rpx; content: '选填'; @@ -369,7 +370,7 @@ page { color: rgba(0, 0, 0, 1); } .place-input { - color: rgba(0, 0, 0, 0.4); + color: rgba(34, 34, 34, 0.4); } .icon { position: absolute; @@ -381,19 +382,18 @@ page { .sub { flex-shrink: 0; font-size: 36rpx; - color: rgba(34, 34, 34, 0.3); + color: rgba(34, 34, 34, 0.4); } } + .num-tip { + margin-top: 24rpx; + font-size: 32rpx; + color: rgba(34, 34, 34, 0.4); + } .check-group { margin-top: 32rpx; display: grid; gap: 24rpx; - &.col1 { - grid-template-columns: repeat(auto-fill, minmax(300rpx, 1fr)); - } - &.col2 { - grid-template-columns: repeat(2, 1fr); - } .check-item { display: flex; gap: 24rpx; @@ -431,6 +431,9 @@ page { display: block; } } + .content { + color: rgba(34, 34, 34, 0.7); + } } } } @@ -449,10 +452,7 @@ page { background-color: rgba(248, 248, 248, 1); border: 1px solid rgba(248, 248, 248, 1); box-sizing: border-box; - .content { - font-size: 36rpx; - color: rgba(34, 34, 34, 0.7); - } + color: rgba(34, 34, 34, 0.7); &.active { border-color: rgba(14, 182, 109, 1); background-color: rgba(14, 182, 109, 0.08); @@ -475,11 +475,11 @@ page { color: rgba(0, 0, 0, 1); } .place-input { - color: rgba(0, 0, 0, 0.4); + color: rgba(34, 34, 34, 0.4); } .sub { font-size: 36rpx; - color: rgba(0, 0, 0, 0.8); + color: rgba(34, 34, 34, 0.4); } } } diff --git a/src/gift/pages/record/index.ts b/src/gift/pages/record/index.ts index 242ad3f..bccb12e 100644 --- a/src/gift/pages/record/index.ts +++ b/src/gift/pages/record/index.ts @@ -1,29 +1,7 @@ import { debounce } from 'miniprogram-licia' +const dayjs = require('dayjs') const _app = getApp() -const MEDICATIONS_OPTIONS = [ - { id: 1, label: '没有使用激素', active: false }, - { id: 2, label: '激素', active: false }, - { id: 3, label: '免疫抑制剂', active: false }, - { id: 4, label: '靶向CD19生物制剂(伊奈利珠单抗)', active: false }, - { id: 5, label: '靶向CD20生物制剂(利妥昔单抗等)', active: false }, - { id: 99, label: '其他', active: false }, -] - -const IMMUNOSUPPRESSANT_OPTIONS = [ - { id: 1, label: '吗替麦考酚酯(骁悉、麦考芬)', active: false }, - { id: 2, label: '替唑嘌呤', active: false }, - { id: 3, label: '环磷酰胺', active: false }, - { id: 4, label: '来氟米特', active: false }, - { id: 5, label: '甲氨蝶呤', active: false }, - { id: 6, label: '环孢素 A', active: false }, - { id: 7, label: '他克莫司', active: false }, - { id: 8, label: '艾拉莫德', active: false }, - { id: 99, label: '其他', active: false }, -] - -const HORMONE_DOSAGE_OPTIONS = [1, 2, 4, 6, 8, 0.5] - const IMAGE_TYPE_MAP: Record = { outpatientRecord: 'outpatientRecord', labReport: 'labReport', @@ -55,9 +33,9 @@ Page({ immunosuppressantName: [] as number[], oralHormoneDosage: 0, customDosage: '', - medicationsOptions: MEDICATIONS_OPTIONS, - immunosuppressantOptions: IMMUNOSUPPRESSANT_OPTIONS, - hormoneDosageOptions: HORMONE_DOSAGE_OPTIONS, + medicationsOptions: [] as { id: number; label: string; active: boolean }[], + immunosuppressantOptions: [] as { id: number; label: string; active: boolean }[], + hormoneDosageOptions: [] as number[], // 其他输入 medicationsUsedOtherText: '', @@ -71,23 +49,30 @@ Page({ toastParams: {} as any, saving: false, submitted: false, + + today: dayjs().format('YYYY-MM-DD'), + tomorrow: dayjs().add(1, 'day').format('YYYY-MM-DD'), + + focus: false, }, _saveDraftDebounced: null as any, onLoad(options: any) { _app.waitLogin().then(() => { - _app.mpBehavior({ PageName: 'PG_PatientRecordAdd' }) - }) - if (options.id) { - this.setData({ draftId: Number(options.id) }) - _app.waitLogin().then(() => { - this.getDetail() + _app.permissionVerification(3, 0, '/gift/pages/record/index').then(() => { + _app.mpBehavior({ PageName: 'PG_PatientRecordAdd' }) + this.getEnums().then(() => { + if (options.id) { + this.setData({ draftId: Number(options.id) }) + this.getDetail() + } + }) }) - } + }) this._saveDraftDebounced = debounce(() => { - this.saveDraft() + this.saveDraft().catch(() => {}) }, 800) }, @@ -99,7 +84,7 @@ Page({ if (this.data.submitted || !this._hasFilledData()) { wx.disableAlertBeforeUnload() } else { - wx.enableAlertBeforeUnload({ message: '您有填写信息还未提交' }) + wx.enableAlertBeforeUnload({ message: '已填写信息将被保存为草稿', }) } }, @@ -114,6 +99,30 @@ Page({ // ========== API ========== + getEnums(): Promise { + return wx + .ajax({ + method: 'GET', + url: '?r=igg4/medical-visit/get-enums', + }) + .then((res: any) => { + if (!res) return + this.setData({ + medicationsOptions: (res.medicationsUsed || []).map((item: any) => ({ + id: item.value, + label: item.label, + active: false, + })), + immunosuppressantOptions: (res.immunosuppressantName || []).map((item: any) => ({ + id: item.value, + label: item.label, + active: false, + })), + hormoneDosageOptions: (res.oralHormoneDosage || []).map((item: any) => item.value), + }) + }) + }, + getDetail() { wx.ajax({ method: 'GET', @@ -128,18 +137,18 @@ Page({ igG4Value: res.manualIgG4Value != null ? String(res.manualIgG4Value) : '', medicationsUsed: res.medicationsUsed || [], immunosuppressantName: res.immunosuppressantName || [], - medicationsOptions: MEDICATIONS_OPTIONS.map((item) => ({ + medicationsOptions: this.data.medicationsOptions.map((item) => ({ ...item, active: (res.medicationsUsed || []).includes(item.id), })), - immunosuppressantOptions: IMMUNOSUPPRESSANT_OPTIONS.map((item) => ({ + immunosuppressantOptions: this.data.immunosuppressantOptions.map((item) => ({ ...item, active: (res.immunosuppressantName || []).includes(item.id), })), - oralHormoneDosage: res.oralHormoneDosage || 0, + oralHormoneDosage: res.oralHormoneDosage ? Number(res.oralHormoneDosage) : 0, recordStatus: res.recordStatus, customDosage: - res.oralHormoneDosage && !HORMONE_DOSAGE_OPTIONS.includes(res.oralHormoneDosage) + res.oralHormoneDosage && !this.data.hormoneDosageOptions.includes(Number(res.oralHormoneDosage)) ? String(res.oralHormoneDosage) : '', medicationsUsedOtherText: res.medicationsUsedOtherText || '', @@ -165,8 +174,8 @@ Page({ }, saveDraft(): Promise { - if (this.data.saving) return Promise.resolve() - if (!this.data.visitDate) return Promise.resolve() + if (this.data.saving) return Promise.reject(new Error('saving')) + if (!this.data.visitDate) return Promise.reject(new Error('no visitDate')) this.setData({ saving: true }) @@ -218,7 +227,6 @@ Page({ this.setData({ recordStatus: res.recordStatus }) } }) - .catch(() => {}) .finally(() => { this.setData({ saving: false }) }) @@ -226,6 +234,8 @@ Page({ autoSave() { this._updateAlertBeforeUnload() + // 编辑已提交的记录时不在实时保存,提交时统一保存 + if (this.data.recordStatus === 2) return if (this._saveDraftDebounced) { this._saveDraftDebounced() } @@ -255,12 +265,22 @@ Page({ // ========== Step1 事件 ========== handleVisitDateChange(e: WechatMiniprogram.PickerChange) { - this.setData({ visitDate: e.detail.value as string }) + const value = e.detail.value as string + if (value > dayjs().format('YYYY-MM-DD')) { + wx.showToast({ title: '就诊时间不能超过今天', icon: 'none' }) + return + } + this.setData({ visitDate: value }) this.autoSave() }, handleNextVisitDateChange(e: WechatMiniprogram.PickerChange) { - this.setData({ nextVisitDate: e.detail.value as string }) + const value = e.detail.value as string + if (value <= dayjs().format('YYYY-MM-DD')) { + wx.showToast({ title: '复诊时间必须在今天之后', icon: 'none' }) + return + } + this.setData({ nextVisitDate: value }) this.autoSave() }, @@ -269,6 +289,10 @@ Page({ this.setData({ toastShow: true, toastType: 'oneWrite', toastParams: {} }) return } + if (this.data.recordStatus === 2) { + this.setData({ step: 2 }) + return + } this.saveDraft().then(() => { this.setData({ step: 2 }) }) @@ -278,17 +302,22 @@ Page({ handleSetData(e: WechatMiniprogram.CustomEvent) { const imageType = e.currentTarget.dataset.type as string - const file = e.detail[0] const filesKey = `${imageType}Files` const currentFiles = (this.data[filesKey as any] as any[]) || [] - const newFile = { + const maxNum = 10 + const remaining = maxNum - currentFiles.length + if (remaining <= 0) { + wx.showToast({ title: '最多上传10张图片', icon: 'none' }) + return + } + const newFiles = (e.detail as any[]).slice(0, remaining).map((file) => ({ imgUrl: file.imgUrl, fileUrl: file.imgUrl, type: 'image', imageType, - } + })) this.setData({ - [filesKey]: [...currentFiles, newFile], + [filesKey]: [...currentFiles, ...newFiles], }) this.autoSave() }, @@ -330,6 +359,10 @@ Page({ }, handleStep2Prev() { + if (this.data.recordStatus === 2) { + this.setData({ step: 1 }) + return + } this.saveDraft().then(() => { this.setData({ step: 1 }) }) @@ -341,6 +374,10 @@ Page({ this.setData({ toastShow: true, toastType: 'oneWrite', toastParams: {} }) return } + if (this.data.recordStatus === 2) { + this.setData({ step: 3 }) + return + } this.saveDraft().then(() => { this.setData({ step: 3 }) }) @@ -349,7 +386,10 @@ Page({ // ========== Step3 事件 ========== handleIgG4Input(e: WechatMiniprogram.Input) { - this.setData({ igG4Value: e.detail.value }) + const value = e.detail.value + // 限制小数点后一位 + const formatted = value.replace(/^(\d+\.\d).*/, '$1').replace(/^\.$/, '0.') + this.setData({ igG4Value: formatted }) this.autoSave() }, @@ -361,11 +401,14 @@ Page({ }) const usedIds = options.filter((item) => item.active).map((item) => item.id) const isOtherActive = usedIds.includes(99) + const isHormoneActive = usedIds.includes(2) this.setData({ medicationsOptions: options, medicationsUsed: usedIds, medicationsOtherShow: isOtherActive, medicationsUsedOtherText: isOtherActive ? this.data.medicationsUsedOtherText : '', + oralHormoneDosage: isHormoneActive ? this.data.oralHormoneDosage : 0, + customDosage: isHormoneActive ? this.data.customDosage : '', }) this.autoSave() }, @@ -415,6 +458,10 @@ Page({ }, handleStep3Prev() { + if (this.data.recordStatus === 2) { + this.setData({ step: 2 }) + return + } this.saveDraft().then(() => { this.setData({ step: 2 }) }) @@ -443,6 +490,16 @@ Page({ this.submit() }) }, + handleFocus() { + this.setData({ + focus: true, + }) + }, + handleBlur() { + this.setData({ + focus: false, + }) + }, // ========== Toast 事件 ========== diff --git a/src/gift/pages/record/index.wxml b/src/gift/pages/record/index.wxml index 5a095e0..d8bee80 100644 --- a/src/gift/pages/record/index.wxml +++ b/src/gift/pages/record/index.wxml @@ -1,3 +1,4 @@ + @@ -45,7 +46,7 @@ 我的下次就诊时间 - + @@ -138,10 +140,11 @@ @@ -176,10 +179,11 @@ @@ -214,10 +218,11 @@ @@ -252,10 +257,11 @@ @@ -300,14 +306,18 @@ maxlength="{{8}}" value="{{igG4Value}}" bindinput="handleIgG4Input" + focus="{{focus}}" + bind:blur="handleBlur" /> mg/dL + 单位换算:1 g/L = 100 mg/dL @@ -342,7 +352,7 @@ - + 最近一周,口服激素的每日用量 @@ -369,10 +379,11 @@ /> + 醋酸泼尼松,每片为5mg;甲泼尼龙,每片为4mg;临床可等效替换。 - + 正在使用的免疫抑制剂名称 diff --git a/src/gift/pages/recordDetail/index.scss b/src/gift/pages/recordDetail/index.scss index 167c6ba..b1bc54b 100644 --- a/src/gift/pages/recordDetail/index.scss +++ b/src/gift/pages/recordDetail/index.scss @@ -131,6 +131,13 @@ page { padding-bottom: 28rpx; font-size: 36rpx; color: rgba(34, 34, 34, 1); + display: flex; + align-items: center; + gap: 16rpx; + .icon { + width: 32rpx; + height: 37rpx; + } } } } diff --git a/src/gift/pages/recordDetail/index.ts b/src/gift/pages/recordDetail/index.ts index e993c98..e3e481a 100644 --- a/src/gift/pages/recordDetail/index.ts +++ b/src/gift/pages/recordDetail/index.ts @@ -1,32 +1,3 @@ -const MEDICATIONS_MAP: Record = { - 1: '没有使用激素', - 2: '激素', - 3: '免疫抑制剂', - 4: '靶向CD19生物制剂', - 5: '靶向CD20生物制剂', - 99: '其他', -} - -const IMMUNOSUPPRESSANT_MAP: Record = { - 1: '吗替麦考酚酯', - 2: '替唑嘌呤', - 3: '环磷酰胺', - 4: '来氟米特', - 5: '甲氨蝶呤', - 6: '环孢素A', - 7: '他克莫司', - 8: '艾拉莫德', - 99: '其他', -} - -const IMAGE_TYPE_LABELS: Record = { - outpatientRecord: '门诊病历及处方', - labReport: '检验报告', - imagingExam: '影像学检查', - pathology: '病理诊断及活检', - immuneFunction: '外周血免疫功能评估', -} - const app = getApp() Page({ @@ -40,21 +11,61 @@ Page({ immunosuppressantLabel: '', reminderEnabled: 2, imageGroups: [] as { type: string; label: string; list: string[] }[], + change: 0, + + // 枚举 + medicationsMap: {} as Record, + immunosuppressantMap: {} as Record, + imageTypeLabels: {} as Record, }, onLoad(options: any) { app.waitLogin().then(() => { app.mpBehavior({ PageName: 'PG_PatientRecordDetail', detailId: String(options.id) }) + this.getEnums().then(() => { + if (options.id) { + this.setData({ id: Number(options.id) }) + this.getDetail() + this.getReminderConfig() + } + }) }) - if (options.id) { - this.setData({ id: Number(options.id) }) - this.getDetail() - this.getReminderConfig() + }, + onShow() { + if (typeof this.__loaded === 'undefined') { + this.__loaded = true + return } + this.getDetail() + this.getReminderConfig() }, // ========== API ========== + getEnums(): Promise { + return wx + .ajax({ + method: 'GET', + url: '?r=igg4/medical-visit/get-enums', + }) + .then((res: any) => { + if (!res) return + const medicationsMap: Record = {} + for (const item of res.medicationsUsed || []) { + medicationsMap[item.value] = item.label + } + const immunosuppressantMap: Record = {} + for (const item of res.immunosuppressantName || []) { + immunosuppressantMap[item.value] = item.label + } + const imageTypeLabels: Record = {} + for (const item of res.imageType || []) { + imageTypeLabels[item.value] = item.label + } + this.setData({ medicationsMap, immunosuppressantMap, imageTypeLabels }) + }) + }, + getDetail() { wx.ajax({ method: 'GET', @@ -62,27 +73,30 @@ Page({ data: { id: this.data.id }, }).then((res: any) => { if (!res) return + const { medicationsMap, immunosuppressantMap, imageTypeLabels } = this.data const medicationsLabel = (res.medicationsUsed || []) .map((id: number) => { if (id === 99 && res.medicationsUsedOtherText) return `其他:${res.medicationsUsedOtherText}` - return MEDICATIONS_MAP[id] + if (id === 99) return '' + return medicationsMap[id] }) .filter(Boolean) .join('、') const immunosuppressantLabel = (res.immunosuppressantName || []) .map((id: number) => { if (id === 99 && res.immunosuppressantNameOtherText) return `其他:${res.immunosuppressantNameOtherText}` - return IMMUNOSUPPRESSANT_MAP[id] + if (id === 99) return '' + return immunosuppressantMap[id] }) .filter(Boolean) .join('、') const imageGroups: { type: string; label: string; list: string[] }[] = [] const images = res.images || {} - for (const type of Object.keys(IMAGE_TYPE_LABELS)) { + for (const type of Object.keys(imageTypeLabels)) { const list = (images[type] || []).map((img: any) => img.maskedImageUrl || img.imageUrl) if (list.length) { - imageGroups.push({ type, label: IMAGE_TYPE_LABELS[type], list }) + imageGroups.push({ type, label: imageTypeLabels[type], list }) } } @@ -94,6 +108,7 @@ Page({ oralHormoneDosageMg: res.oralHormoneDosageMg, immunosuppressantLabel, imageGroups, + change: res.change, }) }) }, diff --git a/src/gift/pages/recordDetail/index.wxml b/src/gift/pages/recordDetail/index.wxml index d33ef36..bdc521f 100644 --- a/src/gift/pages/recordDetail/index.wxml +++ b/src/gift/pages/recordDetail/index.wxml @@ -18,7 +18,12 @@ 复诊提醒 - + {{item.label}} @@ -39,7 +44,15 @@ IgG4值 - {{displayIgG4Value}} mg/dL + + {{displayIgG4Value}} mg/dL + + + 本次就诊已使用的药物 diff --git a/src/gift/pages/recordList/index.scss b/src/gift/pages/recordList/index.scss index 927da7f..3a890e6 100644 --- a/src/gift/pages/recordList/index.scss +++ b/src/gift/pages/recordList/index.scss @@ -23,6 +23,7 @@ page { color: rgba(34, 34, 34, 1); .high { color: rgba(14, 182, 109, 1); + font-weight: bold; } } } @@ -105,6 +106,25 @@ page { } .w-chart { height: 380rpx; + .w-empty { + padding-top: 86rpx; + text-align: center; + .icon { + width: 152rpx; + height: 139rpx; + } + .e-title { + margin-top: 24rpx; + font-size: 32rpx; + color: rgba(34, 34, 34, 0.2); + font-weight: bold; + } + .e-content { + margin-top: 10rpx; + font-size: 28rpx; + color: rgba(34, 34, 34, 0.2); + } + } } } } diff --git a/src/gift/pages/recordList/index.ts b/src/gift/pages/recordList/index.ts index 3072446..42afd2b 100644 --- a/src/gift/pages/recordList/index.ts +++ b/src/gift/pages/recordList/index.ts @@ -2,31 +2,14 @@ import dayjs from 'dayjs' const _app = getApp() let echarts: any = null -const MEDICATIONS_MAP: Record = { - 1: '没有使用激素', - 2: '激素', - 3: '免疫抑制剂', - 4: '靶向CD19生物制剂', - 5: '靶向CD20生物制剂', - 99: '其他', -} - -const IMMUNOSUPPRESSANT_MAP: Record = { - 1: '吗替麦考酚酯', - 2: '替唑嘌呤', - 3: '环磷酰胺', - 4: '来氟米特', - 5: '甲氨蝶呤', - 6: '环孢素A', - 7: '他克莫司', - 8: '艾拉莫德', - 99: '其他', -} - Page({ data: { list: [] as any[], pagination: { count: 0, page: 1, pages: 1 }, + + // 枚举 + medicationsMap: {} as Record, + immunosuppressantMap: {} as Record, year: 0 as number, yearOptions: [ { @@ -47,6 +30,7 @@ Page({ // 图表 chartUnit: '', chartList: [] as any[], + chartEmpty: true, selected: 1, selectedLabel: '按年', @@ -59,22 +43,49 @@ Page({ echarts = mod }) _app.waitLogin().then(() => { - _app.mpBehavior({ PageName: 'PG_PatientRecordList' }) - this.getLatestRecord() - this.getList() - this.getIndicatorHistory() + _app.permissionVerification(3, 0, '/gift/pages/recordList/index').then(() => { + _app.mpBehavior({ PageName: 'PG_PatientRecordList' }) + this.getEnums().then(() => { + this.getLatestRecord() + this.getList() + this.getIndicatorHistory() + }) + }) }) }, onShow() { - if (this.data.list.length) { - this.getLatestRecord() - this.getList(true) + if (typeof this.__loaded === 'undefined') { + this.__loaded = true + return } + this.getLatestRecord() + this.getList(true) + this.getIndicatorHistory() }, // ========== API ========== + getEnums(): Promise { + return wx + .ajax({ + method: 'GET', + url: '?r=igg4/medical-visit/get-enums', + }) + .then((res: any) => { + if (!res) return + const medicationsMap: Record = {} + for (const item of res.medicationsUsed || []) { + medicationsMap[item.value] = item.label + } + const immunosuppressantMap: Record = {} + for (const item of res.immunosuppressantName || []) { + immunosuppressantMap[item.value] = item.label + } + this.setData({ medicationsMap, immunosuppressantMap }) + }) + }, + getList(reset = false) { const page = reset ? 1 : this.data.pagination.page const data: Record = { page, pageSize: 10 } @@ -87,9 +98,11 @@ Page({ if (!res) return const list = (res.list || []).map((item: any) => ({ ...item, - medicationLabels: (item.medicationsUsed || []).map((id: number) => MEDICATIONS_MAP[id]).filter(Boolean), + medicationLabels: (item.medicationsUsed || []) + .map((id: number) => this.data.medicationsMap[id]) + .filter(Boolean), immunosuppressantLabels: (item.immunosuppressantName || []) - .map((id: number) => IMMUNOSUPPRESSANT_MAP[id]) + .map((id: number) => this.data.immunosuppressantMap[id]) .filter(Boolean), statusText: item.recordStatus === 1 ? '草稿' : '已提交', })) @@ -139,11 +152,18 @@ Page({ data, }).then((res: any) => { if (!res) return + const chartList = res.list || [] + const chartEmpty = !chartList.length this.setData({ chartUnit: res.unit || 'mg/dL', - chartList: res.list || [], + chartList, + chartEmpty, + }, () => { + if (!chartEmpty) { + this.ecDataTrendComponent = null + this.initChart((chartList as []).reverse() || []) + } }) - this.initChart(res.list || []) }) }, @@ -223,7 +243,7 @@ Page({ minInterval: 1, axisLabel: { color: 'rgba(34, 34, 34, 0.40)' }, splitLine: { - show:false, + show: false, lineStyle: { color: 'rgba(34, 34, 34, 0.20)', type: 'dashed' }, }, }, diff --git a/src/gift/pages/recordList/index.wxml b/src/gift/pages/recordList/index.wxml index c19cc36..30acc95 100644 --- a/src/gift/pages/recordList/index.wxml +++ b/src/gift/pages/recordList/index.wxml @@ -9,7 +9,7 @@ {{latestIgG4}} mg/dL - + 血清IgG4趋势监测 单位{{chartUnit}} @@ -34,7 +34,12 @@ - + + + + 暂无数据 + 还没有您的记录信息哦~ + diff --git a/src/images/icon117.png b/src/images/icon117.png index edfe7147ffdbeb7a590c8abc416322bc3c754ed6..34bfb5d1eda8d3cb6a5886d0bfce45cd4452346e 100644 GIT binary patch literal 1337 zcmV-91;+Y`P))R*+d}c9eS<0|D02hCjsc4@cRE8$X)2NCl3f1O;0FkT`6uqj z;qL5^2B@j22|>XB0PE~~8=%>e0zc!wQNp{~^mcNy^Q!}zsH_NU)V1WA>O82x1}(X#t9-6al-D2Sd@j zZ2x=+38;jK`y@yS{l?7fxjTLLG+4IkrEKQN$%|hm)nEB1n4g>7p6E+ z*}rfREWs4!dDuE`$aVYp6{MswHG6P3!hC?Eg0s}PeG3)AJ^frl=!qEuUC2N%vItnY zrTkCiS8@9mCL$Q_P)14!kfIA&5ja^ru3wFa_*X*A+<|&})y^#vgxE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SR*Oid#OY&uXPy?$SGK5OiKTG!R9DxDQ z8Wp}L@C^)VcH;QuWAFsuhlTl*uZMf5qf+_GR^SNC+m8io5Y`MVU^|6Phvb*N@Qx5; zf*|37jsEk(&g-w@(g%X?YYM@%Zdh#j)2iD!{0P6?_Fcf1-U;*p% zED5n16v2*}HeF={6sF-S0voNa$L($1x#OJ@xYN6IHzM@f>YdHORyROxr`Y}V;UGL6f)vpp!D&`rAX_J|G{3aIY zO>XY%OTMU!*GDb!xvnM7Gi18SJ?D2sgKuyJo#h2~9q!}WXw;j3XE0l7*iS{^(2+-f zCV+ww$nRb*fD0&I9}(ZioH@gKUd+LDE@i>x4}Gg9i*p($RRk8zGa%pm$+Q-P?Cfb$ zfCAvAMC$6xPR1iN$TB=rGr%l><0Rt7u*FvBR<>S=V`etPEb2^5wLkA=N_2tWo9kT z+vl?O_JwU=b49?R6OWA(-&y(88s{tJ?b-HZ;Lag_)wJ=J8=>OP$~%H56jkTXwhza= zAKPI?yl8|)!o%+W0RRC1|CeZW(EtDd21!IgR09CQWJiXc8_~!B0000 - - 暂无记录 + + + + 您在 + “就诊记录” + 里上传的病历、处方、检查单、检验单、病理、超声等报告,将帮您智能分类、整理和保存在这里 + + 去记录 + diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index f637c6e..7df8bee 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -72,6 +72,7 @@ page { align-items: center; gap: 18rpx; .aside { + position: relative; padding-top: 20rpx; width: 176rpx; height: 188rpx; @@ -87,6 +88,17 @@ page { color: rgba(14, 182, 109, 1); font-weight: bold; } + .pos { + font-size: 32rpx; + color: rgba(33, 29, 46, 0.36); + } + .icon { + position: absolute; + bottom: 24rpx; + right: 16rpx; + width: 36rpx; + height: 36rpx; + } } .wrap { .title { @@ -525,7 +537,7 @@ page { bottom: calc(env(safe-area-inset-bottom) + 180rpx); width: 690rpx; height: 152rpx; - box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0,0,0,0.08); + box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.08); border-radius: 24rpx; background: linear-gradient(358deg, #ffffff 0%, #e1f4ec 100%); border: 2rpx solid #ffffff; diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index c00812a..08a50d8 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -129,11 +129,11 @@ Page({ updateNextVisitDays(userInfo: any) { if (userInfo.NextVisitDate) { const date = dayjs(userInfo.NextVisitDate) - const diffMs = Math.ceil(date.diff(dayjs()) / (24 * 60 * 60 * 1000)) + let diffMs = Math.ceil(date.diff(dayjs()) / (24 * 60 * 60 * 1000)) const weekNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] let nextVisitDays = '' if (diffMs < 0) { - nextVisitDays = '延期' + nextVisitDays = String(diffMs) } else if (diffMs === 0) { nextVisitDays = '0' } else if (diffMs > 999) { @@ -367,10 +367,8 @@ Page({ handleNextVisit() { app.mpBehavior({ PageName: 'BTN_PatientHomeNextVisit' }) const nextVisitDays = this.data.nextVisitDays - app.permissionVerification(3, 0, '').then(() => { - wx.navigateTo({ - url: nextVisitDays == '---' ? '/gift/pages/record/index' : '/gift/pages/recordList/index', - }) + wx.navigateTo({ + url: nextVisitDays == '--' ? '/gift/pages/record/index' : '/gift/pages/recordList/index', }) }, handleReg() { diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml index 72cd17a..6005ba9 100644 --- a/src/pages/index/index.wxml +++ b/src/pages/index/index.wxml @@ -21,8 +21,17 @@ class="aside" style="background: url('{{imageUrl}}{{theme === 'DRUG' ? 'bg22' : 'bg15'}}.png?t={{Timestamp}}') no-repeat top center/100%" > - {{nextVisitDays == 0 ? '今天' : nextVisitDays}} - + + 今天 + + + 待更新 + + + + {{nextVisitDays}} + + @@ -231,7 +240,11 @@ 重要提醒不丢失~ 去关注 - + diff --git a/src/pages/login/index.ts b/src/pages/login/index.ts index 8a32595..bdb6925 100644 --- a/src/pages/login/index.ts +++ b/src/pages/login/index.ts @@ -25,8 +25,7 @@ Page({ this.setData({ page: options.page, }) - app.waitLogin({ isReg: false, loginPage: true }).then(() => { - }) + app.waitLogin({ isReg: false, loginPage: true }).then(() => {}) }, onUnload() { if (timer) { diff --git a/src/pages/qaFormDetail/index.wxml b/src/pages/qaFormDetail/index.wxml index cbe639d..43e80a3 100644 --- a/src/pages/qaFormDetail/index.wxml +++ b/src/pages/qaFormDetail/index.wxml @@ -1,6 +1,6 @@ - - + + diff --git a/src/utils/tools.wxs b/src/utils/tools.wxs index 32ee3d7..b104f24 100644 --- a/src/utils/tools.wxs +++ b/src/utils/tools.wxs @@ -1,11 +1,5 @@ function include(value, arr) { - var numValue = parseInt(value) - for (var i = 0; i < arr.length; i++) { - if (arr[i] === numValue) { - return true - } - } - return false + return arr.indexOf(parseInt(value)) > -1 } function eq(a, b) {