From 5161f11dd32f242893a53eb5c3158171a74ba329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=93=A5?= <17630302050@163.com> Date: Tue, 10 Jun 2025 00:21:13 +0800 Subject: [PATCH] dsds --- app.less | 9 ++ pages/mmp-7/index.wxml | 186 +--------------------------------- pages/my/index.wxml | 7 +- pages/my/info-edit/index.js | 143 ++++++++++++++++++++++---- pages/my/info-edit/index.less | 12 ++- pages/my/info-edit/index.wxml | 59 +++++++++-- utils/encrypt.js | 7 -- 7 files changed, 198 insertions(+), 225 deletions(-) delete mode 100644 utils/encrypt.js diff --git a/app.less b/app.less index 2804106..9d4b651 100644 --- a/app.less +++ b/app.less @@ -2,6 +2,15 @@ page { background-color: #f3f3f3; --td-brand-color: #0091cc; // 任何你想要的主题色 + font-size: 28rpx; + + .t-cell__title-text { + font-size: 28rpx; + } + .t-input__control { + font-size: 28rpx; + } + } .page { diff --git a/pages/mmp-7/index.wxml b/pages/mmp-7/index.wxml index 5157a8c..1b712ac 100644 --- a/pages/mmp-7/index.wxml +++ b/pages/mmp-7/index.wxml @@ -11,7 +11,7 @@ - + 门静脉左右分支 @@ -36,190 +36,12 @@ - - - - - 血小板(10^9/L) - - - - - - - - - 血红蛋白(g/L) - - - - - - - - 白细胞(10^9/L) - - - - - - - - - - - 营养指标 - - - - 上传营养指标检查报告(支持OCR识别) - - - - - - - - - 25(OH)D3 (ng/ml) - - - - - - - - - 维生素A (ng/ml) - - - - - - - - 维生素K (ng/ml) - - - - - - - - - 维生素E (ng/ml) - - - - - - - - - - B超 - - - - 上传B超报告(支持OCR识别) - - - - - - - - - 肝肋下(mm)肝肋下(mm) - - - - - - - - - 肝剑突下(mm) - - - - - - - - 脾肋下(mm) - - - - - - - - - 门静脉主干(mm) - - - - - - - - - 门静脉流速 - - - - - - - - - 肝弹性值 - - - - - - - - 有无肝囊肿 - - - - - - - - - - - - 有无腹水 - - - - - - - - - - - - - MDT电子病历 - - - - 上传本次随访的电子病历 - - - + + + 提交 - - \ No newline at end of file diff --git a/pages/my/index.wxml b/pages/my/index.wxml index 780df7d..db0f352 100644 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -13,9 +13,10 @@ 胆道闭锁手术时间:{{personalInfo.operative_date}} PELD评分:{{personalInfo.risk_value}} - 低危 - 中危 - 高危 + 低危 + 中危 + 高危 + diff --git a/pages/my/info-edit/index.js b/pages/my/info-edit/index.js index 93d54c2..70d2fb6 100644 --- a/pages/my/info-edit/index.js +++ b/pages/my/info-edit/index.js @@ -1,5 +1,8 @@ import request from '~/api/request'; +let mode = '' +let modeText = '' + Page({ data: { personInfo: { @@ -8,7 +11,14 @@ Page({ id_number: '', birthday: '', operative_date: '', - + delivery_type: '', + prenatal_check_type: '', + gestational_week: '', + conception_type: '', + birth_number: '', + parity_number: '', + birth_weight: '', + prenatal_check_remark: '' }, genderOptions: [ { @@ -47,9 +57,27 @@ Page({ width: 160, height: 160, }, - - defaultTime: '', - newTime: '', + timeValue: '', + timePicker:new Date().toISOString().split('T')[0], + idError: false, + numberError: false, + weekError: false, + numberFormat: (v) => { + const isNumber = /^\d+(\.\d+)?$/.test(v); + if (isNumber) { + return parseFloat(v).toFixed(2); + } + return v; + }, + // 下拉 + selectList: [], + selectValue: '', + selectVisible: false, + deliveryList:[{label: '顺产', value: 1},{label: '剖腹产', value: 2}], + prenatal_checkList: [{label: '有', value: 1},{label: '无', value: 2}], + parity_numberList: [{label: '1胎', value: 1},{label: '2胎', value: 2},{label: '3胎', value: 3},{label: '大于等于4胎', value: 4}], + birth_numberList:[{label: '1产', value: 1},{label: '2产', value: 2},{label: '大于等于3产', value: 3}], + conception_typeList: [{label: '自然受孕', value: 1},{label: '辅助生殖技术', value: 2}] }, onLoad() { @@ -63,8 +91,16 @@ Page({ username: info.username, sex: info.sex, id_number: info.id_number, - birthday: info.birthday, + birthday: info.birthday || '', operative_date: info.operative_date, + delivery_type: info.delivery_type, + prenatal_check_type: info.prenatal_check_type, + gestational_week: info.gestational_week, + conception_type: info.conception_type, + birth_number: info.birth_number, + parity_number: info.parity_number, + birth_weight: info.birth_weight, + prenatal_check_remark: info.prenatal_check_remark } }) }, @@ -100,13 +136,19 @@ Page({ }, showPicker(e) { - console.log(e) - const { mode } = e.currentTarget.dataset; - this.setData({ - birthVisible: true, - defaultTime: e.detail.value, - newTime: e.detail.value, - }); + mode = e.currentTarget.dataset.mode; + if(mode == "birth"){ + this.setData({ + birthVisible: true, + timePicker: this.data.personInfo.birthday ? this.data.personInfo.birthday : new Date().toISOString().split('T')[0] + }); + } else { + this.setData({ + birthVisible: true, + timePicker: this.data.personInfo.operative_date ? this.data.personInfo.operative_date : new Date().toISOString().split('T')[0] + }); + } + }, @@ -119,16 +161,17 @@ Page({ onPickerChange(e) { const { value, label } = e.detail; - const { mode } = e.currentTarget.dataset; - - this.setData({ - [`personInfo.${mode}`]: value, - }); - if (mode === 'address') { + console.log(mode, mode == 'birth') + if(mode == 'birth'){ this.setData({ - addressText: label.join(' '), - }); + ['personInfo.birthday']: value + }) + }else{ + this.setData({ + ['personInfo.operative_date']:value + }) } + }, personInfoFieldChange(field, e) { @@ -139,7 +182,7 @@ Page({ }, onNameChange(e) { - this.personInfoFieldChange('name', e); + this.personInfoFieldChange('username', e); }, onGenderChange(e) { @@ -184,4 +227,62 @@ Page({ }) wx.navigateBack() }, + onIdInput(e){ + // 18位身份证正则 + const { idError } = this.data; + const reg18 = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/.test(e.detail.value); + if (idError == reg18) { + this.setData({ + idError: !reg18, + }); + } + this.personInfoFieldChange('id_number', e); + }, + onWeightInput(e){ + const { numberError } = this.data; + const isNumber = /^\d+(\.\d+)?$/.test(e.detail.value); + if (numberError === isNumber) { + this.setData({ + numberError: !isNumber, + }); + } + this.personInfoFieldChange('birth_weight', e); + }, + onWeekInput(e){ + const { weekError } = this.data; + const isNumber = /^\d+(\.\d+)?$/.test(e.detail.value); + if (weekError === isNumber) { + this.setData({ + weekError: !isNumber, + }); + } + this.personInfoFieldChange('gestational_week', e); + }, + showSelect(e){ + const { mode, list } = e.currentTarget.dataset; + modeText = mode + this.setData({ + selectVisible: true, + selectValue: this.data.personInfo[mode] ? this.data.personInfo[mode] : '', + selectList: list + }) + }, + onSelectChange(e){ + const { value, label } = e.detail; + this.setData({ + [`personInfo.${modeText}`]: value[0] + }) + }, + + + onSaveInfo(){ + console.log(this.data.personInfo) + let obj = this.data.personInfo + obj.birth_weight = Number(obj.birth_weight) + obj.gestational_week = Number(obj.gestational_week) + if( obj.prenatal_check_type == 2){ + obj.prenatal_check_remark = '无' + } + request('patient/set_personal_information', 'post', obj) + } }); diff --git a/pages/my/info-edit/index.less b/pages/my/info-edit/index.less index 1edfe78..122fb18 100644 --- a/pages/my/info-edit/index.less +++ b/pages/my/info-edit/index.less @@ -31,12 +31,16 @@ page { } .info-edit__save { - position: fixed; - left: 32rpx; - right: 32rpx; - bottom: calc(env(safe-area-inset-bottom) + 32rpx); + padding: 28rpx; + // position: fixed; + // left: 32rpx; + // right: 32rpx; + // bottom: calc(env(safe-area-inset-bottom) + 32rpx); } .info-edit__gender { width: 45%; } +.t-textarea{ + height: 140rpx; +} \ No newline at end of file diff --git a/pages/my/info-edit/index.wxml b/pages/my/info-edit/index.wxml index 5684f5f..b9b91ba 100644 --- a/pages/my/info-edit/index.wxml +++ b/pages/my/info-edit/index.wxml @@ -1,7 +1,7 @@ - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -37,7 +67,7 @@ cancelBtn="取消" confirmBtn="确认" data-mode="birth" - defaultValue="{{defaultTime}}" + defaultValue="{{timePicker}}" end="{{birthEnd}}" filter="{{birthFilter}}" format="YYYY-MM-DD" @@ -45,7 +75,20 @@ popup-props="{{ { usingCustomNavbar: true } }}" start="{{birthStart}}" title="选择生日" - value="{{newTime}}" + value="{{timeValue}}" visible="{{birthVisible}}" /> + + + + \ No newline at end of file diff --git a/utils/encrypt.js b/utils/encrypt.js deleted file mode 100644 index 1600c17..0000000 --- a/utils/encrypt.js +++ /dev/null @@ -1,7 +0,0 @@ -const crypto = require('crypto-js'); - -function md5Encrypt(password) { - return crypto.MD5(password).toString(); -} - -module.exports = { md5Encrypt }; \ No newline at end of file