function querySportList(page,pagesize,begindate,enddate) { //拼请求内容 d.show(); var params = {}; params.page = page; params.pagesize = pagesize; params.start = begindate+" 00:00:00"; params.end = enddate+" 23:59:59"; //发送ajax请求 sendPost("patient/health_record/list_sports", params, "json", "post", queryListFailed, querySportListSuccesss); } /** * 健康指标图表查询成功处理方法 */ function querySportListSuccesss(res) { if (res.status == 200) { d.close(); if (res.list.length > 0) { //成功 showList(res.list); if(res.list.length<10){ $("#view_more_sport").hide(); }else{ $("#view_more_sport").show(); } }else{ //无更多数据 $("#view_more_sport").hide(); } } else { queryListFailed(res); } } /** * 显示查询结果 * @param {Object} list */ function showList(list) { page = page+1; for (var i = 0; i < list.length; i++) { var data = list[i]; if (!data) { continue; } addRowSport(data.record_date, data.sports_time,data.sports_type,data.sports); } setTimeout(function () { scroller1.myScroll.refresh(); }, 1000); } /** * tbody添加一行tr * @param {Object} dateStr * @param {Object} value1 * @param {Object} value2 */ function addRowSport(dateStr, sports_time,sports_type,sports) { var tb = document.querySelector("#sport_list"); var tr = document.createElement("tr"); var html =""; if(dateStr.length > 5){ dateStr = dateStr.substr(5, 5); } if(dateStr){ dateStr = dateStr.replace("-","."); } html+= "