//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: "", otherTextWZ: "", //一般检查 temperature: "", height: "", weight: "", head: "", chestw: "", temperature: "", growthEvaluate: "", //辅助检查 bonez: "", sportsEvaluation: "", hipJoint: "", heartAction: "", hemoglobin: "", whiteCell: "", platelet: "", otherBlood: "", urineProtein: "", urineSugar: "", urineAcetone: "", hematuria:"", other_textFZ:"" }, onLoad: function (e) { patientId = app.globalData.userId[0] 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 // wx.showModal({ // title: title, // content: content, // showCancel: false, // confirmText: '知道了', // confirmColor: '#48C17B' // }) 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) 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, }) }, 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] self.setData({ bonez: result.bonez, sportsEvaluation: result.sportsEvaluation, hipJoint: result.hipJoint, heartAction: result.heartAction, hemoglobin: result.hemoglobin, whiteCell: result.whiteCell, platelet: result.platelet, otherBlood: result.otherBlood, urineProtein: result.urineProtein, urineSugar: result.urineSugar, urineAcetone: result.urineAcetone, hematuria: result.hematuria, other_textFZ: result.otherText, }) }, 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, otherTextEK: result.otherText, }) }, function (res) { }) }, 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, temperature: result.temperature, growthEvaluate: result.growthEvaluate, }) }, function (res) { }) } })