diff --git a/api/mine/health.js b/api/mine/health.js index de4ef80..2dee896 100644 --- a/api/mine/health.js +++ b/api/mine/health.js @@ -5,7 +5,7 @@ import request from '@/utils/request'; */ export function healthDetailApi(data) { return request({ - url: '/smart-canteen/health_person_info/detail-health-info', + url: '/smart-canteen/health_person_info/detail-health-appinfo', method: 'post', data }) diff --git a/pages/mine/me/healthInformation.vue b/pages/mine/me/healthInformation.vue index 5009664..411f274 100644 --- a/pages/mine/me/healthInformation.vue +++ b/pages/mine/me/healthInformation.vue @@ -65,8 +65,19 @@ - + + + + + @@ -135,8 +146,9 @@ export default { weightControl: { options: [{ name: '减重', value: '1' }, { name: '增重', value: '2' }], title: '请选择体重控制' }, labourIntensity: { options: [{ name: '轻劳力', value: '1' }, { name: '中等强度劳动', value: '2' }, { name: '重强度劳动', value: '3' }], title: '请选择劳动强度' }, ifHospitalized: { options: [{ name: '是', value: '1' }, { name: '否', value: '2' }], title: '是否住院' }, - pregnantStatus: { options: [{ name: '保密', value: '0' },{ name: '是', value: '2' }, { name: '否', value: '1' }], title: '是否怀孕' } - }, + pregnantStatus: { options: [{ name: '保密', value: '0' },{ name: '是', value: '2' }, { name: '否', value: '1' }], title: '是否怀孕' }, + doctorAdvice: { options: [{ name: '禁食', value: '1' }, { name: '流食', value: '2' }, { name: '半流食', value: '3' }, { name: '治疗饮食', value: '4' }], title: '请选择医嘱' }, + }, chronicDiseaseOptions: [ { label: '糖尿病', value: 'diabetes' }, { label: '肾结石', value: 'kidney_stone' }, @@ -148,15 +160,16 @@ export default { weight: { type: 'number', required: true, message: '请输入体重', trigger: ['blur', 'change'] }, // labourIntensity: { type: 'string',required: true, message: '请选择劳动强度', trigger: ['change'] } }, - doctorAdvices:'暂无医嘱', + // doctorAdvices:'暂无医嘱', weightControlName: '', labourIntensityName: '', ifHospitalizedName: '', pregnantStatusName: '', + doctorAdviceName:'', chronicList:[], form: { nickName:null, - userId:null, + userId:uni.getStorageSync('userId'), orgFullName:null, userType:null, mobile:null, @@ -186,6 +199,7 @@ export default { 'form.labourIntensity': 'updateDisplayLaborIntensityName', 'form.ifHospitalized': 'updateDisplayHousingName', 'form.pregnantStatus': 'updatePregnantStatusName', + 'form.doctorAdvice': 'updateDoctorAdviceName', }, onLoad() { @@ -206,18 +220,24 @@ export default { "userId": uni.getStorageSync('userId') } const res = await healthDetailApi(param) + console.log("无信息",res); + if(res.data==null||res.data==undefined||res.data==''){ + return; + } this.form = res.data; + this.form.userId=uni.getStorageSync('userId'); + console.log("this.form",this.form) if(this.form.chronicIds){ this.form.chronicDiseases = this.form.chronicIds.split(",") - if(this.form.doctorAdvice=='1'){ - this.doctorAdvices='禁食'; - }else if(this.form.doctorAdvice=='2'){ - this.doctorAdvices='流食'; - }else if(this.form.doctorAdvice=='3'){ - this.doctorAdvices='半流食'; - }else if(this.form.doctorAdvice=='4'){ - this.doctorAdvices='治疗饮食'; - } + // if(this.form.doctorAdvice=='1'){ + // this.doctorAdvices='禁食'; + // }else if(this.form.doctorAdvice=='2'){ + // this.doctorAdvices='流食'; + // }else if(this.form.doctorAdvice=='3'){ + // this.doctorAdvices='半流食'; + // }else if(this.form.doctorAdvice=='4'){ + // this.doctorAdvices='治疗饮食'; + // } } console.log(res, '详情') }, @@ -257,9 +277,14 @@ export default { }, updateDisplayHousingName() { this.ifHospitalizedName = this.getDisplayName('ifHospitalized', this.form.ifHospitalized); + console.log("this.ifHospitalizedName",this.ifHospitalizedName); }, updatePregnantStatusName() { this.pregnantStatusName = this.getDisplayName('pregnantStatus', this.form.pregnantStatus); + }, + updateDoctorAdviceName() { + this.doctorAdviceName = this.getDisplayName('doctorAdvice', this.form.doctorAdvice); + console.log("this.doctorAdviceName",this.doctorAdviceName); }, getDisplayName(selector, value) { const options = this.selectors[selector]?.options || []; @@ -286,7 +311,7 @@ export default { } }).catch(errors => { console.error('Validation failed:', errors); - uni.$u.toast('请检查并修正错误'); + uni.$u.toast('请填写完整信息'); }); }, hideKeyboard() {