患者端1.0

This commit is contained in:
zoujiandong
2023-11-27 16:14:26 +08:00
parent a74582961e
commit a92f1621b1
44 changed files with 1750 additions and 145 deletions
+130 -79
View File
@@ -15,6 +15,7 @@ import {
throttle
} from "../../utils/util"
import {client_type} from "../../utils/isPc"
import {isExist,pathographyDetail} from "../../api/sickRecord"
let urlHost=app.hostConfig().agreehost;
console.log(client_type);
Page({
@@ -24,6 +25,7 @@ Page({
*/
data: {
prevData: null,
pathography_id:'',
showdialog: false,
showAgreeDialog: false,
message: '',
@@ -46,6 +48,7 @@ Page({
disease_desc: '',
hideFamilysick: false,
showBack: false,
is_exist:false,
columns: [],
fileList: [],
lockBtn: false,
@@ -127,91 +130,110 @@ Page({
getlocalInfo(id){
let sickInfo = wx.getStorageSync('sickInfo');
if (sickInfo) {
var InfoObj = JSON.parse(sickInfo);
if (InfoObj instanceof Array) {
for (let i = 0; i < InfoObj.length; i++) {
if (InfoObj[i].family_id == id) {
Dialog.confirm({
title: '温馨提示',
message: '是否加载之前保存的病情信息?',
}).then(() => {
this.setInfo(InfoObj[i])
})
.catch(() => {
let obj=null;
let isHas= InfoObj.some((item)=>{
if(item.family_id==id){
obj=item;
}
return item.family_id==id;
})
if(isHas){
this.setInfo(obj)
}else{
this.handleOnlineSick(this.data.family_id);
}
// for (let i = 0; i < InfoObj.length; i++) {
// if (InfoObj[i].family_id == id) {
// Dialog.confirm({
// title: '温馨提示',
// message: '是否加载之前保存的病情信息?',
// }).then(() => {
// this.setInfo(InfoObj[i])
// }).catch(() => {
});
// });
break;
};
}
// break;
// };
// }
}
}
},
handleLastSick(id) {
lastSick(id).then(data => {
if (!data){
this.getlocalInfo(id);
} else {
let obj = {
disease_class_name: '',
disease_class_id: '',
diagnosis_date: '',
disease_desc: '',
is_allergy_history:null,
product: [],
is_taboo:null,
is_pregnant:null,
pregnant: '',
is_family_history:null,
allergy_history: '',
family_history: '',
}
for (const key in obj) {
if (key != "product") {
this.setData({
[key]: data[key]
})
}
};
if (data.disease_desc) {
this.setData({
hideSick: true
})
};
if (data.pregnant) {
this.setData({
hidePregnant: true
})
};
if (data.allergy_history) {
this.setData({
hideGuomin: true
})
};
if (data.family_history) {
this.setData({
hideFamilysick: true
})
};
if (data.diagnose_images) {
this.setData({
fileList: data.diagnose_images,
checkSign: false
})
} else {
this.setData({
checkSign: false
})
}
handleSetValue(data){
if(data){
let obj = {
disease_class_name: '',
disease_class_id: '',
diagnosis_date: '',
disease_desc: '',
is_allergy_history:null,
product: [],
is_taboo:null,
is_pregnant:null,
pregnant: '',
is_family_history:null,
allergy_history: '',
family_history: '',
}
for (const key in obj) {
if (key != "product") {
this.setData({
[key]: data[key]
})
}
};
if (data.disease_desc) {
this.setData({
hideSick: true
})
};
if (data.pregnant) {
this.setData({
hidePregnant: true
})
};
if (data.allergy_history) {
this.setData({
hideGuomin: true
})
};
if (data.family_history) {
this.setData({
hideFamilysick: true
})
};
if (data.diagnose_images) {
this.setData({
fileList: data.diagnose_images,
checkSign: false
})
} else {
this.setData({
checkSign: false
})
}
}
},
handleOnlineSick(id){
lastSick(id).then(data => {
this.handleSetValue(data);
})
},
// handleLastSick(id) {
// lastSick(id).then(data => {
// if (!data){
// this.getlocalInfo(id);
// } else {
// }
// })
// },
onConfirm(event) {
const {
@@ -331,6 +353,11 @@ Page({
showSick: false
})
},
goRecord:throttle(function(){
app.method.navigateTo({
url:'/pages/sickRecord/sickRecord?family_id='+this.data.family_id
})
}),
handleThrottle: throttle(function () {
this.create_Order()
}),
@@ -552,6 +579,21 @@ Page({
diagnosis_date: dayjs(event.detail).format('YYYY-MM-DD')
});
},
handlepathographyDetail(id){
pathographyDetail(id).then(data=>{
this.handleSetValue(data);
})
},
handleIsExist(){
let {family_id}=this.data;
isExist({
family_id
}).then(data=>{
this.setData({
is_exist:data.is_exist==0?false:true
})
})
},
handelFocus(e) {
let key = e.target.dataset.id;
let value = e.target.dataset.value;
@@ -630,9 +672,6 @@ Page({
})
}
}
},
agreeConfirm(){
this.setData({
@@ -784,7 +823,9 @@ Page({
})
}
//this.getSick();
this.handleLastSick(options.family_id);
this.handleIsExist();
},
goAgreement:throttle(function(){
app.method.navigateTo({
@@ -806,7 +847,9 @@ Page({
img_host:app.hostConfig().imghost
});
let {
prevData
prevData,
pathography_id,
family_id
} = this.data;
if (prevData) {
this.setData({
@@ -814,6 +857,14 @@ Page({
disease_class_id: prevData.disease_class_id,
})
}
console.log(pathography_id)
if(pathography_id){
this.handlepathographyDetail(pathography_id)
}else{
this.getlocalInfo(family_id);
//this.handleLastSick(options.family_id);
}
},
/**
+4
View File
@@ -6,6 +6,10 @@
<view class="ui-title">填写病情</view>
</view>
<view class="infobox">
<view class="sickHisbox" wx:if="{{is_exist}}">
<view class="name">病情历史</view>
<view class="hisBtn" bindtap="goRecord">查看记录</view>
</view>
<view class="info" bindtap="showSick">
<view class="name">所患疾病</view>
<input type="text" value="{{disease_class_name}}" placeholder="请填写所患疾病名称" class="ipt" disabled="true">
+21 -1
View File
@@ -7,7 +7,27 @@
margin-top:172rpx;
}
.sickHisbox{
display: flex;
height:94rpx;
align-items: center;
margin-bottom: 20rpx;
background-color: #fff;
padding:0 55rpx;
justify-content: space-between;
}
.hisBtn{
width: 166rpx;
height: 60rpx;
color:#3CC7C0;
display: flex;
font-size: 26rpx;
align-items: center;
justify-content: center;
background: #E2FFFE;
border-radius: 6rpx;
border: 1rpx solid #3CC7C0;
}
.info {
border-bottom: 1rpx solid #E7E7E7;
display: flex;