132 lines
2.6 KiB
JavaScript
132 lines
2.6 KiB
JavaScript
import request from "~/api/request"
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
visible: false,
|
|
radio1: true,
|
|
detail: {},
|
|
followUpList: [],
|
|
followUpDetail: {},
|
|
imageVisible: false,
|
|
imageList: [],
|
|
imageIndex: 1,
|
|
},
|
|
userId: '',
|
|
openSelect(){
|
|
this.setData({
|
|
visible: true
|
|
})
|
|
},
|
|
close(){
|
|
this.setData({
|
|
visible: false
|
|
})
|
|
},
|
|
confirm(){
|
|
this.setData({
|
|
visible: false
|
|
})
|
|
},
|
|
|
|
async getlist(){
|
|
const res = await request('doctor/patient/questionnaires/' + this.userId)
|
|
this.setData({
|
|
followUpList: res.list
|
|
})
|
|
if(res.list.length > 0){
|
|
this.setData({
|
|
followUpDetail: res.list[0]
|
|
})
|
|
this.getDetail(res.list[0].id)
|
|
|
|
}
|
|
},
|
|
async getDetail(id){
|
|
const res = await request('doctor/patient/questionnaire_info', 'post', {patient_id: 1, questionnaire_id: id})
|
|
res.liver_function_image = res.liver_function_image ? res.liver_function_image.split(',') : []
|
|
res.coagulation_function_image = res.coagulation_function_image ? res.coagulation_function_image.split(',') : []
|
|
res.blood_routine_image = res.blood_routine_image ? res.blood_routine_image.split(',') : []
|
|
res.nutritional_indicator_image = res.nutritional_indicator_image ? res.nutritional_indicator_image.split(',') : []
|
|
res.b_mode_image = res.b_mode_image ? res.b_mode_image.split(',') : []
|
|
res.mdt_image = res.mdt_image ? res.mdt_image.split(',') : []
|
|
|
|
this.setData({
|
|
detail: res
|
|
})
|
|
},
|
|
|
|
handleClick(e){
|
|
const id = e.currentTarget.dataset.id
|
|
this.setData({
|
|
followUpDetail: this.data.followUpList.find(item => item.id === id)
|
|
})
|
|
this.getDetail(id)
|
|
},
|
|
handleImagePreview(e){
|
|
const { mode, index } = e.currentTarget.dataset;
|
|
this.setData({
|
|
imageList: this.data.detail[mode],
|
|
imageIndex: index,
|
|
imageVisible: true
|
|
})
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
this.userId = options.userId;
|
|
this.getlist();
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
// this.getlist();
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
}
|
|
}) |