更新小程序仓库
This commit is contained in:
@@ -0,0 +1,849 @@
|
||||
// pages/writeSick/writeSick.js
|
||||
const app = getApp()
|
||||
import Dialog from '@vant/weapp/dialog/dialog';
|
||||
import dayjs from '../../utils/dayjs.min.js'
|
||||
import {
|
||||
createOrder
|
||||
} from "../../api/consult"
|
||||
import {
|
||||
getSign
|
||||
} from "../../api/common"
|
||||
import {
|
||||
lastSick
|
||||
} from "../../api/consultExpert"
|
||||
import {
|
||||
throttle
|
||||
} from "../../utils/util"
|
||||
import {client_type} from "../../utils/isPc"
|
||||
let urlHost=app.hostConfig().agreehost;
|
||||
console.log(client_type);
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
prevData: null,
|
||||
showdialog: false,
|
||||
showAgreeDialog: false,
|
||||
message: '',
|
||||
order_inquiry_id:'',
|
||||
doctor_id: '',
|
||||
family_id: '',
|
||||
chat_id: '',
|
||||
inquiry_type: 1,
|
||||
inquiry_mode: 1,
|
||||
messageTitle: '',
|
||||
disease_class_name: '',
|
||||
disease_class_id:null,
|
||||
show: false,
|
||||
startIndex: 0,
|
||||
cancelBtn: false,
|
||||
showSick: false,
|
||||
hideSick: false,
|
||||
hideGuomin: false,
|
||||
hidePregnant:false,
|
||||
disease_desc: '',
|
||||
hideFamilysick: false,
|
||||
showBack: false,
|
||||
columns: [],
|
||||
fileList: [],
|
||||
lockBtn: false,
|
||||
checkSign: false,
|
||||
is_allergy_history:null,
|
||||
is_family_history:null,
|
||||
is_pregnant:null,
|
||||
pregnant: '',
|
||||
checkAgree: false,
|
||||
is_taboo:null,
|
||||
diagnosis_date:null,
|
||||
product: [],
|
||||
img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static',
|
||||
allergy_history: '',
|
||||
family_history: '',
|
||||
currentDate: new Date().getTime(),
|
||||
minDate: new Date('1900/01/01 00:00:00').getTime(),
|
||||
maxDate: new Date().getTime(),
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {
|
||||
return `${value}年`;
|
||||
}
|
||||
if (type === 'month') {
|
||||
return `${value}月`;
|
||||
}
|
||||
if (type === 'day') {
|
||||
return `${value}日`;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
},
|
||||
setInfo(obj){
|
||||
let Info =obj;
|
||||
for (const key in Info) {
|
||||
if (key != "product") {
|
||||
if (Info[key]) {
|
||||
this.setData({
|
||||
[key]: Info[key]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
if (Info.disease_desc) {
|
||||
this.setData({
|
||||
hideSick: true
|
||||
})
|
||||
};
|
||||
if (Info.pregnant) {
|
||||
this.setData({
|
||||
hidePregnant: true
|
||||
})
|
||||
};
|
||||
|
||||
if (Info.allergy_history) {
|
||||
this.setData({
|
||||
hideGuomin: true
|
||||
})
|
||||
};
|
||||
if (Info.family_history) {
|
||||
this.setData({
|
||||
hideFamilysick: true
|
||||
})
|
||||
};
|
||||
|
||||
if (Info.fileList) {
|
||||
|
||||
this.setData({
|
||||
fileList:Info.fileList,
|
||||
checkSign: false
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
checkSign: true
|
||||
})
|
||||
}
|
||||
},
|
||||
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(() => {
|
||||
|
||||
});
|
||||
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onConfirm(event) {
|
||||
const {
|
||||
value
|
||||
} = event.detail;
|
||||
this.setData({
|
||||
disease_class_name: `${value.disease_class_name}`,
|
||||
disease_class_id: `${value.disease_class_id}`,
|
||||
showSick: false
|
||||
})
|
||||
},
|
||||
showSick() {
|
||||
app.method.navigateTo({
|
||||
url: '/pages/commonSick/commonSick'
|
||||
})
|
||||
},
|
||||
delImg(event) {
|
||||
let id = event.currentTarget.dataset.id;
|
||||
this.data.fileList.splice(id, 1);
|
||||
this.setData({
|
||||
fileList: this.data.fileList
|
||||
})
|
||||
},
|
||||
previewImage(event) {
|
||||
let id = event.currentTarget.dataset.id;
|
||||
let urls = this.data.fileList;
|
||||
wx.previewImage({
|
||||
current: urls[id], // 当前显示图片的http链接
|
||||
urls: urls // 需要预览的图片http链接列表
|
||||
})
|
||||
},
|
||||
uploadFile(File) {
|
||||
wx.showLoading({
|
||||
title: '图片上传中...',
|
||||
mask: true
|
||||
})
|
||||
let THIS = this;
|
||||
getSign({
|
||||
user_type: 1,
|
||||
scene: 2
|
||||
}).then((resdata) => {
|
||||
let {
|
||||
accessid,
|
||||
dir,
|
||||
policy,
|
||||
signature,
|
||||
host
|
||||
} = resdata;
|
||||
let index = File.lastIndexOf("/");
|
||||
let filename = File.substring(index + 1, File.length);
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: host, // 仅为示例,非真实的接口地址
|
||||
filePath: File,
|
||||
name: 'file',
|
||||
formData: {
|
||||
OSSAccessKeyId: accessid,
|
||||
policy,
|
||||
key: dir + filename,
|
||||
signature
|
||||
},
|
||||
success(res) {
|
||||
if (res.statusCode === 204) {
|
||||
let url = host + '/' + dir + filename;
|
||||
THIS.setData({
|
||||
fileList: THIS.data.fileList.concat([url])
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
upload() {
|
||||
if(this.data.fileList.length>=9){
|
||||
wx.showToast({
|
||||
title: '复诊凭证最多上传9张',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
let THIS = this;
|
||||
wx.chooseMedia({
|
||||
count: 9-this.data.fileList.length,
|
||||
mediaType: ['image'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success(res) {
|
||||
var imgList = res.tempFiles;
|
||||
var promiseFun = [];
|
||||
for (let i = 0; i < imgList.length; i++) {
|
||||
var file = imgList[i].tempFilePath;
|
||||
promiseFun.push(
|
||||
THIS.uploadFile(file)
|
||||
)
|
||||
};
|
||||
Promise.all(promiseFun).then((res) => {
|
||||
wx.showToast({
|
||||
title: '图片上传成功',
|
||||
icon: "none"
|
||||
})
|
||||
THIS.setData({
|
||||
checkSign: false
|
||||
})
|
||||
wx.hideLoading();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
this.setData({
|
||||
showSick: false
|
||||
})
|
||||
},
|
||||
handleThrottle: throttle(function () {
|
||||
this.create_Order()
|
||||
}),
|
||||
create_Order() {
|
||||
let {
|
||||
inquiry_type,
|
||||
inquiry_mode,
|
||||
doctor_id,
|
||||
family_id,
|
||||
disease_class_id,
|
||||
diagnosis_date,
|
||||
disease_desc,
|
||||
fileList,
|
||||
is_allergy_history,
|
||||
product,
|
||||
is_taboo,
|
||||
checkSign,
|
||||
is_pregnant,
|
||||
pregnant,
|
||||
is_family_history,
|
||||
allergy_history,
|
||||
family_history,
|
||||
checkAgree,
|
||||
sex
|
||||
} = this.data;
|
||||
|
||||
if (!disease_class_id) {
|
||||
wx.showToast({
|
||||
title: '请选择所患疾病',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
};
|
||||
if (!diagnosis_date) {
|
||||
wx.showToast({
|
||||
title: '请选择确诊日期',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
};
|
||||
if (!disease_desc) {
|
||||
wx.showToast({
|
||||
title: '请填写病情主诉',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
};
|
||||
if(disease_desc.length<10){
|
||||
wx.showToast({
|
||||
title: '病情主诉不少于10个字',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
};
|
||||
|
||||
if (fileList.length == 0 && !checkSign) {
|
||||
wx.showToast({
|
||||
title: '请上传复诊凭证或者勾选凭证遗失或不在身边',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(is_taboo==null && inquiry_type == 4){
|
||||
wx.showToast({
|
||||
title: '请选择是否服用过您想购买的药品且无相关禁忌',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (is_taboo == 0 && inquiry_type == 4) {
|
||||
this.setData({
|
||||
showdialog: true,
|
||||
messageTitle: "您的情况不适合线上问诊开方,建议线下就诊"
|
||||
})
|
||||
return false
|
||||
};
|
||||
|
||||
if (inquiry_type == 4 && allergy_history) {
|
||||
for (let i = 0; i < product.length; i++) {
|
||||
if (allergy_history.indexOf(product[i].product_name) != -1) {
|
||||
this.setData({
|
||||
showdialog: true,
|
||||
messageTitle: "您的情况不适合线上问诊开方,建议线下就诊"
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
if(is_allergy_history==null){
|
||||
wx.showToast({
|
||||
title: '请选择您是否有过敏史',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
};
|
||||
if(is_allergy_history==1){
|
||||
if(!allergy_history){
|
||||
wx.showToast({
|
||||
title: '过敏史内容不能为空',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
};
|
||||
if(is_family_history==null){
|
||||
wx.showToast({
|
||||
title: '请选择您是否有家族病史',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
};
|
||||
if(is_family_history==1){
|
||||
if(!family_history){
|
||||
wx.showToast({
|
||||
title: '家族病史内容不能为空',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
};
|
||||
if(is_pregnant==null && sex==2){
|
||||
wx.showToast({
|
||||
title: '请选择您是否处于备孕、妊娠、哺乳期',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
};
|
||||
if (is_pregnant == 1) {
|
||||
wx.showToast({
|
||||
title: '您的情况不适合线上问诊开方,建议线下就诊',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (!checkAgree) {
|
||||
this.setData({
|
||||
showAgreeDialog: true
|
||||
})
|
||||
return false;
|
||||
};
|
||||
this.setData({
|
||||
lockBtn: true
|
||||
});
|
||||
createOrder({
|
||||
patient_id: wx.getStorageSync('CLIENT_USER_ID'),
|
||||
doctor_id: doctor_id,
|
||||
family_id: family_id,
|
||||
disease_class_id: disease_class_id,
|
||||
diagnosis_date: diagnosis_date,
|
||||
disease_desc: disease_desc,
|
||||
is_allergy_history:is_allergy_history,
|
||||
is_taboo: is_taboo,
|
||||
allergy_history: allergy_history,
|
||||
family_history: family_history,
|
||||
is_family_history: is_family_history,
|
||||
is_pregnant: is_pregnant,
|
||||
pregnant: pregnant,
|
||||
product: product,
|
||||
inquiry_type: inquiry_type,
|
||||
inquiry_mode: inquiry_mode,
|
||||
diagnose_images: fileList,
|
||||
client_type:client_type ,
|
||||
}).then((data) => {
|
||||
let {
|
||||
inquiry_no,
|
||||
order_inquiry_id
|
||||
} = data.data;
|
||||
let {
|
||||
chat_id,
|
||||
inquiry_type,
|
||||
inquiry_mode
|
||||
} = this.data;
|
||||
this.setData({
|
||||
lockBtn: false
|
||||
});
|
||||
if(data.status==1){
|
||||
app.method.navigateTo({
|
||||
url: '/pages/payOrder/payOrder?doctor_id=' + doctor_id + '&inquiry_no=' + inquiry_no + "&chat_id=" + chat_id + "&inquiry_type=" + inquiry_type + "&inquiry_mode=" + inquiry_mode + "&order_inquiry_id=" + order_inquiry_id + "&fromType=chat"
|
||||
})
|
||||
}else if(data.status==2){
|
||||
this.setData({
|
||||
showdialog:true,
|
||||
messageTitle:"当前患者存在进行中问诊订单",
|
||||
order_inquiry_id: order_inquiry_id,
|
||||
cancelBtn:true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}).catch((error)=>{
|
||||
this.setData({
|
||||
showdialog:true,
|
||||
messageTitle:error.message,
|
||||
cancelBtn:true
|
||||
})
|
||||
})
|
||||
},
|
||||
inputChange(e) {
|
||||
this.setData({
|
||||
[e.target.dataset.id]: e.detail.value
|
||||
})
|
||||
},
|
||||
openPop() {
|
||||
this.setData({
|
||||
show: true
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.setData({
|
||||
show: false
|
||||
})
|
||||
},
|
||||
handleConfirm(event) {
|
||||
this.setData({
|
||||
show: false
|
||||
});
|
||||
this.setData({
|
||||
diagnosis_date: dayjs(event.detail).format('YYYY-MM-DD')
|
||||
});
|
||||
},
|
||||
handelFocus(e) {
|
||||
let key = e.target.dataset.id;
|
||||
let value = e.target.dataset.value;
|
||||
if (!e.detail.value) {
|
||||
this.setData({
|
||||
[key]: false,
|
||||
[value]: e.detail.value
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
[key]: true,
|
||||
[value]: e.detail.value
|
||||
})
|
||||
}
|
||||
},
|
||||
handelTextFocus(e) {
|
||||
let key = e.target.dataset.id;
|
||||
let value = e.target.dataset.value;
|
||||
if (!e.detail) {
|
||||
this.setData({
|
||||
[key]: false,
|
||||
[value]: e.detail
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
[key]: true,
|
||||
[value]: e.detail
|
||||
})
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
|
||||
if (app.globalData.origion == 1) {
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
} else if (app.globalData.origion == 2) {
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
} else {
|
||||
let {
|
||||
disease_class_name,
|
||||
diagnosis_date,
|
||||
fileList,
|
||||
is_allergy_history,
|
||||
is_pregnant,
|
||||
checkSign,
|
||||
checkAgree,
|
||||
is_family_history,
|
||||
disease_desc
|
||||
} = this.data;
|
||||
//封装组件后退有bug,通过引用,回退正常
|
||||
if (disease_class_name || is_allergy_history || is_pregnant || is_family_history || fileList.length > 0 || diagnosis_date || disease_desc || checkSign || checkAgree) {
|
||||
Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '是否保存填写的病情信息?',
|
||||
}).then(() => {
|
||||
this.onSave()
|
||||
})
|
||||
.catch(() => {
|
||||
//wx.setStorageSync('sickInfo','');
|
||||
wx.navigateBack({
|
||||
delta: 1,
|
||||
fail: function () {
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
agreeConfirm(){
|
||||
this.setData({
|
||||
checkAgree:true
|
||||
})
|
||||
},
|
||||
confirm(event) {
|
||||
|
||||
if (event.detail) {
|
||||
this.setData({
|
||||
showdialog: false
|
||||
})
|
||||
}
|
||||
if(this.data.messageTitle=="当前患者存在进行中问诊订单"){
|
||||
let {order_inquiry_id}=this.data;
|
||||
app.method.navigateTo({
|
||||
url: '/pages/orderDetail/orderDetail?order_inquiry_id='+ order_inquiry_id,
|
||||
})
|
||||
}
|
||||
},
|
||||
cancelAlert(){
|
||||
this.setData({
|
||||
showdialog: false
|
||||
})
|
||||
},
|
||||
onChangeSign() {
|
||||
this.setData({
|
||||
checkSign: !this.data.checkSign
|
||||
})
|
||||
if (this.data.checkSign) {
|
||||
this.setData({
|
||||
fileList: []
|
||||
})
|
||||
}
|
||||
},
|
||||
onChange(event) {
|
||||
|
||||
let key = event.target.dataset.id;
|
||||
this.setData({
|
||||
[key]: event.detail
|
||||
});
|
||||
if (event.detail == 0) {
|
||||
if (key == "is_allergy_history") {
|
||||
this.setData({
|
||||
allergy_history: ''
|
||||
})
|
||||
};
|
||||
|
||||
if (key == "is_family_history") {
|
||||
this.setData({
|
||||
family_history: ''
|
||||
})
|
||||
};
|
||||
|
||||
if (key == "is_pregnant") {
|
||||
this.setData({
|
||||
pregnant: ''
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
onSave() {
|
||||
let {
|
||||
family_id,
|
||||
allergy_history,
|
||||
family_history,
|
||||
disease_desc,
|
||||
disease_class_name,
|
||||
disease_class_id,
|
||||
diagnosis_date,
|
||||
fileList,
|
||||
checkSign,
|
||||
checkAgree,
|
||||
is_allergy_history,
|
||||
is_pregnant,
|
||||
pregnant,
|
||||
is_family_history,
|
||||
is_taboo,
|
||||
product
|
||||
} = this.data;
|
||||
let sickInfo = {
|
||||
family_id,
|
||||
disease_class_name,
|
||||
diagnosis_date,
|
||||
fileList,
|
||||
disease_class_id,
|
||||
disease_desc,
|
||||
allergy_history,
|
||||
family_history,
|
||||
is_allergy_history,
|
||||
is_pregnant,
|
||||
pregnant,
|
||||
checkSign,
|
||||
is_taboo,
|
||||
product,
|
||||
checkAgree,
|
||||
is_family_history
|
||||
};
|
||||
let sickInfo_stroage = wx.getStorageSync("sickInfo");
|
||||
if (sickInfo_stroage) {
|
||||
let sickInfoObj = JSON.parse(sickInfo_stroage);
|
||||
if (sickInfoObj instanceof Array) {
|
||||
for (let i = 0; i < sickInfoObj.length; i++) {
|
||||
if (sickInfoObj[i].family_id == family_id) {
|
||||
sickInfoObj.splice(i, 1);
|
||||
}
|
||||
}
|
||||
sickInfoObj.push(sickInfo);
|
||||
wx.setStorageSync('sickInfo', JSON.stringify(sickInfoObj));
|
||||
} else {
|
||||
sickInfoObj.family_id = family_id;
|
||||
wx.setStorageSync('sickInfo', JSON.stringify([sickInfoObj]));
|
||||
}
|
||||
} else {
|
||||
wx.setStorageSync('sickInfo', JSON.stringify([sickInfo]));
|
||||
}
|
||||
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
// 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
if (options.inquiry_type == 1 || options.inquiry_type == 3) {
|
||||
this.setData({
|
||||
doctor_id: options.doctor_id,
|
||||
family_id: options.family_id,
|
||||
chat_id: options.chat_id,
|
||||
inquiry_type: options.inquiry_type,
|
||||
inquiry_mode: 1,
|
||||
sex: options.sex
|
||||
})
|
||||
} else {
|
||||
if (options.inquiry_type == 4) {
|
||||
this.setData({
|
||||
startIndex: 1
|
||||
})
|
||||
}
|
||||
|
||||
this.setData({
|
||||
product: options.product ? JSON.parse(options.product) : [],
|
||||
family_id: options.family_id,
|
||||
inquiry_type: options.inquiry_type,
|
||||
sex: options.sex,
|
||||
inquiry_mode: 1
|
||||
})
|
||||
}
|
||||
//this.getSick();
|
||||
this.handleLastSick(options.family_id);
|
||||
},
|
||||
goAgreement:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url:"/pages/linkPage/linkPage?url="+encodeURIComponent(urlHost+'/basic/file/agreement.htm?id=1')
|
||||
})
|
||||
}),
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.setData({
|
||||
img_host:app.hostConfig().imghost
|
||||
});
|
||||
let {
|
||||
prevData
|
||||
} = this.data;
|
||||
if (prevData) {
|
||||
this.setData({
|
||||
disease_class_name: prevData.disease_class_name,
|
||||
disease_class_id: prevData.disease_class_id,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-checkbox": "@vant/weapp/checkbox/index",
|
||||
"van-radio": "@vant/weapp/radio/index",
|
||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-picker": "@vant/weapp/picker/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"dialog":"../../components/dialog/dialog",
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"nav":"../../components/nav/nav"
|
||||
},
|
||||
"navigationStyle":"custom",
|
||||
"navigationBarTitleText": "肝胆相照互联网医院"
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<!--pages/writeSick/writeSick.wxml-->
|
||||
<wxs src="../../filters/filter.wxs" module="filter"></wxs>
|
||||
<view class="content">
|
||||
<view class="ui-navigatorbar">
|
||||
<image class="ui-navigatorbar-back" bindtap="goBack" src="../../assets/images/back.png" />
|
||||
<view class="ui-title">填写病情</view>
|
||||
</view>
|
||||
<view class="infobox">
|
||||
<view class="info" bindtap="showSick">
|
||||
<view class="name">所患疾病</view>
|
||||
<input type="text" value="{{disease_class_name}}" placeholder="请填写所患疾病名称" class="ipt" disabled="true">
|
||||
</input>
|
||||
</view>
|
||||
<view class="info" bindtap="openPop">
|
||||
<view class="name">确诊日期</view>
|
||||
<input type="text" auto-focus value="{{filter.formatDay(diagnosis_date) }}" placeholder="请选择日期(年月日)" class="ipt" disabled="true" />
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="name">病情主诉</view>
|
||||
</view>
|
||||
<view class="textareaview">
|
||||
<view class="textwrap" style="background: #f2f2f2!important;">
|
||||
<view class="textbox" hidden="{{hideSick}}">
|
||||
<view class="desc"><text>临床症状:</text>如没有力气、食欲不好、眼睛发黄、面色晦暗、尿液发黄、肝区疼痛等等</view>
|
||||
<view class="desc"><text>诊疗情况:</text>描述做过哪些检查以及重要结果,是否开始治疗?治疗方案是什么(写出具体药物)、治疗效果如何?</view>
|
||||
<view class="desc"><text>希望解答的问题:</text>1、是否需要更换抗病毒药物? 2、如果需要更换,请问哪种药物更合适?</view>
|
||||
</view>
|
||||
<van-field show-confirm-bar="{{false}}" maxlength="500" bind:change="handelTextFocus" data-id="hideSick" data-value="disease_desc" custom-style="height: 458rpx!important; border-radius: 10px;position:relative;" input-class="iptclass" class="sickArea" show-word-limit value="{{ disease_desc }}" label="" type="textarea" placeholder="" border="{{ false }}"></van-field>
|
||||
</view>
|
||||
</view>
|
||||
<view class="infobox" style="margin-top: 20rpx;background-color: #fff;padding-bottom: 30rpx;" wx:if="{{inquiry_type==4}}">
|
||||
<view class="info">
|
||||
<view class="name">用药意向</view>
|
||||
</view>
|
||||
<view class="radiotip" style="margin:30rpx 32rpx 0;padding-bottom: 20rpx;overflow:hidden">
|
||||
<view class="textbox" style="position: static;height:auto;">
|
||||
<view class="desc" ><text class="goods" wx:for="{{product}}" wx:key="product_id">{{item.product_name}}{{item.product_spec}}(数量{{item.product_num}})</text></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="info" style="flex-direction: column;height:auto;align-items:flex-start;padding: 40rpx 0;margin-top: 20rpx;">
|
||||
<view class="name">上传复诊凭证(最多9张)</view>
|
||||
<view class="tip">请上传问诊本人清晰的复诊凭证(病例/处方单/检查报告/住院单),仅接诊医生可见。</view>
|
||||
<view class="uploadbox">
|
||||
<image wx:for="{{fileList}}" src="{{item}}" mode="aspectFill" class="upload" bindtap="previewImage" data-id="{{idx}}" wx:for-index="idx" wx:key="idx">
|
||||
<image src="{{img_host+'/xiaoclose.png'}}" class="close" catchtap="delImg" data-id="{{idx}}"></image>
|
||||
</image>
|
||||
<view class="upload" bindtap="upload">
|
||||
<van-icon name="plus" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="agreebox">
|
||||
<van-checkbox value="{{checkSign}}" data-id="checkSign" bind:change="onChangeSign" checked-color="#3cc7c0" label-class="desc">复诊凭证遗失或不在身边,请勾选本项,未上传凭证可能会影响医生对您的诊断</van-checkbox>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sickHis">
|
||||
<view class="list">
|
||||
<view class="qa" wx:if="{{inquiry_type==4}}">
|
||||
<view class="num">{{startIndex}}、</view>
|
||||
<view class="titlebox">
|
||||
<view class="title">是否服用过您想购买的药品且无相关禁忌?</view>
|
||||
<view class="radio">
|
||||
<van-radio-group value="{{filter.numberTOstring(is_taboo)}}" data-id="is_taboo" bind:change="onChange" direction="horizontal">
|
||||
<van-radio name="1" checked-color="#3cc7c0">是</van-radio>
|
||||
<van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
|
||||
</van-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="qa">
|
||||
<view class="num">{{startIndex+1}}、</view>
|
||||
<view class="titlebox">
|
||||
<view class="title">您是否有过敏史?</view>
|
||||
<view class="radio">
|
||||
<van-radio-group value="{{filter.numberTOstring(is_allergy_history)}}" data-id="is_allergy_history" bind:change="onChange" direction="horizontal">
|
||||
<van-radio name="1" checked-color="#3cc7c0">是</van-radio>
|
||||
<van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
|
||||
</van-radio-group>
|
||||
<view class="radiotip" hidden="{{is_allergy_history!=1}}">
|
||||
<textarea placeholder=" " class="textarea" show-confirm-bar="{{false}}" cursor-spacing="70" confirm-type="done" value="{{allergy_history}}" bindinput="handelFocus" data-id="hideGuomin" data-value="allergy_history"></textarea>
|
||||
<view class="textbox" hidden="{{hideGuomin}}">
|
||||
<view class="desc"><text>过敏史:</text>请填写过敏源,如药物,请写出药名;如食物,请写具体如鸡蛋、牛奶等(限制50个字)</view>
|
||||
</view>
|
||||
<!-- <text> 过敏史:</text>
|
||||
请填写过敏源,如药物,请写出药名;如食物,请写具体如鸡蛋、牛奶等 -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="qa">
|
||||
<view class="num">{{startIndex+2}}、</view>
|
||||
<view class="titlebox">
|
||||
<view class="title">您是否有家族病史?</view>
|
||||
<view class="radio">
|
||||
<van-radio-group value="{{ filter.numberTOstring(is_family_history) }}" data-id="is_family_history" bind:change="onChange" direction="horizontal">
|
||||
<van-radio name="1" checked-color="#3cc7c0">是</van-radio>
|
||||
<van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
|
||||
</van-radio-group>
|
||||
</view>
|
||||
<view class="radiotip" hidden="{{is_family_history!=1}}">
|
||||
<textarea class="textarea" placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70" confirm-type="done" value="{{family_history}}" bindinput="handelFocus" data-id="hideFamilysick" data-value="family_history"></textarea>
|
||||
<view class="textbox" hidden="{{hideFamilysick}}">
|
||||
<view class="desc"><text>家族病史:</text>如果是肝病,请写明患肝炎、肝硬化、肝衰竭还是肝癌。(限制50个字)</view>
|
||||
</view>
|
||||
<!-- <text> 过敏史:</text>
|
||||
请填写过敏源,如药物,请写出药名;如食物,请写具体如鸡蛋、牛奶等 -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="qa" wx:if="{{sex==2}}">
|
||||
<view class="num">{{startIndex+3}}、</view>
|
||||
<view class="titlebox">
|
||||
<view class="title">您是否处于备孕、妊娠、哺乳期?</view>
|
||||
<view class="radio">
|
||||
<van-radio-group value="{{ filter.numberTOstring(is_pregnant)}}" data-id="is_pregnant" bind:change="onChange" direction="horizontal">
|
||||
<van-radio name="1" checked-color="#3cc7c0">是</van-radio>
|
||||
<van-radio name="0" checked-color="#3cc7c0" style="margin-left: 140rpx;">否</van-radio>
|
||||
</van-radio-group>
|
||||
</view>
|
||||
<!-- <view class="radiotip" hidden="{{is_pregnant!=1}}">
|
||||
<textarea class="textarea" placeholder=" " show-confirm-bar="{{false}}" cursor-spacing="70" confirm-type="done" value="{{pregnant}}" bindinput="handelFocus" data-id="hidePregnant" data-value="pregnant"></textarea>
|
||||
<view class="textbox" hiden="{{hidePregnant}}">
|
||||
<view class="desc">请描述您目前所处阶段,如备孕中、哺乳期中、妊娠月份。(限制50个字)</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="agreebox" style="margin: 20rpx 0 0 0;">
|
||||
<view class="xieyi">
|
||||
<van-checkbox value="{{ checkAgree }}" data-id="checkAgree" bind:change="onChange" checked-color="#3cc7c0" label-class="desc" label-disabled>胆相照互联网医院平台医生为您提供健康咨询服务,医生建议仅供参考。根据国家互联网诊疗相关政策要求,请您在提交服务前仔细阅读<text bindtap="goAgreement">《风险告知与知情同意书》</text>。继续操作表示您知悉并同意上述全部内容。</van-checkbox>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="nextbox">
|
||||
<button class="next" type="primary" bindtap="handleThrottle" disabled="{{btnLock}}">下一步</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-popup show="{{ show }}" position="bottom" custom-style="height: auto">
|
||||
<van-datetime-picker title="选择确诊日期" min-date="{{ minDate }}" toolbar-class="dateTitle" type="date" value="{{ currentDate }}" bind:cancel="handleClose" bind:confirm="handleConfirm" max-date="{{ maxDate }}" formatter="{{ formatter }}" />
|
||||
</van-popup>
|
||||
<van-popup show="{{ showSick }}" position="bottom" custom-style="height: auto">
|
||||
<van-picker show-toolbar title="选择所患疾病" columns="{{ columns }}" value-key="disease_class_name" bind:cancel="onCancel" bind:confirm="onConfirm" />
|
||||
</van-popup>
|
||||
</view>
|
||||
<dialog bind:confirm="confirm" bind:cancel="cancelAlert" showDialog="{{showdialog}}" message="{{messageTitle}}" cancelBtn="{{cancelBtn}}"></dialog>
|
||||
<van-dialog
|
||||
use-slot
|
||||
class="mydailog"
|
||||
bind:confirm="agreeConfirm"
|
||||
title="温馨提示"
|
||||
theme='green'
|
||||
show="{{showAgreeDialog}}"
|
||||
confirm-button-color="#3CC7C0"
|
||||
cancel-button-text="确定"
|
||||
>
|
||||
<view class="slotmsg">
|
||||
请您先仔细阅读并同意<text class="green" bindtap="goAgreement">《风险告知与知情同意书》</text>
|
||||
</view>
|
||||
</van-dialog>
|
||||
<van-dialog id="van-dialog" confirm-button-color="#3CC7C0" />
|
||||
@@ -0,0 +1,279 @@
|
||||
/* pages/writeSick/writeSick.wxss */
|
||||
.content{
|
||||
min-height: 100%;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
.infobox {
|
||||
margin-top:172rpx;
|
||||
|
||||
}
|
||||
|
||||
.info {
|
||||
border-bottom: 1rpx solid #E7E7E7;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
align-items: center;
|
||||
height: 112rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
|
||||
.info .name {
|
||||
white-space: nowrap;
|
||||
width: 180rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 52rpx;
|
||||
color: #333333;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.info text {
|
||||
margin-top: 20rpx;
|
||||
color:#E34D59;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.info .ipt {
|
||||
margin-left: 15rpx;
|
||||
margin-right: 52rpx;
|
||||
flex: 1;
|
||||
}
|
||||
.input-placeholder {
|
||||
color: #999999;
|
||||
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.textareaview{
|
||||
position: relative;
|
||||
padding:40rpx 52rpx;
|
||||
background: #fff!important;
|
||||
}
|
||||
.textwrap{
|
||||
background: #F2F2F2!important;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.van-cell{
|
||||
position: relative;
|
||||
z-index:2;
|
||||
background-color:transparent!important;
|
||||
}
|
||||
.van-field__body--textarea{
|
||||
height:360rpx;
|
||||
width:580rpx;
|
||||
}
|
||||
.iptclass{
|
||||
top:0;
|
||||
overflow-y: scroll;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
height:360rpx!important;
|
||||
bottom:0;
|
||||
left:0rpx;
|
||||
right:0rpx;
|
||||
width:100%!important;
|
||||
background-color: transparent;
|
||||
|
||||
}
|
||||
.mydailog .dialog-index--van-dialog__confirm{
|
||||
background:#ebf9f9!important;
|
||||
}
|
||||
/*
|
||||
.van-field__control {
|
||||
display: flex;
|
||||
align-self: start;
|
||||
} */
|
||||
|
||||
.van-field__word-limit {
|
||||
color: #999999!important;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.green{
|
||||
color:rgba(60, 199, 192, 1)
|
||||
}
|
||||
.van-field__word-num--full{
|
||||
color: #ee0a24!important;
|
||||
}
|
||||
.textbox{
|
||||
left:86rpx;
|
||||
right:86rpx;
|
||||
top:60rpx;
|
||||
height:380rpx;
|
||||
z-index:0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.textbox .desc{
|
||||
word-break: break-all;
|
||||
line-height: 42rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.textbox .goods{
|
||||
display: inline;
|
||||
white-space:normal;
|
||||
}
|
||||
.textbox .goods:after{
|
||||
content:";"
|
||||
}
|
||||
.textbox .goods:last-child:after{
|
||||
content:""
|
||||
}
|
||||
.textbox view:last-child{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.textbox text{
|
||||
color: #333333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.info .tip{
|
||||
line-height: 36rpx;
|
||||
color: #666666;
|
||||
margin:20rpx 52rpx 0;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.uploadbox{
|
||||
|
||||
margin:30rpx 52rpx 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap ;
|
||||
}
|
||||
.uploadbox .close{
|
||||
z-index:99;
|
||||
top:5rpx;
|
||||
right:5rpx;
|
||||
position: absolute;
|
||||
width:30rpx;
|
||||
height:30rpx;
|
||||
}
|
||||
.uploadbox .upload{
|
||||
position: relative;
|
||||
object-fit: cover;
|
||||
margin: 5px 19rpx 5px 0;
|
||||
}
|
||||
.uploadbox .upload:nth-child(4n){
|
||||
margin-right: 0;
|
||||
}
|
||||
.van-icon-plus{
|
||||
color:#333;
|
||||
font-size: 80rpx!important;
|
||||
}
|
||||
.agreebox{
|
||||
margin:30rpx 52rpx 0;
|
||||
display: flex;
|
||||
}
|
||||
.agreebox .desc{
|
||||
color: #666666;
|
||||
line-height: 36rpx;
|
||||
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.van-checkbox{
|
||||
display: flex;
|
||||
align-items: flex-start!important;
|
||||
}
|
||||
.sickHis{
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
padding:40rpx 52rpx;
|
||||
|
||||
}
|
||||
textarea{
|
||||
width:100%;
|
||||
color:#333;
|
||||
height:132rpx;
|
||||
}
|
||||
.list .qa{
|
||||
display: flex;
|
||||
}
|
||||
.titlebox{
|
||||
flex:1;
|
||||
|
||||
}
|
||||
.radio{
|
||||
margin: 40rpx 0rpx 30rpx 0;
|
||||
}
|
||||
.sickArea{
|
||||
position: relative;
|
||||
z-index:1;
|
||||
}
|
||||
.upload{
|
||||
width: 148rpx;
|
||||
height:148rpx;
|
||||
display: flex;
|
||||
justify-content:center ;
|
||||
align-items: center;
|
||||
background: #F2F2F2;
|
||||
border-radius: 4rpx
|
||||
}
|
||||
.radiotip{
|
||||
position: relative;
|
||||
padding:24rpx 20rpx;
|
||||
justify-content: center;
|
||||
margin-top: 30rpx;
|
||||
line-height: 42rpx;
|
||||
background: #F2F2F2;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color:#999;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.radiotip .textbox{
|
||||
top:20rpx;
|
||||
left:20rpx;
|
||||
height: 100rpx;
|
||||
right:20rpx;
|
||||
}
|
||||
.radiotip .textarea{
|
||||
position: relative;
|
||||
z-index:2;
|
||||
}
|
||||
.radiotip text{
|
||||
white-space: nowrap;
|
||||
color:#333;
|
||||
}
|
||||
.xieyi{
|
||||
width:100%;
|
||||
padding:30rpx 52rpx 40rpx;
|
||||
|
||||
background-color: #fff;
|
||||
}
|
||||
.agreebox text{
|
||||
color:#3CC7C0;
|
||||
|
||||
}
|
||||
.nextbox{
|
||||
padding-bottom: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.next{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 94rpx;
|
||||
font-size: 36rpx;
|
||||
border:none;
|
||||
outline: none;
|
||||
margin:0 52rpx;
|
||||
border-radius: 47rpx;
|
||||
color: #fff;
|
||||
margin-bottom: 40rpx;
|
||||
background: #3CC7C0!important;
|
||||
}
|
||||
.datePicker{
|
||||
width:100%;
|
||||
position: fixed;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.dateTitle{
|
||||
border:1rpx solid #E7E7E7;
|
||||
}
|
||||
.van-uploader__preview-image,.van-uploader__upload{
|
||||
width: 148rpx!important;
|
||||
height: 148rpx!important;
|
||||
}
|
||||
.van-uploader__preview{
|
||||
margin: 0 6px 8px 0;
|
||||
}
|
||||
Reference in New Issue
Block a user