|
|
|
@ -1,10 +1,12 @@ |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
|
|
|
|
|
|
|
|
const app = getApp<IAppOption>() |
|
|
|
const app = getApp<IAppOption>() |
|
|
|
const licia = require('miniprogram-licia') |
|
|
|
const licia = require('miniprogram-licia') |
|
|
|
|
|
|
|
|
|
|
|
Page({ |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
scrollBottom: '', |
|
|
|
scrollBottom: '', |
|
|
|
|
|
|
|
submit: '', |
|
|
|
isEdit: false, |
|
|
|
isEdit: false, |
|
|
|
area: [] as string[][], |
|
|
|
area: [] as string[][], |
|
|
|
city: [] as string[][], |
|
|
|
city: [] as string[][], |
|
|
|
@ -65,6 +67,7 @@ Page({ |
|
|
|
if (options.bottom) { |
|
|
|
if (options.bottom) { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
scrollBottom: options.bottom, |
|
|
|
scrollBottom: options.bottom, |
|
|
|
|
|
|
|
submit: options.submit, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -105,7 +108,7 @@ Page({ |
|
|
|
formatUserInfo(res) { |
|
|
|
formatUserInfo(res) { |
|
|
|
this.formatBorn(res.Birth) |
|
|
|
this.formatBorn(res.Birth) |
|
|
|
this.handleChaneDiagnosisTime({ detail: { value: res.DiagnosisTime } }, false) |
|
|
|
this.handleChaneDiagnosisTime({ detail: { value: res.DiagnosisTime } }, false) |
|
|
|
const diagnoseTypeValue = this.data.DTList.findIndex((item) => item.id == res.DiagnoseType) |
|
|
|
const diagnoseTypeValue = this.data.DTList.findIndex(item => item.id == res.DiagnoseType) |
|
|
|
this.handleChangeDiagnoseType({ detail: { value: [diagnoseTypeValue] } }) |
|
|
|
this.handleChangeDiagnoseType({ detail: { value: [diagnoseTypeValue] } }) |
|
|
|
this.handleDiagnoseTypeSave(false) |
|
|
|
this.handleDiagnoseTypeSave(false) |
|
|
|
// this.handleTapRT();
|
|
|
|
// this.handleTapRT();
|
|
|
|
@ -128,13 +131,15 @@ Page({ |
|
|
|
if (!Birth) { |
|
|
|
if (!Birth) { |
|
|
|
bron = `${Birth}年` |
|
|
|
bron = `${Birth}年` |
|
|
|
age = '岁' |
|
|
|
age = '岁' |
|
|
|
} else if (Birth && Birth.split('-').length > 1) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (Birth && Birth.split('-').length > 1) { |
|
|
|
bron = `${Birth.split('-')[0]}年${Birth.split('-')[1]}月` |
|
|
|
bron = `${Birth.split('-')[0]}年${Birth.split('-')[1]}月` |
|
|
|
age = |
|
|
|
age |
|
|
|
month - Birth.split('-')[1] >= 0 |
|
|
|
= month - Birth.split('-')[1] >= 0 |
|
|
|
? `${year - Birth.split('-')[0]}岁${month - Birth.split('-')[1]}个月` |
|
|
|
? `${year - Birth.split('-')[0]}岁${month - Birth.split('-')[1]}个月` |
|
|
|
: `${year - Birth.split('-')[0] - 1}岁${12 - Birth.split('-')[1] + month}个月` |
|
|
|
: `${year - Birth.split('-')[0] - 1}岁${12 - Birth.split('-')[1] + month}个月` |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
bron = `${Birth}年` |
|
|
|
bron = `${Birth}年` |
|
|
|
age = `${year - Birth}岁` |
|
|
|
age = `${year - Birth}岁` |
|
|
|
} |
|
|
|
} |
|
|
|
@ -155,7 +160,7 @@ Page({ |
|
|
|
handleChaneDiagnosisTime(e, update = true) { |
|
|
|
handleChaneDiagnosisTime(e, update = true) { |
|
|
|
const DiagnosisTime = e.detail.value |
|
|
|
const DiagnosisTime = e.detail.value |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
DiagnosisTime: dayjs(DiagnosisTime).format('YYYY年MM月'), |
|
|
|
'DiagnosisTime': dayjs(DiagnosisTime).format('YYYY年MM月'), |
|
|
|
'zdUserInfo.DiagnosisTime': DiagnosisTime, |
|
|
|
'zdUserInfo.DiagnosisTime': DiagnosisTime, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo(update) |
|
|
|
this.updateUserInfo(update) |
|
|
|
@ -171,7 +176,7 @@ Page({ |
|
|
|
const value = e.detail.value |
|
|
|
const value = e.detail.value |
|
|
|
const id = this.data.RTList.filter((_item, index) => index == value)[0]?.id |
|
|
|
const id = this.data.RTList.filter((_item, index) => index == value)[0]?.id |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
rtValue: value, |
|
|
|
'rtValue': value, |
|
|
|
'zdUserInfo.RelationType': id, |
|
|
|
'zdUserInfo.RelationType': id, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo(update) |
|
|
|
this.updateUserInfo(update) |
|
|
|
@ -180,7 +185,7 @@ Page({ |
|
|
|
const value = e.detail.value |
|
|
|
const value = e.detail.value |
|
|
|
const id = this.data.GenderList.filter((_item, index) => index == value)[0]?.id |
|
|
|
const id = this.data.GenderList.filter((_item, index) => index == value)[0]?.id |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
genderValue: value, |
|
|
|
'genderValue': value, |
|
|
|
'zdUserInfo.Gender': id, |
|
|
|
'zdUserInfo.Gender': id, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo(update) |
|
|
|
this.updateUserInfo(update) |
|
|
|
@ -189,7 +194,7 @@ Page({ |
|
|
|
const value = e.detail.value |
|
|
|
const value = e.detail.value |
|
|
|
const id = this.data.dict.AgeRange.filter((_item, index) => index == value)[0]?.id |
|
|
|
const id = this.data.dict.AgeRange.filter((_item, index) => index == value)[0]?.id |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
ageRangeValue: value, |
|
|
|
'ageRangeValue': value, |
|
|
|
'zdUserInfo.AgeRange': id, |
|
|
|
'zdUserInfo.AgeRange': id, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo(update) |
|
|
|
this.updateUserInfo(update) |
|
|
|
@ -198,7 +203,7 @@ Page({ |
|
|
|
const rangeIndex = this.data.selectDiagnoseTypeIndex |
|
|
|
const rangeIndex = this.data.selectDiagnoseTypeIndex |
|
|
|
const id = this.data.DTList.filter((_item, index) => index == rangeIndex)[0]?.id |
|
|
|
const id = this.data.DTList.filter((_item, index) => index == rangeIndex)[0]?.id |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
diagnoseTypeValue: rangeIndex, |
|
|
|
'diagnoseTypeValue': rangeIndex, |
|
|
|
'zdUserInfo.DiagnoseType': id, |
|
|
|
'zdUserInfo.DiagnoseType': id, |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (update) { |
|
|
|
if (update) { |
|
|
|
@ -233,9 +238,10 @@ Page({ |
|
|
|
this.updateUserInfo() |
|
|
|
this.updateUserInfo() |
|
|
|
}, |
|
|
|
}, |
|
|
|
updateUserInfo(update = true) { |
|
|
|
updateUserInfo(update = true) { |
|
|
|
if (!update) return |
|
|
|
if (!update) |
|
|
|
const { PatientName, RelationType, Gender, Birth, DiagnosisTime, DiagnoseType, ...zdUserInfo } = |
|
|
|
return |
|
|
|
this.data.zdUserInfo |
|
|
|
const { PatientName, RelationType, Gender, Birth, DiagnosisTime, DiagnoseType, ...zdUserInfo } |
|
|
|
|
|
|
|
= this.data.zdUserInfo |
|
|
|
wx.ajax({ |
|
|
|
wx.ajax({ |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
url: '?r=zd/account/update-info', |
|
|
|
url: '?r=zd/account/update-info', |
|
|
|
@ -290,8 +296,8 @@ Page({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
handlePopupOk() { |
|
|
|
handlePopupOk() { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
popupShow: false, |
|
|
|
'popupShow': false, |
|
|
|
popupType: '', |
|
|
|
'popupType': '', |
|
|
|
'zdUserInfo.prescriptionImg': '', |
|
|
|
'zdUserInfo.prescriptionImg': '', |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.updateUserInfo() |
|
|
|
this.updateUserInfo() |
|
|
|
|