|
|
|
@ -44,8 +44,6 @@ Page({ |
|
|
|
|
|
|
|
|
|
|
|
dict: {} as any, |
|
|
|
dict: {} as any, |
|
|
|
|
|
|
|
|
|
|
|
DiagnosisTime: '', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HasTedSurgery: '', |
|
|
|
HasTedSurgery: '', |
|
|
|
IsGraves: '', |
|
|
|
IsGraves: '', |
|
|
|
|
|
|
|
|
|
|
|
@ -87,8 +85,7 @@ Page({ |
|
|
|
|
|
|
|
|
|
|
|
app.waitLogin({ type: [1] }).then(() => { |
|
|
|
app.waitLogin({ type: [1] }).then(() => { |
|
|
|
app.mpBehavior({ PageName: 'PG_PatientPersonalInfo' }) |
|
|
|
app.mpBehavior({ PageName: 'PG_PatientPersonalInfo' }) |
|
|
|
const that = this |
|
|
|
app.getZdUserInfo(null, true, this.formatUserInfo.bind(this)) |
|
|
|
app.getZdUserInfo(that, true, that.formatUserInfo.bind(that)) |
|
|
|
|
|
|
|
this.getDict() |
|
|
|
this.getDict() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -106,12 +103,19 @@ Page({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
formatUserInfo(res) { |
|
|
|
formatUserInfo(res) { |
|
|
|
|
|
|
|
const arrTituyo = res.tituyo |
|
|
|
|
|
|
|
if (Array.isArray(arrTituyo)) { |
|
|
|
|
|
|
|
const tituyo = {} |
|
|
|
|
|
|
|
arrTituyo.forEach((item) => { |
|
|
|
|
|
|
|
tituyo[item] = true |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
res.tituyo = tituyo |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
zdUserInfo: res, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.formatBorn(res.Birth) |
|
|
|
this.formatBorn(res.Birth) |
|
|
|
this.handleChaneDiagnosisTime({ detail: { value: res.DiagnosisTime } }, false) |
|
|
|
|
|
|
|
const diagnoseTypeValue = this.data.DTList.findIndex(item => item.id == res.DiagnoseType) |
|
|
|
|
|
|
|
this.handleChangeDiagnoseType({ detail: { value: [diagnoseTypeValue] } }) |
|
|
|
|
|
|
|
this.handleDiagnoseTypeSave(false) |
|
|
|
|
|
|
|
// this.handleTapRT();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.data.scrollBottom) { |
|
|
|
if (this.data.scrollBottom) { |
|
|
|
wx.pageScrollTo({ |
|
|
|
wx.pageScrollTo({ |
|
|
|
@ -157,14 +161,6 @@ Page({ |
|
|
|
this.formatBorn(Birth) |
|
|
|
this.formatBorn(Birth) |
|
|
|
this.updateUserInfo() |
|
|
|
this.updateUserInfo() |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleChaneDiagnosisTime(e, update = true) { |
|
|
|
|
|
|
|
const DiagnosisTime = e.detail.value |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
'DiagnosisTime': dayjs(DiagnosisTime).format('YYYY年MM月'), |
|
|
|
|
|
|
|
'zdUserInfo.DiagnosisTime': DiagnosisTime, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.updateUserInfo(update) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleInput(e) { |
|
|
|
handleInput(e) { |
|
|
|
const { key } = e.currentTarget.dataset |
|
|
|
const { key } = e.currentTarget.dataset |
|
|
|
@ -172,76 +168,26 @@ Page({ |
|
|
|
[`zdUserInfo.${key}`]: e.detail.value, |
|
|
|
[`zdUserInfo.${key}`]: e.detail.value, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleChangeRT(e, update = true) { |
|
|
|
handleRedioSelect(e) { |
|
|
|
const value = e.detail.value |
|
|
|
const { key, id } = e.currentTarget.dataset |
|
|
|
const id = this.data.RTList.filter((_item, index) => index == value)[0]?.id |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
'rtValue': value, |
|
|
|
|
|
|
|
'zdUserInfo.RelationType': id, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.updateUserInfo(update) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeGender(e, update = true) { |
|
|
|
|
|
|
|
const value = e.detail.value |
|
|
|
|
|
|
|
const id = this.data.GenderList.filter((_item, index) => index == value)[0]?.id |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
'genderValue': value, |
|
|
|
|
|
|
|
'zdUserInfo.Gender': id, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.updateUserInfo(update) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeAgeRange(e, update = true) { |
|
|
|
|
|
|
|
const value = e.detail.value |
|
|
|
|
|
|
|
const id = this.data.dict.AgeRange.filter((_item, index) => index == value)[0]?.id |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
'ageRangeValue': value, |
|
|
|
|
|
|
|
'zdUserInfo.AgeRange': id, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.updateUserInfo(update) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleDiagnoseTypeSave(update = true) { |
|
|
|
|
|
|
|
const rangeIndex = this.data.selectDiagnoseTypeIndex |
|
|
|
|
|
|
|
const id = this.data.DTList.filter((_item, index) => index == rangeIndex)[0]?.id |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
'diagnoseTypeValue': rangeIndex, |
|
|
|
|
|
|
|
'zdUserInfo.DiagnoseType': id, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if (update) { |
|
|
|
|
|
|
|
this.handleDiagnoseTypeShow() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.updateUserInfo(update) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleRadio(e) { |
|
|
|
|
|
|
|
const { id, key } = e.currentTarget.dataset |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
[`zdUserInfo.${key}`]: id, |
|
|
|
[`zdUserInfo.${key}`]: id, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo(true) |
|
|
|
this.updateUserInfo() |
|
|
|
}, |
|
|
|
|
|
|
|
handleDiagnoseTypeShow() { |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
diagnoseTypeShow: !this.data.diagnoseTypeShow, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeDiagnoseType(e) { |
|
|
|
|
|
|
|
const value = e.detail.value[0] |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
selectDiagnoseTypeIndex: value, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRedioSelect(e) { |
|
|
|
handleCheckSelect(e) { |
|
|
|
const { key, id } = e.currentTarget.dataset |
|
|
|
const { key, id } = e.currentTarget.dataset |
|
|
|
|
|
|
|
const zdUserInfo = this.data.zdUserInfo |
|
|
|
|
|
|
|
zdUserInfo[key][id] = !zdUserInfo[key][id] |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
[`zdUserInfo.${key}`]: id, |
|
|
|
zdUserInfo, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo() |
|
|
|
this.updateUserInfo() |
|
|
|
}, |
|
|
|
}, |
|
|
|
updateUserInfo(update = true) { |
|
|
|
updateUserInfo(update = true) { |
|
|
|
if (!update) |
|
|
|
if (!update) |
|
|
|
return |
|
|
|
return |
|
|
|
const { PatientName, RelationType, Gender, Birth, DiagnosisTime, DiagnoseType, ...zdUserInfo } |
|
|
|
const { PatientName, RelationType, Gender, Birth, DiagnoseType, ...zdUserInfo } = this.data.zdUserInfo |
|
|
|
= this.data.zdUserInfo |
|
|
|
|
|
|
|
wx.ajax({ |
|
|
|
wx.ajax({ |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
url: '?r=zd/account/update-info', |
|
|
|
url: '?r=zd/account/update-info', |
|
|
|
@ -250,7 +196,6 @@ Page({ |
|
|
|
relationType: RelationType, |
|
|
|
relationType: RelationType, |
|
|
|
gender: Gender, |
|
|
|
gender: Gender, |
|
|
|
birth: Birth, |
|
|
|
birth: Birth, |
|
|
|
diagnosisTime: DiagnosisTime, |
|
|
|
|
|
|
|
diagnoseType: DiagnoseType, |
|
|
|
diagnoseType: DiagnoseType, |
|
|
|
ageRange: zdUserInfo.AgeRange, |
|
|
|
ageRange: zdUserInfo.AgeRange, |
|
|
|
patientCanFollowUp: zdUserInfo.PatientCanFollowUp, |
|
|
|
patientCanFollowUp: zdUserInfo.PatientCanFollowUp, |
|
|
|
@ -261,7 +206,11 @@ Page({ |
|
|
|
medicalInsuranceType: zdUserInfo.MedicalInsuranceType, |
|
|
|
medicalInsuranceType: zdUserInfo.MedicalInsuranceType, |
|
|
|
isKnowTituyo: zdUserInfo.IsKnowTituyo, |
|
|
|
isKnowTituyo: zdUserInfo.IsKnowTituyo, |
|
|
|
isUseTituyo: zdUserInfo.IsUseTituyo, |
|
|
|
isUseTituyo: zdUserInfo.IsUseTituyo, |
|
|
|
|
|
|
|
diseaseStage: zdUserInfo.DiseaseStage, |
|
|
|
|
|
|
|
diseasePeriod: zdUserInfo.DiseasePeriod, |
|
|
|
...zdUserInfo, |
|
|
|
...zdUserInfo, |
|
|
|
|
|
|
|
tituyo: Object.keys(zdUserInfo.tituyo).filter(item => zdUserInfo.tituyo[item]), |
|
|
|
|
|
|
|
prescriptionImg: zdUserInfo.PrescriptionImg, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then((_res) => { |
|
|
|
.then((_res) => { |
|
|
|
@ -269,14 +218,14 @@ Page({ |
|
|
|
title: '修改成功', |
|
|
|
title: '修改成功', |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
}) |
|
|
|
}) |
|
|
|
app.getZdUserInfo(this, true, this.formatUserInfo.bind(this)) |
|
|
|
app.getZdUserInfo(null, true, this.formatUserInfo.bind(this)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
.catch((err) => { |
|
|
|
wx.showToast({ |
|
|
|
wx.showToast({ |
|
|
|
title: err.data.msg, |
|
|
|
title: err.data.msg, |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
}) |
|
|
|
}) |
|
|
|
app.getZdUserInfo(this, true, this.formatUserInfo.bind(this)) |
|
|
|
app.getZdUserInfo(null, true, this.formatUserInfo.bind(this)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleNoUpload() { |
|
|
|
handleNoUpload() { |
|
|
|
@ -284,7 +233,7 @@ Page({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSetData(e) { |
|
|
|
handleSetData(e) { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
'zdUserInfo.prescriptionImg': e.detail.imgUrl, |
|
|
|
'zdUserInfo.PrescriptionImg': e.detail.imgUrl, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo() |
|
|
|
this.updateUserInfo() |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -298,7 +247,7 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
'popupShow': false, |
|
|
|
'popupShow': false, |
|
|
|
'popupType': '', |
|
|
|
'popupType': '', |
|
|
|
'zdUserInfo.prescriptionImg': '', |
|
|
|
'zdUserInfo.PrescriptionImg': '', |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo() |
|
|
|
this.updateUserInfo() |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -308,17 +257,6 @@ Page({ |
|
|
|
popupType: '', |
|
|
|
popupType: '', |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleChangeTel() { |
|
|
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
|
|
url: '/patient/pages/changePhone/index', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeUser() { |
|
|
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
|
|
url: '/patient/pages/changeUser/index', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleLogout() { |
|
|
|
handleLogout() { |
|
|
|
app.mpBehavior({ PageName: 'BTN_PatientPersonalInfoCancel' }) |
|
|
|
app.mpBehavior({ PageName: 'BTN_PatientPersonalInfoCancel' }) |
|
|
|
wx.navigateTo({ |
|
|
|
wx.navigateTo({ |
|
|
|
|