yaowei.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. function queryList4(page,pageSize) {
  2. //显示进度条
  3. // plus.nativeUI.showWaiting();
  4. //发送请求
  5. queryListByType(4,page, pageSize, queryListSuccesss3,begindate,enddate);
  6. }
  7. /**
  8. * 腰围
  9. * 健康指标图表查询成功处理方法
  10. */
  11. function queryListSuccesss3(res) {
  12. if (res.status == 200) {
  13. d.close();
  14. if (res.list.length > 0) {
  15. //成功
  16. showList3(res.list);
  17. if(res.list.length<10){
  18. $("#view_more4").hide();
  19. }else{
  20. $("#view_more4").show();
  21. }
  22. }else{
  23. //无更多数据
  24. $("#view_more4").hide();
  25. }
  26. }else {
  27. //非200则为失败
  28. queryListFailed(res);
  29. }
  30. // plus.nativeUI.closeWaiting();
  31. }
  32. /**
  33. * 显示查询结果
  34. * @param {Object} list
  35. */
  36. function showList3(list) {
  37. page =page+1;
  38. // clearHTML();
  39. for (var i = 0; i < list.length; i++) {
  40. var data = list[i];
  41. if (!data) {
  42. continue;
  43. }
  44. addRow3(data.date.substr(5, 5), toIntValue(data.value1));
  45. }
  46. setTimeout(function () {
  47. scroller1.myScroll.refresh();
  48. }, 1000);
  49. }
  50. /**
  51. * 腰围
  52. * tbody添加一行tr
  53. * @param {Object} dateStr
  54. * @param {Object} value1
  55. * @param {Object} value2
  56. */
  57. function addRow3(dateStr, value1) {
  58. if (dateStr.length > 5) {
  59. dateStr = dateStr.substr(5, 5);
  60. }
  61. if(dateStr){
  62. dateStr = dateStr.replace("-",".");
  63. }
  64. var tb = document.querySelector("#item3");
  65. var tr = document.createElement("tr");
  66. var html = '<td class="width-30 c-color">' + dateStr + '</td>';
  67. html += '<td class="width-70 c-color">' + value1 + '</td>';
  68. tr.innerHTML = html;
  69. tb.appendChild(tr);
  70. }