caixing200 5 년 전
부모
커밋
20de82a74c
2개의 변경된 파일64개의 추가작업 그리고 17개의 파일을 삭제
  1. 18 4
      whepi-ui/templates/home/ribao.ftl
  2. 46 13
      whepi-ui/templates/home/ribao.js

+ 18 - 4
whepi-ui/templates/home/ribao.ftl

@@ -83,12 +83,26 @@
                                        maxlength="3"
                                        style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px; width: 25%; text-align: center;"/>
                             </div>
-                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 5px;">
-                                <div style="color: gray;height: 30px; line-height: 30px; width: 35%;">体温</div>
+                            <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 10px;">
+                                <div style="color: gray;height: 30px; line-height: 30px; flex:8;">体温</div>
+                                <div class="weui-cells_checkbox" style="flex: 7">
+                                    <label class="weui-radio weui-cell_active weui-check__label" for="s60" style="padding: 10px 0 10px 10px;">
+                                        <input type="radio" name="radio5" value="0" class="weui-check" id="s60"
+                                               style="width: 10%"/>
+                                        <i class="weui-icon-checked"></i>正常
+                                    </label>
+                                    <label class="weui-radio weui-cell_active weui-check__label" for="s61" style="padding: 10px 0 10px 10px;">
+                                        <input type="radio" name="radio5" value="1" class="weui-check" id="s61"
+                                               style="width: 10%"/>
+                                        <i class="weui-icon-checked"></i>异常
+                                    </label>
+                                </div>
+                            </div>
+                            <div>
                                 <input id="js_input_user_tiwen" class="weui-input" autofocus="" type="number"
-                                       placeholder="请输入"
+                                       placeholder="请输入体温"
                                        maxlength="4"
-                                       style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                                       style="display: none;border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
                             </div>
 
                             <div id="ribao_jbqk" style="display: none;">

+ 46 - 13
whepi-ui/templates/home/ribao.js

@@ -931,7 +931,8 @@ function ribao_cell(v) {
     if (v.singleRoom == 0 && v.medical != 0)
       singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
   }
-  var temperature = "体温:" + v.temperature + ";<br/>";
+  var tempTemperature = v.temperature>37.2?'异常,'+v.temperature+'度':'正常';
+  var temperature = "体温:" + tempTemperature + ";<br/>";
   var cough = "";
   if (v.cough != 0)
     cough = "咳嗽现象:" + getCough(v.cough) + ";<br/>";
