health-index-add-bloodpressure.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  5. <meta charset="utf-8">
  6. <title>添加血压</title>
  7. <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
  8. <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
  9. <link rel="stylesheet" type="text/css" href="../css/ss-style.css" />
  10. <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
  11. </head>
  12. <body>
  13. <div class="c-main">
  14. <!--<div class="h45">
  15. <div class="demo-comtop">
  16. <a class="mui-action-back"></a>
  17. <h1>血压</h1>
  18. </div>
  19. </div>-->
  20. <div class="wis-fix c-border-b mt15">
  21. <ul class="c-list patient-list c-border-t mt fosx-li" data-list="patientInfo">
  22. <li>
  23. <div class="c-list-value pr30" style="width: 100px;">
  24. <h4><em class="star"></em>记录时间</h4>
  25. </div>
  26. <div class="c-list-info">
  27. <div class="input-group width-100">
  28. <input type="text" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入记录时间" data-time="date" value="" id="date">
  29. <span class="form-select-arrow"></span>
  30. </div>
  31. </div>
  32. </li>
  33. <li>
  34. <div class="c-list-value pr30" style="width: 100px;">
  35. <h4><em class="star"></em>收缩压(高压)</h4>
  36. </div>
  37. <div class="c-list-info">
  38. <div class="input-group width-100">
  39. <input type="text" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入数值" data-val="weight" value="" id="val_h">
  40. </div>
  41. </div>
  42. </li>
  43. <li>
  44. <div class="c-list-value pr30" style="width: 100px;">
  45. <h4><em class="star"></em>舒张压(低压)</h4>
  46. </div>
  47. <div class="c-list-info">
  48. <div class="input-group width-100">
  49. <input type="text" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入数值" data-val="weight" value="" id="val_l">
  50. </div>
  51. </div>
  52. </li>
  53. </ul>
  54. </div>
  55. <p class="c-f16 c5b plr15 pt10">收缩压 正常范围:<span id="minValue1">90</span>-<span id="maxValue1">139</span>mmHg</p>
  56. <p class="c-f16 c5b plr15 pt10">舒张压 正常范围:<span id="minValue2">60</span>-<span id="maxValue2">89</span>mmHg</p>
  57. <div class="bottom-box clearfix mt20 plr15">
  58. <a href="javascript:;" id="save" class="c-btn-full c-btn-4dcd70 c-btn-radius fl c-f18">保存</a>
  59. </div>
  60. </div>
  61. </body>
  62. <script src="../../../js/jquery/2.1.3/jquery.js"></script>
  63. <script src="../../../widget/mobiscroll/2.15.1/js/mobiscroll.js"></script>
  64. <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
  65. <script src="../../../js/common_http.js"></script>
  66. <script type="text/javascript" src="../../../js/weixin_common.js" ></script>
  67. <link rel="stylesheet" type="text/css" href="../../../widget/mobiscroll/2.15.1/css/mobiscroll.css">
  68. <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
  69. <script type="text/javascript" src="../../../js/mui.min.js"></script>
  70. <script src="../js/health-index.js"></script>
  71. <script>
  72. $(function() {
  73. //queryWarning();
  74. document.getElementById("save").addEventListener("tap", function() {
  75. var record_date = document.getElementById("date").value;
  76. var val_h = document.getElementById("val_h").value;
  77. var val_l = document.getElementById("val_l").value;
  78. if(!record_date){
  79. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'请选择记录时间'}).show();
  80. return ;
  81. }
  82. var p = /^[1-9]([0-9])*$/;
  83. if(!val_h || !p.test(val_h)){
  84. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'请输入收缩压,数值为正整数'}).show();
  85. return ;
  86. }
  87. if(!val_l || !p.test(val_l)){
  88. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'请输入舒张压,数值为正整数'}).show();
  89. return ;
  90. }
  91. //发送请求到服务器
  92. addHealthIndex("", record_date, val_h, val_l, 0, 0, 0, 0, 0, 2, addBloodPressureSuccess);
  93. })
  94. });
  95. $(function() {
  96. /* 选择日期 */
  97. $('input')
  98. var opt1 = {
  99. preset: 'date',
  100. theme: 'ios',
  101. lang: 'zh',
  102. minDate: new Date(1900, 01, 01)
  103. };
  104. $('input[data-time=date]').mobiscroll(opt1);
  105. var opt3 = { //血糖时间段
  106. theme: 'ios',
  107. lang: 'zh',
  108. formatValue: function(d) {
  109. return d.join(',');
  110. },
  111. customWheels: true,
  112. wheels: [
  113. [{
  114. keys: ['1', '2', '3', '4', '5', '6', '7'],
  115. values: ['空腹血糖', '早餐后血糖', '午餐前血糖', '午餐后血糖', '晚餐前血糖', '晚餐后血糖', '睡前血糖']
  116. }]
  117. ],
  118. onSelect: function(valueText, inst) {
  119. console.info(valueText)
  120. var dd = eval("[" + valueText + "]");
  121. $('input[data-val=xuetang]').val(dd[0].values);
  122. },
  123. onShow: function() {
  124. ss.mobiscroll('selectWheel', ['2'], 1000, true);
  125. }
  126. };
  127. var xt = $('input[data-val=xuetang]').mobiscroll(opt3);
  128. })
  129. //查询预警成功
  130. function queryWarningSuccesss(res) {
  131. if (res.status == 200) {
  132. var standard = res.data.standard;
  133. var custom = res.data.custom;
  134. if(custom.length > 0){
  135. for (var i = 0; i < custom.length; i++) {
  136. var list = custom[i];
  137. if(list.type == 2){
  138. document.getElementById("minValue1").innerHTML = list.min_value_1;
  139. document.getElementById("maxValue1").innerHTML = list.max_value_1;
  140. document.getElementById("minValue2").innerHTML = list.min_value_2;
  141. document.getElementById("maxValue2").innerHTML = list.max_value_2;
  142. }
  143. }
  144. }
  145. else{
  146. for (var i = 0; i < standard.length; i++) {
  147. var list = standard[i];
  148. if(list.type == 2){
  149. document.getElementById("minValue1").innerHTML = list.min_value_1;
  150. document.getElementById("maxValue1").innerHTML = list.max_value_1;
  151. document.getElementById("minValue2").innerHTML = list.min_value_2;
  152. document.getElementById("maxValue2").innerHTML = list.max_value_2;
  153. }
  154. }
  155. }
  156. d.close();
  157. } else {
  158. queryListFailed(res);
  159. }
  160. }
  161. </script>
  162. </html>