//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" }
],
titles: ["问诊检查", "儿科检查", "一般检查", "辅助检查"],
current_index:0,
//问诊检查
main_foster:"",
feed_type: "",
pee: "",
excrement: "",
sleep: "",
activity: "",
vitamin_d: "",
assist_food: "",
home_measure: "",
drug_gllergic: "",
morbidity: "",
other_text_wz: "",
},
onLoad: function (e) {
patientId = app.globalData.userId[0]
checkTime="2017-08-10"
// 数据初始化
var self=this
this.setData({
current_index: e.option.current_index
})
if (this.data.current_index==0){
this.requestDataWZ()
}
},
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'
})
},
titleClick:function(e){
// console.log(e)
var self=this
var current_index = e.currentTarget.dataset.index
this.setData({
current_index: current_index,
})
// this.requestData()
},
/*---------自定义函数--------*/
requestDataWZ(){
var self = this
isRefresh = true
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)
isRefresh = false
var arr = []
if(page > 1) {// 加载更多模式
arr = self.data.list
}
if (res.data.list.length < pageLimit){
hasMore = false
}else{
hasMore = true
}
arr = arr.concat(res.data.list)
self.setData({
list:arr,
hasMore: hasMore
})
},function(res){
isRefresh = false
})
},
})