123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- function queryList3(page,pageSize) {
- //显示进度条
- // plus.nativeUI.showWaiting();
- //发送请求
- queryListByType(3,page, pageSize, queryListSuccesss2,begindate,enddate);
- }
- /**
- * 健康指标图表查询成功处理方法
- */
- function queryListSuccesss2(res) {
- if (res.status == 200) {
- d.close();
- if (res.list.length > 0) {
- //成功
- showList2(res.list);
- if(res.list.length<10){
- $("#view_more3").hide();
- }else{
- $("#view_more3").show();
- }
- }else{
- //无更多数据
- $("#view_more3").hide();
-
- }
- } else {
- //非200则为失败
- queryListFailed(res);
- }
- // plus.nativeUI.closeWaiting();
- }
-
- /**
- * 显示查询结果
- * @param {Object} list
- */
- function showList2(list) {
- page = page+1;
- for (var i = 0; i < list.length; i++) {
- var data = list[i];
- if (!data) {
- continue;
- }
- addRow2(data.date.substr(5, 5), toIntValue(data.value1));
- }
- setTimeout(function () {
- scroller1.myScroll.refresh();
- }, 1000);
- }
-
- /**
- * 体重
- * tbody添加一行tr
- * @param {Object} dateStr
- * @param {Object} value1
- * @param {Object} value2
- */
- function addRow2(dateStr, value1) {
- if (dateStr.length > 5) {
- dateStr = dateStr.substr(5, 5);
- }
- if(dateStr){
- dateStr = dateStr.replace("-",".");
- }
- var tb = document.querySelector("#item2");
- var tr = document.createElement("tr");
- var html = '<td class="width-30 c-color">' + dateStr + '</td>';
- html += '<td class="width-70 c-color">' + value1 + '</td>';
- tr.innerHTML = html;
- tb.appendChild(tr);
- }
|