|
|
@ -1,4 +1,4 @@ |
|
|
|
const app = getApp<IAppOption>() |
|
|
|
const app = getApp<IAppOption>(); |
|
|
|
|
|
|
|
|
|
|
|
Page({ |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
data: { |
|
|
@ -208,15 +208,15 @@ Page({ |
|
|
|
icon: '9', |
|
|
|
icon: '9', |
|
|
|
}, |
|
|
|
}, |
|
|
|
] as { |
|
|
|
] as { |
|
|
|
title: string |
|
|
|
title: string; |
|
|
|
key: string |
|
|
|
key: string; |
|
|
|
icon: string |
|
|
|
icon: string; |
|
|
|
type: string |
|
|
|
type: string; |
|
|
|
list: { |
|
|
|
list: { |
|
|
|
id: string |
|
|
|
id: string; |
|
|
|
title: string |
|
|
|
title: string; |
|
|
|
active?: boolean |
|
|
|
active?: boolean; |
|
|
|
}[] |
|
|
|
}[]; |
|
|
|
}[], |
|
|
|
}[], |
|
|
|
params: {}, |
|
|
|
params: {}, |
|
|
|
|
|
|
|
|
|
|
@ -226,115 +226,115 @@ Page({ |
|
|
|
focus: false, |
|
|
|
focus: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
onLoad(options) { |
|
|
|
const SystemInfo = app.globalSystemInfo |
|
|
|
const SystemInfo = app.globalSystemInfo; |
|
|
|
if (SystemInfo) { |
|
|
|
if (SystemInfo) { |
|
|
|
const { bottom } = SystemInfo.capsulePosition |
|
|
|
const { bottom } = SystemInfo.capsulePosition; |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
bottom, |
|
|
|
bottom, |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
m_d: options.m_d, |
|
|
|
m_d: options.m_d, |
|
|
|
nrdl: options.nrdl, |
|
|
|
nrdl: options.nrdl, |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
app.zdWaitLogin({ isReg: false }).then(() => { |
|
|
|
app.waitLogin({ type: [0, 1] }).then(() => { |
|
|
|
this.handleMp(this.data.nav) |
|
|
|
this.handleMp(this.data.nav); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelect(e) { |
|
|
|
handleSelect(e) { |
|
|
|
const { index } = e.currentTarget.dataset |
|
|
|
const { index } = e.currentTarget.dataset; |
|
|
|
const { nav, question } = this.data |
|
|
|
const { nav, question } = this.data; |
|
|
|
const questionItem = question[nav] |
|
|
|
const questionItem = question[nav]; |
|
|
|
questionItem.list = questionItem.list.map((item, i) => { |
|
|
|
questionItem.list = questionItem.list.map((item, i) => { |
|
|
|
if (index == i) { |
|
|
|
if (index == i) { |
|
|
|
item.active = true |
|
|
|
item.active = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
item.active = false |
|
|
|
item.active = false; |
|
|
|
} |
|
|
|
} |
|
|
|
return item |
|
|
|
return item; |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
[`question[${nav}]`]: questionItem, |
|
|
|
[`question[${nav}]`]: questionItem, |
|
|
|
}) |
|
|
|
}); |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
nav: nav == 8 ? 8 : nav + 1, |
|
|
|
nav: nav == 8 ? 8 : nav + 1, |
|
|
|
showSubmit: nav == 8, |
|
|
|
showSubmit: nav == 8, |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.handleMp(this.data.nav) |
|
|
|
this.handleMp(this.data.nav); |
|
|
|
}, 500) |
|
|
|
}, 500); |
|
|
|
}, |
|
|
|
}, |
|
|
|
stopTouchMove() { |
|
|
|
stopTouchMove() { |
|
|
|
return false |
|
|
|
return false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
bindtransition() { |
|
|
|
bindtransition() { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
nav: this.data.nav, |
|
|
|
nav: this.data.nav, |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handlePrev() { |
|
|
|
handlePrev() { |
|
|
|
const { nav } = this.data |
|
|
|
const { nav } = this.data; |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
nav: nav - 1, |
|
|
|
nav: nav - 1, |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSubmit() { |
|
|
|
handleSubmit() { |
|
|
|
app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTQ9COMPLETE' }) |
|
|
|
app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTQ9COMPLETE' }); |
|
|
|
wx.showLoading({ |
|
|
|
wx.showLoading({ |
|
|
|
title: '提交中', |
|
|
|
title: '提交中', |
|
|
|
}) |
|
|
|
}); |
|
|
|
const { question } = this.data |
|
|
|
const { question } = this.data; |
|
|
|
const params = {} |
|
|
|
const params = {}; |
|
|
|
question.forEach((item) => { |
|
|
|
question.forEach((item) => { |
|
|
|
if (item.type === 'intenseDose') { |
|
|
|
if (item.type === 'intenseDose') { |
|
|
|
params[item.key] = this.data[item.key] |
|
|
|
params[item.key] = this.data[item.key]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
params[item.key] = item.list.findIndex((subItem) => subItem.active) |
|
|
|
params[item.key] = item.list.findIndex((subItem) => subItem.active); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
params, |
|
|
|
params, |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleFinish(e) { |
|
|
|
handleFinish(e) { |
|
|
|
const that = this |
|
|
|
const that = this; |
|
|
|
const url = `${app.globalData.upFileUrl}?r=file-service/upload-img` |
|
|
|
const url = `${app.globalData.upFileUrl}?r=file-service/upload-img`; |
|
|
|
wx.uploadFile({ |
|
|
|
wx.uploadFile({ |
|
|
|
filePath: e.detail, |
|
|
|
filePath: e.detail, |
|
|
|
name: 'file', |
|
|
|
name: 'file', |
|
|
|
url, |
|
|
|
url, |
|
|
|
success(res) { |
|
|
|
success(res) { |
|
|
|
const data = JSON.parse(res.data) |
|
|
|
const data = JSON.parse(res.data); |
|
|
|
that.submitCreate(data.data.Url) |
|
|
|
that.submitCreate(data.data.Url); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleHorSelect(e) { |
|
|
|
handleHorSelect(e) { |
|
|
|
const { id } = e.currentTarget.dataset |
|
|
|
const { id } = e.currentTarget.dataset; |
|
|
|
const { SteroidDailyDose } = this.data |
|
|
|
const { SteroidDailyDose } = this.data; |
|
|
|
if (!id) { |
|
|
|
if (!id) { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
popupHormone: SteroidDailyDose > 0 ? SteroidDailyDose : '', |
|
|
|
popupHormone: SteroidDailyDose > 0 ? SteroidDailyDose : '', |
|
|
|
popupShow: true, |
|
|
|
popupShow: true, |
|
|
|
}) |
|
|
|
}); |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
popupFocus: true, |
|
|
|
popupFocus: true, |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, 300) |
|
|
|
}, 300); |
|
|
|
return |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
SteroidDailyDose: id * 1, |
|
|
|
SteroidDailyDose: id * 1, |
|
|
|
showSubmit: Boolean(id), |
|
|
|
showSubmit: Boolean(id), |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handlePopupCancel() { |
|
|
|
handlePopupCancel() { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
popupShow: false, |
|
|
|
popupShow: false, |
|
|
|
popupFocus: false, |
|
|
|
popupFocus: false, |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handlePopupSure() { |
|
|
|
handlePopupSure() { |
|
|
|
// if (!Number(this.data.popupHormone)) {
|
|
|
|
// if (!Number(this.data.popupHormone)) {
|
|
|
@ -347,21 +347,21 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
SteroidDailyDose: Number(this.data.popupHormone), |
|
|
|
SteroidDailyDose: Number(this.data.popupHormone), |
|
|
|
showSubmit: true, |
|
|
|
showSubmit: true, |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.handlePopupCancel() |
|
|
|
this.handlePopupCancel(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
submitCreate(Url) { |
|
|
|
submitCreate(Url) { |
|
|
|
const params = this.data.params |
|
|
|
const params = this.data.params; |
|
|
|
wx.ajax({ |
|
|
|
wx.ajax({ |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
url: '?r=zd/adl/create', |
|
|
|
url: '?r=zd/adl/create', |
|
|
|
data: params, |
|
|
|
data: params, |
|
|
|
}).then((res) => { |
|
|
|
}).then((res) => { |
|
|
|
this.updateAdlImg(res.Id, Url, res) |
|
|
|
this.updateAdlImg(res.Id, Url, res); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
updateAdlImg(id, Url, params) { |
|
|
|
updateAdlImg(id, Url, params) { |
|
|
|
const { m_d, nrdl } = this.data |
|
|
|
const { m_d, nrdl } = this.data; |
|
|
|
wx.ajax({ |
|
|
|
wx.ajax({ |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
url: '?r=zd/adl/update-img', |
|
|
|
url: '?r=zd/adl/update-img', |
|
|
@ -370,29 +370,29 @@ Page({ |
|
|
|
ImgUrl: Url, |
|
|
|
ImgUrl: Url, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
wx.hideLoading() |
|
|
|
wx.hideLoading(); |
|
|
|
wx.setStorageSync('adlResultInfo', params.ScoreInfo) |
|
|
|
wx.setStorageSync('adlResultInfo', params.ScoreInfo); |
|
|
|
wx.redirectTo({ |
|
|
|
wx.redirectTo({ |
|
|
|
url: `/patient/pages/adlResult/index?id=${id}&reset=1&m_d=${m_d}&nrdl=${nrdl}&wy=${Number(params.sendWeiYi)}&idafa=${Number(params.inviteDoctorAndFirstAdl)}`, |
|
|
|
url: `/patient/pages/adlResult/index?id=${id}&reset=1&m_d=${m_d}&nrdl=${nrdl}&wy=${Number(params.sendWeiYi)}&idafa=${Number(params.inviteDoctorAndFirstAdl)}`, |
|
|
|
}) |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleInput(e) { |
|
|
|
handleInput(e) { |
|
|
|
if (e.detail.value) { |
|
|
|
if (e.detail.value) { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
// eslint-disable-next-line regexp/optimal-quantifier-concatenation
|
|
|
|
// eslint-disable-next-line regexp/optimal-quantifier-concatenation
|
|
|
|
popupHormone: e.detail.value.replace(/^(-)?(\d{0,3})(\.\d?)?.*$/, '$1$2$3'), |
|
|
|
popupHormone: e.detail.value.replace(/^(-)?(\d{0,3})(\.\d?)?.*$/, '$1$2$3'), |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleBack() { |
|
|
|
handleBack() { |
|
|
|
wx.navigateBack() |
|
|
|
wx.navigateBack(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShareAppMessage() { |
|
|
|
onShareAppMessage() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响', |
|
|
|
title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响', |
|
|
|
path: '/patient/pages/adl/index', |
|
|
|
path: '/patient/pages/adl/index', |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleMp(index) { |
|
|
|
handleMp(index) { |
|
|
@ -406,7 +406,7 @@ Page({ |
|
|
|
6: 'PG_PATIENTASSESSMENTQ7', |
|
|
|
6: 'PG_PATIENTASSESSMENTQ7', |
|
|
|
7: 'PG_PATIENTASSESSMENTQ8', |
|
|
|
7: 'PG_PATIENTASSESSMENTQ8', |
|
|
|
8: 'PG_PATIENTASSESSMENTQ9', |
|
|
|
8: 'PG_PATIENTASSESSMENTQ9', |
|
|
|
}[index] |
|
|
|
}[index]; |
|
|
|
app.zdMpBehavior({ PageName }) |
|
|
|
app.zdMpBehavior({ PageName }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}); |
|
|
|