health1.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  3. <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
  4. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  5. <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
  6. <script type="text/javascript" src="/resources/js/mobile/health.js"></script>
  7. <script>
  8. $.validator.addMethod( "rangeTemperature", function( value, element ) {
  9. var result = true;
  10. if( value > 50 || value < 20 ) {
  11. result = false;
  12. }
  13. return this.optional(element) || result;
  14. }, '<spring:message code="health.alert.bodyTemp" />' );
  15. $( function(){
  16. $( "#healthForm" ).validate({
  17. rules : {
  18. temperature : {
  19. floatNum : true,
  20. floatNumOne : true,
  21. rangeTemperature : true
  22. }
  23. },
  24. focusInvalid: false,
  25. messages : {
  26. temperature : {
  27. floatNum : '<spring:message code="health.alert.numberFormat" />'
  28. }
  29. },
  30. onkeyup: function( element, event ) {
  31. // $( "div.error-msg" ).text( "" );
  32. // $( element ).valid();
  33. },
  34. onfocusout: function (element) {
  35. // $( "div.error-msg" ).text( "" );
  36. $( element ).valid();
  37. $( "div.error-msg" ).focus();
  38. },
  39. errorPlacement: function(error, element) {
  40. console.log( error );
  41. $( "div.error-msg" ).text("").append( error );
  42. $( "div.error-msg" ).focus();
  43. },
  44. submitHandler: function(form) {
  45. var temperature = $.trim( $( "input[name='temperature']" ).val() );
  46. var flag = true;
  47. if( temperature.length == 0 ) {
  48. document.body.scrollTop = document.body.scrollHeight;
  49. $( "div.error-msg" ).empty().text( '<spring:message code="health.enter.temperature" />' );
  50. flag = false;
  51. }
  52. if( flag ){
  53. $( "#phrValue" ).val( temperature );
  54. $( "button[type='submit'].confirm" ).prop( "disabled", true ).css("background", "#DBDBDB");
  55. form.submit();
  56. }
  57. $( "div.error-msg" ).focus();
  58. scrollDown();
  59. }
  60. });
  61. // if( isMobile() ){
  62. // if( checkDevice() == "ios" ) {
  63. // $("#bluetoothBtn").hide();
  64. // }
  65. // } else {
  66. // alert("App에서만 사용가능한 기능입니다.");
  67. // }
  68. // $( "input[name='temperature']" ).click( function(){
  69. // document.body.scrollTop = document.body.scrollHeight;
  70. // });
  71. });
  72. /*
  73. * 블루투스 기기연동 이벤트 처리를 위한 변수 정의
  74. * 공통 이벤트 처리는 -> health.js
  75. */
  76. var phrLocalStorageName = "bluetoothHealth1";
  77. var phrCallBackType = "thermometer";
  78. </script>
  79. <style>
  80. /* Rounded sliders */
  81. .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s;}
  82. .slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; -webkit-transition: .4s; transition: .4s;}
  83. input:checked + .slider { background-color: #2196F3;}
  84. input:focus + .slider { box-shadow: 0 0 1px #2196F3;}
  85. input:checked + .slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px);}
  86. .slider.round {border-radius: 34px;}
  87. .slider.round:before {border-radius: 50%;}
  88. div.bluetooth{font-size:18px;font-weight:600;padding:20px 0;border-bottom:1px solid #dddddd;text-align:center;}
  89. div.bluetooth .switch {position: relative;display: inline-block;width: 60px;height: 34px;margin:0 10px;}
  90. div.bluetooth .switch input {opacity: 0;width: 0;height: 0;}
  91. div.bluetooth span.insert-type{cursor:pointer;vertical-align:middle;font-weight:600;}
  92. div.bluetooth span.readonly{color:#999999;font-weight:500;}
  93. .examination .history {text-align: center;
  94. padding-bottom: 15px;
  95. border-bottom: 1px solid #ddd;
  96. margin-top: 15px;}
  97. .examination .history a {padding: 10px 15px}
  98. .error-msg{padding:5px;outline:none;}
  99. </style>
  100. </head>
  101. <body>
  102. <div id="sub">
  103. <div class="container">
  104. <div class="header">
  105. <div class="previous">
  106. <a href="/mobile/menu"><spring:message code="header.previous" /></a>
  107. </div>
  108. <div class="title"><spring:message code="title.healthRecord" /></div>
  109. </div>
  110. <div class="device_tab">
  111. <ul>
  112. <li>
  113. <a href="./1" class="one active" title="체온 (body temperature)">
  114. <span aria-hidden="true"><spring:message code="health.tab.bodyTemp" /></span>
  115. <!-- <span class="eng" aria-hidden="true">body temperature</span> -->
  116. </a>
  117. </li>
  118. <li>
  119. <a href="./2" class="two" title="혈압/맥박수 (blood pressure/heart rate)">
  120. <span aria-hidden="true"><spring:message code="health.tab.bloodPh" /></span>
  121. <!-- <span class="eng" aria-hidden="true">blood pressure/heart rate</span> -->
  122. </a>
  123. </li>
  124. <li>
  125. <a href="./3" class="three" title="산소포화도 (oxygen)">
  126. <span aria-hidden="true"><spring:message code="health.tab.oxygen" />
  127. <!-- </span><span class="eng" aria-hidden="true">oxygen</span> -->
  128. </a>
  129. </li>
  130. <li>
  131. <a href="./4" class="four" title="혈당 (blood sugar)">
  132. <span aria-hidden="true"><spring:message code="health.tab.bloodSugar" /></span>
  133. <!-- <span class="eng" aria-hidden="true">blood sugar</span> -->
  134. </a>
  135. </li>
  136. <li>
  137. <a href="./5" class="five" title="임상증상 (symptom)">
  138. <span aria-hidden="true"><spring:message code="health.tab.symptom" /></span>
  139. <!-- <span class="eng" aria-hidden="true">symptom</span> -->
  140. </a>
  141. </li>
  142. <li>
  143. <a href="./6" class="six" title="정신건강 (mental health)">
  144. <span aria-hidden="true"><spring:message code="health.tab.mental" /></span>
  145. <!-- <span class="eng" aria-hidden="true">mental health</span> -->
  146. </a>
  147. </li>
  148. </ul>
  149. </div>
  150. <div id="bluetoothBtn" class="examination">
  151. <div class="history">
  152. <a href="javascript:;" onclick="phrValue( 'getPhrValue', phrCallBackType );"><spring:message code="health.bluetooth" /></a>
  153. </div>
  154. </div>
  155. <!-- <div class="bluetooth"> -->
  156. <!-- <span class="insert-type direct">직접입력</span> -->
  157. <!-- <label class="switch"> -->
  158. <!-- <input type="checkbox" class="checkbt" id="bluetooth-checkbox"> -->
  159. <!-- <span class="slider round"></span> -->
  160. <!-- </label> -->
  161. <!-- <span class="insert-type device">기기연동</span> -->
  162. <!-- </div> -->
  163. <form id="healthForm" method="post" action="./insert">
  164. <div class="health">
  165. <div class="part">
  166. <div class="title"><spring:message code="health.date" /></div>
  167. <div class="input day">
  168. <!-- <a href="javascript:;" data-popup-open="popup-calendar">d</a> -->
  169. <input type="text" class="datePicker form-control" readonly>
  170. </div>
  171. </div>
  172. <div class="part">
  173. <div class="title"><spring:message code="health.time" /></div>
  174. <div class="input time">
  175. <!-- <a href="javascript:;" data-popup-open="popup-time">d</a> -->
  176. <input type="text" class="timePicker" readonly>
  177. </div>
  178. </div>
  179. <div class="part tac mt30">
  180. <div class="title"><spring:message code="health.enter.temperature" /></div>
  181. <!-- <div class="title">(Please enter your body temperature)</div> -->
  182. <div class="input time">
  183. </div>
  184. </div>
  185. <div class="data unlink">
  186. <div class="point">
  187. <input type="number" class="" name="temperature" placeholder="--"> ℃
  188. </div>
  189. </div>
  190. <div class="error-msg tac mt20 error" tabindex="0"></div>
  191. </div>
  192. <div class="btn_group">
  193. <ul>
  194. <li>
  195. <input type="hidden" name="phrType" value="temperature">
  196. <input type="hidden" id="phrValue" name="phrValue" value="">
  197. <button type="submit" class="confirm" onclick='$( "div.error-msg" ).empty();'><span class="check"><spring:message code="health.submit" /></span></button>
  198. </li>
  199. </ul>
  200. </div>
  201. </form>
  202. </div>
  203. </div>
  204. </body>
  205. </html>