@@ -1041,6 +1042,7 @@ function ribao_add() {
 
       $("input[id='s40']").prop("checked", "checked");
       $("input[id='s50']").prop("checked", "checked");
+      $("input[id='s60']").prop("checked", "checked");
 
 
     $("#switchQuezhen").val(getMedical(0));
@@ -1284,13 +1286,14 @@ function ribaoCommit() {
   }
   cantijiao = false
   // //判断是否获取到定位
-
-  if (longitude == '' && latitude =='') {
-    cantijiao = true;
-    $.alert("请检查是否开启手机定位和微信定位");
-    return;
+  var hrefs = location.href
+  if(!/http:\/\/127\.0\.0\.1/.test(hrefs)){
+    if (longitude == '' && latitude =='') {
+      cantijiao = true;
+      $.alert("请检查是否开启手机定位和微信定位");
+      return;
+    }
   }
-
   // if (autoLocal == '') {
   //   cantijiao = true;
   //   $.alert("请先设置微信获取当前位置");
@@ -1437,6 +1440,11 @@ function ribaoCommit() {
     $.alert("请填写正确的体温");
     return;
   }
+  if (temperature > 30 && temperature < 37.3) {
+    $("#js_input_user_tiwen").hide();
+    $("input[radio='s61']").removeAttr("checked");
+    $("input[radio='s60']").prop("checked", "checked");
+  }
 
   if(medical == 1 && medicalState == 0 && cough ==0 && muscle == 0 && dyspnea == 0 && fatigue == 0 && diarrhea == 0 && !others){
     $("input[id='s18']").prop("checked", "checked");
@@ -1703,7 +1711,7 @@ function updateSuspected(suspectedId) {
     userFamilyStatus = ''
     userFamilyStatusStr = ''
   //病情
-  var ids = ['js_input_user_xinguan_view','js_input_user_kesou_view','js_input_user_jirou_view','js_input_user_huxi_view','js_input_user_fali_view','js_input_user_fuxie_view','shuruqita_view'];
+  var ids = ['js_input_user_tiwen','js_input_user_xinguan_view','js_input_user_kesou_view','js_input_user_jirou_view','js_input_user_huxi_view','js_input_user_fali_view','js_input_user_fuxie_view','shuruqita_view'];
   //接触史
   var ids2 = ['isContactView','isSuspectedView'];
 
@@ -1817,6 +1825,14 @@ function updateSuspected(suspectedId) {
           $("input[id='s51']").prop("checked", "checked");
         }
 
+        if(suspected.temperature > 37.2){
+          $("input[id='s61']").prop("checked", "checked");
+          $("#js_input_user_tiwen").show();
+        }else {
+          $("input[id='s60']").prop("checked", "checked");
+          $("#js_input_user_tiwen").hide();
+        }
+
 
 
         // $("#switchQuezhen").val(getMedical(suspected.medical));
@@ -1825,7 +1841,7 @@ function updateSuspected(suspectedId) {
         $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
         $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
 
-        $("#js_input_user_tiwen").val(36.5);
+        $("#js_input_user_tiwen").val(suspected.temperature||36.5);
 
         $("#js_input_user_xinguan").val(getXinguan(suspected.medicalState||0));
         $("#js_input_user_xinguan").attr("data-values", suspected.medicalState||0);
@@ -2054,7 +2070,8 @@ function helpValue1(v) {
     if (v.singleRoom == 0 && v.medical != 0)
       singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
   }
-  var temperature = "体温:" + v.temperature + ";<br/>";
+  var tempTemperature = v.temperature>37.2?'异常,'+v.temperature+'度':'正常';
+  var temperature = "体温:" + tempTemperature + ";<br/>";
   var cough = "";
   if (v.cough != 0)
     cough = "咳嗽现象:" + getCough(v.cough) + ";<br/>";
@@ -2325,7 +2342,7 @@ function getDiarrhea(diarrhea) {
 function clearShow() {
   console.log("qingkong")
   //病情
-  var ids = ['js_input_user_xinguan_view','js_input_user_kesou_view','js_input_user_jirou_view','js_input_user_huxi_view','js_input_user_fali_view','js_input_user_fuxie_view','shuruqita_view'];
+  var ids = ['js_input_user_tiwen','js_input_user_xinguan_view','js_input_user_kesou_view','js_input_user_jirou_view','js_input_user_huxi_view','js_input_user_fali_view','js_input_user_fuxie_view','shuruqita_view'];
   ids.forEach(iv=>{
     $('#'+iv).hide()
   })
@@ -2408,6 +2425,8 @@ function clearShow() {
   $("input[id='s41']").removeAttr("checked");
   $("input[id='s50']").removeAttr("checked");
   $("input[id='s51']").removeAttr("checked");
+  $("input[id='s60']").removeAttr("checked");
+  $("input[id='s61']").removeAttr("checked");
 
   resetTravelState(true)
 }
@@ -2540,8 +2559,6 @@ function initRadioEvent() {
         $("#switchDanjiangeli").val(getSingleRoom(0));
         $("#switchDanjiangeli").attr("data-values", 0);
 
-        $("#js_input_user_tiwen").val(36.5);
-
         $("#js_input_user_xinguan").val(getXinguan(0));
         $("#js_input_user_xinguan").attr("data-values", 0);
 
@@ -2627,6 +2644,22 @@ function initRadioEvent() {
     var state = this.value
     resetTravelState(state == 0)
   })
+
+  //体温
+  $('input[name="radio5"]').on('change',function () {
+    var state = this.value
+    resetTiwen(state == 0)
+  })
+}
+
+function resetTiwen(bool) {
+  if(bool){
+    $("#js_input_user_tiwen").hide('fast');
+    $("#js_input_user_tiwen").val(36.5);
+  }else {
+    $("#js_input_user_tiwen").show('fast');
+    $("#js_input_user_tiwen").val('');
+  }
 }