lange 5 anos atrás
pai
commit
51cb200d79

+ 2 - 2
whepi-ui/templates/home/ribao.ftl

@@ -43,7 +43,7 @@
                     <div style="display:flex; flex-direction: row; justify-content: space-between;">
                         <input id="js_input_user_name" class="weui-input" autofocus="" type="text" placeholder="请输入姓名" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 30%; text-align: center;" />
                         <input id="js_input_user_sex" class="weui-input" autofocus="" type="text" placeholder="性别" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 25%; text-align: center;" />
-                        <input id="js_input_user_age" class="weui-input" autofocus="" type="text" placeholder="年龄" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 25%; text-align: center;" />
+                        <input id="js_input_user_age" class="weui-input" autofocus="" type="text" placeholder="年龄" maxlength="3" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 25%; text-align: center;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                         <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">基本状况</div>
@@ -63,7 +63,7 @@
 
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                         <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">体温</div>
-                        <input id="js_input_user_tiwen" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
+                        <input id="js_input_user_tiwen" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="4" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                         <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">咳嗽</div>

+ 5 - 1
whepi-ui/templates/home/ribao.js

@@ -369,7 +369,7 @@ function ribaoCommit() {
     alert("请填写年龄");
     return;
   }
-  if (age.length >= 3) {
+  if (age.length > 3) {
     alert("请填写正确的年龄");
     return;
   }
@@ -381,6 +381,10 @@ function ribaoCommit() {
     alert("请填写体温");
     return;
   }
+  if (temperature.length > 4) {
+    alert("请填写正确的体温");
+    return;
+  }
 
   $.ajax({
     url: '/home/addRibao',