//articleLists.js 文章列表
// 网络请求工具类
var networkUtil = require('../../utils/network_util.js')
var api = require('../../utils/apiFile.js')
// 事件监听
var event = require('../../utils/event.js')
// 获取应用实例
var app = getApp()
var patientId, checkTime
Page({
data: {
list: [
// { likeCount: 12, title: "title1", introduction: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }
// , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" }
// , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" }
// , { likeCount: 12, title: "title1", introduction: "content1", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }
// , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" }
// , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" }
],
flag:false,
showTitle:'',
showContent:'',
titles: ["问诊检查", "儿科检查", "一般检查", "辅助检查"],
current_index: 0,
//问诊检查
mainFoster: "",
feedType: "",
pee: "",
excrement: "",
sleep: "",
activity: "",
vitaminD: "",
assistFood: "",
homeMeasure: "",
drugGllergic: "",
morbidity: "",
otherTextWZ: "",
//儿科检查
tooth: "",
facecolor: "",
skin: "",
eyesight: "",
hearing: "",
chest: "",
neck: "",
belly: "",
umbilical: "",
stepStatus: "",
eye: "",
ear: "",
spineFours: "",
portaGenitals: "",
// bilirubinHead: "",
// bilirubinChest: "",
// bilirubinBelly: "",
bilirubin:"",
bregma:"",
bregmaValue:"",
nerve:"",
stoopStatus: "",
stoopSign: "",
otherTextWZ: "",
//一般检查
temperature: "",
height: "",
weight: "",
head: "",
chestw: "",
heightWeight:"",
temperature: "",
growthEvaluate: "",
//辅助检查
bonez: "",
sportsEvaluation: "",
hipJoint: "",
heartAction: "",
hemoglobin: "",
whiteCell: "",
platelet: "",
otherBlood: "",
urineProtein: "",
urineSugar: "",
urineAcetone: "",
hematuria:"",
otherUrine:"",
other_textFZ:""
},
onLoad: function (e) {
patientId = e.patientId
checkTime = e.checkTime
// 数据初始化
var self = this
var index = parseInt(e.current_index + "")
this.setData({
current_index: index
})
if (this.data.current_index == 0) {
this.requestDataWZ()
} else if (this.data.current_index == 1) {
this.requestDataEK()
} else if (this.data.current_index == 2) {
this.requestDataYB()
} else if (this.data.current_index == 3) {
this.requestDataFZ()
}
},
onUnload: function () {
},
/*---------事件处理函数--------*/
showMoreContent: function (e) {
var content = e.currentTarget.dataset.content // + "问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问诊检查问"
var title = e.currentTarget.dataset.title
if(content.length>=4){
this.setData({
flag: true,
showTitle: title,
showContent: content,
})
}
},
closeMask:function(){
this.setData({
flag: false,
})
},
titleClick: function (e) {
// console.log(e)
var self = this
var current_index = e.currentTarget.dataset.index
this.setData({
current_index: current_index,
})
if (this.data.current_index == 0) {
this.requestDataWZ()
}else if (this.data.current_index == 1) {
this.requestDataEK()
} else if (this.data.current_index == 2){
this.requestDataYB()
} else if (this.data.current_index == 3) {
this.requestDataFZ()
}
},
/*---------自定义函数--------*/
requestDataWZ() {
var self = this
networkUtil.showLoading()
var param = { page: 10, limit: 100, patientId: patientId, checkTime: checkTime }
console.log('param', param)
networkUtil._get(api.wzXinxi, param, function (res) {
console.log(res)
var result = res.data.list[0]
self.setData({
mainFoster: result.mainFoster,
feedType: result.feedType,
pee: result.pee,
excrement: result.excrement,
sleep: result.sleep,
activity: result.activity,
vitaminD: result.vitaminD,
assistFood: result.assistFood,
homeMeasure: result.homeMeasure,
drugGllergic: result.drugGllergic,
morbidity: result.morbidity,
otherTextWZ: result.otherText,
})
self.getContentByDeal("assistFood",result.assistFood);
}, function (res) {
})
},
requestDataFZ() {
var self = this
networkUtil.showLoading()
var param = { page: 10, limit: 100, patientId: patientId, checkTime: checkTime }
// console.log(param)
networkUtil._get(api.checksub, param, function (res) {
console.log(res)
var result = res.data.list[0]
var whiteCell
if (result.whiteCell=="无"){
whiteCell = result.whiteCell
}else{
whiteCell = result.whiteCell +"×10^9/L"
}
var platelet
if (result.platelet == "无") {
platelet = result.platelet
} else {
platelet = result.platelet + "×10^9/L"
}
self.setData({
bonez: result.bonez,
sportsEvaluation: result.sportsEvaluation,
hipJoint: result.hipJoint,
heartAction: result.heartAction,
hemoglobin: result.hemoglobin,
whiteCell: whiteCell,
platelet: platelet,
otherBlood: result.otherBlood,
urineProtein: result.urineProtein,
urineSugar: result.urineSugar,
urineAcetone: result.urineAcetone,
hematuria: result.hematuria,
otherUrine: result.otherUrine,
other_textFZ: result.otherText,
})
self.getContentByDeal("hipJoint", result.hipJoint);
}, function (res) {
})
},
requestDataEK() {
var self = this
networkUtil.showLoading()
var param = { page: 10, limit: 100, patientId: patientId, checkTime: checkTime }
// console.log(param)
networkUtil._get(api.checkeb, param, function (res) {
console.log(res)
var result = res.data.list[0]
self.setData({
tooth: result.tooth,
facecolor: result.facecolor,
skin: result.skin,
eyesight: result.eyesight,
hearing: result.hearing,
chest: result.chest,
neck: result.neck,
belly: result.belly,
umbilical: result.umbilical,
stepStatus: result.stepStatus,
eye: result.eye,
ear: result.ear,
spineFours: result.spineFours,
portaGenitals: result.portaGenitals,
// bilirubinHead: result.bilirubinHead,
// bilirubinChest: result.bilirubinChest,
// bilirubinBelly: result.bilirubinBelly,
bilirubin:result.bilirubin,
bregma: result.bregma,
bregmaValue:result.bregmaValue,
nerve: result.nerve,
stoopStatus: result.stoopStatus,
stoopSign: result.stoopSign,
otherTextEK: result.otherText,
})
self.getContentByDeal("facecolor", result.facecolor);
self.getContentByDeal("skin", result.skin);
self.getContentByDeal("chest", result.chest);
self.getContentByDeal("neck", result.neck);
self.getContentByDeal("portaGenitals", result.portaGenitals);
self.getContentByDeal("stoopStatus", result.stoopStatus);
self.getContentByDeal("stoopSign", result.stoopSign);
}, function (res) {
chest
})
},
requestDataYB() {
var self = this
networkUtil.showLoading()
var param = { page: 10, limit: 100, patientId: patientId, checkTime: checkTime }
// console.log(param)
networkUtil._get(api.checkcommon, param, function (res) {
console.log(res)
var result = res.data.list[0]
self.setData({
temperature: result.temperature,
height: result.height,
weight: result.weight,
head: result.head,
chestw: result.chestw,
heightWeight: result.heightWeight,
temperature: result.temperature,
growthEvaluate: result.growthEvaluate,
})
}, function (res) {
})
},
getContentByDeal(str,data){
var self=this
if(data){
//辅食添加
if (str =="assistFood") {
var assistFood = JSON.parse(data);
if (assistFood.yesOrNo === "no") {
self.setData({
assistFood: "未添加"
})
}
if (assistFood.yesOrNo === "yes") {
self.setData({
assistFood: "添加"
})
if (assistFood.qtText) {
self.setData({
assistFood: self.data.assistFood + ":" + assistFood.qtText
})
}
}
}
//面色
if (str == "facecolor") {
var facecolor = JSON.parse(data);
if (facecolor.select === "1") {
self.setData({
facecolor: "红润"
})
}
if (facecolor.select === "2") {
self.setData({
facecolor: "黄染"
})
}
if (facecolor.select === "3") {
self.setData({
facecolor: "黄染"
})
if (facecolor.qtText && facecolor.qtText !== "") {
self.setData({
facecolor: self.data.facecolor + ":" + facecolor.qtText
})
}
}
}
//皮肤
if (str == "skin") {
var skin = JSON.parse(data);
if (skin.yesOrNo === "no") {
self.setData({
skin: "未见异常"
})
}
if (skin.yesOrNo === "yes") {
var result = "异常:"
if (skin.sz) result.length > 3 ? result += "、湿疹" : result += "湿疹";
if (skin.hr) result.length > 3 ? result += "、黄染" : result += "黄染";
if (skin.fg) result.length > 3 ? result += "、发绀" : result += "发绀";
if (skin.fg1) result.length > 3 ? result += "、发绀(口唇、指趾甲床)" : result += "发绀(口唇、指趾甲床)";
if (skin.qb) result.length > 3 ? result += "、苍白" : result += "苍白";
if (skin.mxxgl) result.length > 3 ? result += "、毛细血管瘤" : result += "毛细血管瘤";
if (skin.bk) result.length > 3 ? result += "、包块" : result += "包块";
if (skin.yz) result.length > 3 ? result += "、硬肿" : result += "硬肿";
if (skin.hz) result.length > 3 ? result += "、红肿" : result += "红肿";
if (skin.ch) result.length > 3 ? result += "、潮红" : result += "潮红";
if (skin.ml) result.length > 3 ? result += "、糜烂" : result += "糜烂";
if (skin.pz) result.length > 3 ? result += "、皮疹" : result += "皮疹";
if (skin.cxd) result.length > 3 ? result += "、出血点" : result += "出血点";
if (skin.yb) result.length > 3 ? result += "、瘀斑" : result += "瘀斑";
if (skin.zdtblbq) result.length > 3 ? result += "、增大的体表淋巴结" : result += "增大的体表淋巴结";
if (skin.kjmfy) result.length > 3 ? result += "、卡介苗接种反应" : result += "卡介苗接种反应";
if (skin.qt) {
result.length > 3 ? result += "、其他" : result = "其他";
if (skin.qtText && skin.qtText !== "") {
result += ":" + skin.qtText;
}
}
self.setData({
skin: result
})
}
}
//胸部
if (str == "chest" ) {
var chest = JSON.parse(data);
if (chest.yesOrNo === "no") {
self.setData({
chest: "无"
})
}
if (chest.yesOrNo === "yes") {
var result = "有:"
if (chest.qtText) {
result += ":" + chest.qtText;
}
self.setData({
chest: result
})
}
}
// 颈部
if ( str == "neck") {
var neck = JSON.parse(data);
if (neck.yesOrNo === "no") {
self.setData({
neck: "无"
})
}
if (neck.yesOrNo === "yes") {
var result = "有:"
if (neck.qtText) {
result += neck.qtText;
}
self.setData({
neck: result
})
}
}
//portaGenitals肛门/外生殖器
if (str == "portaGenitals"){
var portaGenitals = JSON.parse(data);
if (portaGenitals.yesOrNo === "no") {
self.setData({
portaGenitals: "未见异常"
})
}
if (portaGenitals.yesOrNo === "yes") {
var result= "异常:";
if (portaGenitals.ynsz) result.length > 3 ? result += "、阴囊水肿" : result += "阴囊水肿";
if (portaGenitals.xmjy) {
result.length > 3 ? result += "、鞘膜积液" : result += "鞘膜积液";
if (portaGenitals.xmjyStatus && portaGenitals.xmjyStatus != "") {
if (portaGenitals.xmjyStatus == "1") {
result += "(左侧)";
}
if (portaGenitals.xmjyStatus == "2") {
result += "(右侧)";
}
if (portaGenitals.xmjyStatus == "3") {
result += "(双侧)";
}
}
}
if (portaGenitals.ndxy) result.length > 3 ? result += "、尿道下裂" : result += "尿道下裂";
if (portaGenitals.fggs) result.length > 3 ? result += "、腹股沟疝" : result += "腹股沟疝";
if (portaGenitals.yg) {
result.length > 3 ? result += "、隐睾" : result += "隐睾";
if (portaGenitals.ygStatus && portaGenitals.ygStatus != "") {
if (portaGenitals.ygStatus == "1") {
viewData.ygStatus += "(左侧)";
}
if (portaGenitals.ygStatus == "2") {
result += "(右侧)";
}
if (portaGenitals.ygStatus == "3") {
result += "(双侧)";
}
}
}
if (portaGenitals.ycnx) result.length > 3 ? result += "、阴唇粘连" : result += "阴唇粘连";
if (portaGenitals.qt) {
result.length > 3 ? result += "、其他" : result += "其他";
if (portaGenitals.qtText && portaGenitals.qtText !== "") {
result += ":" + portaGenitals.qtText;
}
}
self.setData({
portaGenitals: result
})
}
}
//stoopStatus 可疑佝偻病症状
if (str == "stoopStatus") {
var stoopStatus = JSON.parse(data);
if (stoopStatus.yesOrNo === "no") {
self.setData({
stoopStatus: "无"
})
}
if (stoopStatus.yesOrNo === "yes") {
var result= "有:";
if (stoopStatus.yj) result.length > 2 ? result += "、夜惊" : result += "夜惊";
if (stoopStatus.dh) result.length > 2 ? result += "、多汗" : result += "多汗";
if (stoopStatus.fz) result.length > 2 ? result += "、烦躁" : result += "烦躁";
if (stoopStatus.qt) {
result.length > 2 ? result += "、其他" : result += "其他";
if (stoopStatus.qtText && stoopStatus.qtText !== "") {
result += ":" + stoopStatus.qtText;
}
}
self.setData({
stoopStatus: result
})
}
}
//stoopSign 可疑佝偻病体征
if (str == "stoopSign") {
var stoopSign = JSON.parse(data);
if (stoopSign.yesOrNo === "no") {
self.setData({
stoopSign: "无"
})
}
if (stoopSign.yesOrNo === "yes") {
var result = "有:";
if (stoopSign.rgrh) result.length > 2 ? result += "、颅骨软化" : result += "颅骨软化";
if (stoopSign.fl) result.length > 2 ? result += "、方颅" : result += "方颅";
if (stoopSign.zl) result.length > 2 ? result += "、枕秃" : result += "枕秃";
if (stoopSign.lcz) result.length > 2 ? result += "、肋串珠" : result += "肋串珠";
if (stoopSign.lwf) result.length > 2 ? result += "、肋外翻" : result += "肋外翻";
if (stoopSign.lrgg) result.length > 2 ? result += "、肋软骨沟" : result += "肋软骨沟";
if (stoopSign.jx) result.length > 2 ? result += "、鸡胸" : result += "鸡胸";
if (stoopSign.szz) result.length > 2 ? result += "、手镯征" : result += "手镯征";
if (stoopSign.zzz) result.length > 2 ? result += "、足镯征" : result += "足镯征";
if (stoopSign.oxt) result.length > 2 ? result += "、O型腿" : result += "O型腿";
if (stoopSign.xxt) result.length > 2 ? result += "、X型腿" : result += "X型腿";
if (stoopSign.qt) {
result.length > 2 ? result += "、其他" : result += "其他";
if (stoopSign.qtText && stoopSign.qtText !== "") {
result += ":" + stoopSign.qtText;
}
}
self.setData({
stoopSign: result
})
}
}
//髋关节筛查
if (str == "hipJoint") {
var hipJoint = JSON.parse(data);
if (hipJoint.select === "1") {
self.setData({
hipJoint: "未见明显异常"
})
}
if (hipJoint.select === "2") {
self.setData({
hipJoint: "接近正常"
})
}
if (hipJoint.select === "3") {
self.setData({
hipJoint: "异常"
})
if (hipJoint.qtText && hipJoint.qtText !== "") {
self.setData({
hipJoint: self.data.hipJoint + ":" + hipJoint.qtText
})
}
}
}
}
}
})