health-index.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>健康指标</title>
  6. <meta name="author" content="yihu.com" />
  7. <meta name="format-detection" content="telephone=no" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  9. <meta name="apple-mobile-web-app-capable" content="yes" />
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  11. <link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
  12. <link rel="stylesheet" href="../../../css/cross.ui.css" type="text/css" />
  13. <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
  14. <link rel="stylesheet" type="text/css" href="../css/ss-style.css">
  15. <script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
  16. <script type="text/javascript" src="../../../js/mui.min.js"></script>
  17. <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
  18. <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
  19. <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
  20. </head>
  21. <body>
  22. <div class="main">
  23. <div class="h45">
  24. <div class="demo-comtop">
  25. <!--<a class="mui-action-back"></a>-->
  26. <h1 class="c-f18">最近一次记录如下</h1>
  27. </div>
  28. </div>
  29. <div class="bgc-fff c-border-b mb20">
  30. <ul class="n-list tz-record-list" id="index_list">
  31. <li class="n-list-function n-list-link list-arrow-r" data-href='health-index-bloodsugar-'>
  32. <div class="n-list-key">
  33. <div class="n-avatar-m health-border-1">血糖</div>
  34. </div>
  35. <div class="n-list-flex ptb12">
  36. <div class="n-list-info">
  37. <div onclick="window.open('health-index-bloodsugar-chart.html')"id="zb_xt" class="c-t-right c-f18 pr10 c-909090">请先进行记录</div>
  38. </div>
  39. </div>
  40. </li>
  41. <li class="n-list-function n-list-link list-arrow-r" data-href='health-index-bloodpressure-'>
  42. <div class="n-list-key">
  43. <div class="n-avatar-m health-border-2">血压</div>
  44. </div>
  45. <div class="n-list-flex">
  46. <div class="n-list-info">
  47. <div onclick="window.open('health-index-bloodpressure-chart.html')" id="zb_xy" class="c-t-right c-f18 pr10 c-909090">请先进行记录</div>
  48. </div>
  49. </div>
  50. </li>
  51. <li class="n-list-function n-list-link list-arrow-r" data-href='health-index-weight-'>
  52. <div class="n-list-key">
  53. <div class="n-avatar-m health-border-6">体重</div>
  54. </div>
  55. <div class="n-list-flex">
  56. <div class="n-list-info">
  57. <div onclick="window.open('health-index-weight-chart.html')"id="zb_tz" class="c-t-right c-f18 pr10 c-909090">请先进行记录</div>
  58. </div>
  59. </div>
  60. </li>
  61. <li class="n-list-function n-list-link list-arrow-r" data-href='health-index-waistline-'>
  62. <div class="n-list-key">
  63. <div class="n-avatar-m health-border-4">腰围</div>
  64. </div>
  65. <div class="n-list-flex">
  66. <div class="n-list-info">
  67. <div onclick="window.open('health-index-waistline-chart.html')"id="zb_yw" class="c-t-right c-f18 pr10 c-909090">请先进行记录</div>
  68. </div>
  69. </div>
  70. </li>
  71. </ul>
  72. </div>
  73. </div>
  74. </body>
  75. <script type="text/javascript" src="../../../js/common_http.js" ></script>
  76. <script type="text/javascript" src="../../../js/weixin_common.js" ></script>
  77. <script type="text/javascript">
  78. var d = dialog({contentType:'load', skin:'bk-popup'});
  79. var pagetype = 8;
  80. $(function() {
  81. checkUserAgent();
  82. });
  83. function queryInit(){
  84. d.show();
  85. sendPost("patient/health_index/recent", "","JSON","POST" ,queryFailed, success);
  86. }
  87. function success(data){
  88. if(data.status!=-1){
  89. var D_booldsugar = null;
  90. var D_booldpressure = null;
  91. var D_weight = null;
  92. var D_waisline = null;
  93. for(var i=0; i < data.list.length; i++){
  94. var listee = data.list[i];
  95. if(listee.type == 1){
  96. D_booldsugar = listee;
  97. }else if(listee.type == 2){
  98. D_booldpressure = listee;
  99. }else if(listee.type == 3){
  100. D_weight = listee;
  101. }else{
  102. D_waisline = listee;
  103. }
  104. }
  105. if(D_booldsugar==null || D_booldsugar==""){
  106. $("#zb_xt").html("请先进行记录");
  107. }else{
  108. if(D_booldsugar.value1){
  109. $("#zb_xt").html("空腹血糖值:" + toIntValue(D_booldsugar.value1)+"mmol/L");
  110. };
  111. if(D_booldsugar.value2){
  112. $("#zb_xt").html("早餐后血糖值:" + toIntValue(D_booldsugar.value2)+"mmol/L");
  113. };
  114. if(D_booldsugar.value3){
  115. $("#zb_xt").html("午餐前血糖值:" + toIntValue(D_booldsugar.value3)+"mmol/L");
  116. };
  117. if(D_booldsugar.value4){
  118. $("#zb_xt").html("午餐后血糖值:" + toIntValue(D_booldsugar.value4)+"mmol/L");
  119. };
  120. if(D_booldsugar.value5){
  121. $("#zb_xt").html("晚餐前血糖值:" + toIntValue(D_booldsugar.value5)+"mmol/L");
  122. };
  123. if(D_booldsugar.value6){
  124. $("#zb_xt").html("晚餐后血糖值:" + toIntValue(D_booldsugar.value6)+"mmol/L");
  125. };
  126. if(D_booldsugar.value7){
  127. $("#zb_xt").html("睡前血糖值:" + toIntValue(D_booldsugar.value7)+"mmol/L");
  128. };
  129. }
  130. if(D_booldpressure==null || D_booldpressure==""){
  131. $("#zb_xy").html("请先进行记录");
  132. }else{
  133. $("#zb_xy").html("收缩压:" + toIntValue(D_booldpressure.value1) + "mmHg<br />舒张压:" + toIntValue(D_booldpressure.value2) + "mmHg");
  134. }
  135. if(D_weight==null || D_weight==""){
  136. $("#zb_tz").html("请先进行记录");
  137. }else{
  138. $("#zb_tz").html(toIntValue(D_weight.value1)+"kg");
  139. }
  140. if(D_waisline==null || D_waisline==""){
  141. $("#zb_yw").html("请先进行记录");
  142. }else{
  143. $("#zb_yw").html(toIntValue(D_waisline.value1)+"cm");
  144. }
  145. d.close().remove();
  146. }else{
  147. queryFailed(data);
  148. }
  149. }
  150. function queryFailed(res) {
  151. d.close().remove();
  152. if (res && res.msg) {
  153. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg}).show();
  154. } else {
  155. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'加载失败'}).show();
  156. }
  157. }
  158. function toIntValue(value){
  159. if(parseInt(value) == value){
  160. return parseInt(value);
  161. }else{
  162. return Math.round(value*Math.pow(10, 1))/Math.pow(10, 1);
  163. }
  164. }
  165. </script>
  166. </html>