patientEval_detail.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. mui.plusReady(function() {
  2. // mui(".c-list").on("tap", "li", function() {
  3. // openWebview("my-doctor-advice-detail.html");
  4. // });
  5. //查询列表
  6. clearHTML();
  7. queryList();
  8. });
  9. function queryList() {
  10. plus.nativeUI.showWaiting();
  11. //拼请求内容
  12. var params = {};
  13. params.id = 0;
  14. params.pagesize = 10;
  15. //发送ajax请求
  16. sendPost(server+"doctor/comments", params,queryListFailed, queryListSuccesss);
  17. }
  18. function queryListFailed(res) {
  19. if (res && res.msg) {
  20. plus.nativeUI.toast(res.msg);
  21. } else {
  22. plus.nativeUI.toast("数据加载失败");
  23. }
  24. plus.nativeUI.closeWaiting();
  25. }
  26. function queryListSuccesss(res) {
  27. if (res.status == 200) {
  28. //成功
  29. showList(res.list);
  30. } else {
  31. //非200则为失败
  32. queryListFailed(res);
  33. }
  34. plus.nativeUI.closeWaiting();
  35. }
  36. /**
  37. * 清空tbody
  38. */
  39. function clearHTML() {
  40. $("#patient_evaluate").html("");
  41. }
  42. /**
  43. * 显示查询结果
  44. * @param {Object} list
  45. */
  46. function showList(list) {
  47. // clearHTML();
  48. var _html = "";
  49. for (var i = 0; i < list.length; i++) {
  50. var data = list[i];
  51. if (!data) {
  52. continue;
  53. }
  54. _html+="<li class='mt10'>"
  55. _html+= "<div class='tit-box clearfix bgc-f7f7f7 plr15 ptb10 c-border-tb c-f13'><span class='fl'>"+data.name+"</span><span class='fr'><span class='c-909090 mr10'>未分组</span>"+data.czrq+"</span></div>"
  56. _html+= "<div class='eval-box clearfix plr15 ptb10 bgc-fff c-909090 c-f13 c-border-b'>"
  57. _html+= "<span class='fl'>疾病:<span class='c-4dcd70'>咳</span></span>"
  58. _html+= "<span class='fr'>"
  59. _html+= "<span class='mr10'>态度:<span class='c-4dcd70'>好</span></span>"
  60. _html+= "<span>疗效:<span class='c-4dcd70'>满意</span></span>"
  61. _html+= "</span>"
  62. _html+= "</div>"
  63. _html+= "<div class='info-box plr15 ptb10 c-f5b5b5b c-f14 bgc-fff c-border-b'>"
  64. _html+= "<span>"+data.content+"</span>"
  65. _html+= "</div>"
  66. _html+= "<div class='recommend-box plr15 ptb10 bgc-fff c-border-b clearfix c-f13'>"
  67. _html+= "<span class='fr c-909090'><img src='../images/pjjl-01/zt-01-1.png' width='11' height='11' style='margin-top:4px;margin-right:3px;'>推荐<span class='c-ff8100'>+1</span></span>"
  68. _html+= "</div>"
  69. _html+="</li>"
  70. }
  71. $("#patient_evaluate").html(_html);
  72. }
  73. // $("#equ_list").on("click","li",function(){
  74. // var attr_code = $(this).attr('attr_code');
  75. // var attr_name = $(this).attr('attr_name');
  76. // var attr_sn = $(this).attr('attr_sn');
  77. //
  78. // //获取现在有的设备类别以及名称
  79. // var params = {}
  80. // params.code = attr_code;
  81. // var dev_list={};
  82. //
  83. // //发送ajax请求, 查询设备列表信息
  84. // sendPost("patient/device/info", params, "json", "post", queryListFailed,device_info_Successs);
  85. // function device_info_Successs(res){
  86. // var category=res.data.category;
  87. // var type_name='';
  88. // //发送ajax请求, 查询设备类型
  89. // sendPost("patient/device/category"," ", "json", "post", queryListFailed,device_type_Successs);
  90. // function device_type_Successs(reso){
  91. // dev_list=reso.list;
  92. // for(var i=0;i<reso.list.length;i++){
  93. // if(reso.list[i].code==category){
  94. // type_name=reso.list[i].name;
  95. //
  96. // mui.openWindow({
  97. // url: "equipment-detail.html",
  98. // id:"equipment-detail",
  99. // extras: {
  100. // code:attr_code,
  101. // category:category,
  102. // type_name:type_name,
  103. // name:attr_name,
  104. // sn:attr_sn,
  105. // },
  106. // });
  107. //
  108. // }
  109. //
  110. // }
  111. //
  112. // }
  113. ////
  114. ////
  115. // }
  116. //
  117. //
  118. // })
  119. //}
  120. //function li_click(content){
  121. // mui.openWindow({
  122. // url: "my-doctor-advice-detail.html",
  123. // extras: {
  124. // content: content
  125. // },
  126. // });
  127. //}
  128. //
  129. //function addRow(content, czrq) {
  130. // var ul = document.querySelector("#item");
  131. // var li = document.createElement("li");
  132. // li.className = "c-list-text";
  133. // li.onclick = function() {
  134. // mui.openWindow({
  135. // url: "my-doctor-advice-detail.html",
  136. // extras: {
  137. // content: content
  138. // },
  139. // });
  140. // };
  141. //
  142. // var html = '<div class="c-list-info">';
  143. // html += '<h4 class="c-nowrap">' + content + '</h4></div>'
  144. // html += '<div class="c-list-value">' + czrq.substring(0, 10) + '</div>';
  145. //
  146. // li.innerHTML = html;
  147. // ul.appendChild(li);
  148. //}
  149. //添加数据添加监听
  150. window.addEventListener("update_info", function(e) {
  151. clearHTML();
  152. //刷新列表
  153. queryList();
  154. });