Browse Source

Merge remote-tracking branch 'origin/new1.1'

zhouna 5 years ago
parent
commit
dd9e55f8c1

+ 11 - 1
src/App.vue

@@ -8,7 +8,17 @@
 </template>
 <script>
   export default {
-    name:'App'
+    name:'App',
+    mounted(){
+      (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
+        // 这里加了个类型判断,因为a等元素也会触发blur事件
+        if(['input', 'textarea'].includes(e.target.localName)) {
+          setTimeout(()=> {
+            document.scrollingElement.scrollTo(0, document.scrollingElement.scrollTop);
+          }, 200);
+        }
+      }, true)
+    },
   }
 </script>
 <style lang="less">

+ 1 - 1
src/common/CheckBox.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="check-wrap" v-if="item" :style="getStyle(detail,slide)">
+  <div class="check-wrap bgques" v-if="item" :style="getStyle(detail,slide)">
       <p v-for="(it,index) in datas.questionDetailList" 
           :key="it.id" 
           :class="['list',{'block':((it.description||it.name).indexOf('${'))!=-1}]" >

+ 1 - 1
src/common/Label.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="label-wrap" v-if="item">
+  <div class="label-wrap bgques" v-if="item">
     <p v-for="(it,index) in datas.questionMapping" :key="it.id" :class="['symp',{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusionType !== exclusion}]" @click="handleClick(it,index,true)">
       <span>{{it.description||it.name}}</span>
       <span v-if="it.select==1" @click="deletSymp($event,it,index)"><img src="../images/del.png" alt=""></span>

+ 3 - 1
src/common/OptionInp.vue

@@ -117,13 +117,15 @@ import $ from 'jquery';
      input{
       height: .42rem;
       color: #4F50FF;
-      font-size: .28rem;
+      font-size: .3rem;
       border-bottom: 1px solid #DFE0E4 !important;
       border-radius: 0;
       padding-left: .05rem;
       background-color: transparent;
       height: 0.38rem;
       line-height: 0.38rem;
+      position: relative;
+      top: 2px;
     }
     .check{//选中
       color: #colors[theme];

+ 2 - 2
src/common/RadioSelect.vue

@@ -2,11 +2,11 @@
   <div class="radio-wrap radioSelect" v-if="item" :style="getStyle(detail,slide)">
     <p class="please">为确保诊断准确性,请充分选择您存在的不适症状</p>
     <div class="list" @click="handleClickShow(1)" :class="[{'setColor':!!hasStr}]">
-      <p><span>有:</span><i :style="{'color':hasStr?'#6678FF':null}">{{hasStr?hasStr:'点击选择症状'}}</i></p>
+      <p><span>有:</span><i :style="{'color':hasStr?'#6678FF':'#7C828E'}">{{hasStr?hasStr:'点击选择症状'}}</i></p>
     </div>
     <p class="please pleaseS">为确保诊断准确性,请充分选择您未表现的不适症状</p>
     <div class="list" @click="handleClickShow(2)" :class="[{'setColor':!!noStr}]">
-      <p><span>无:</span><i :style="{'color':noStr?'#6678FF':null}">{{noStr?noStr:'点击选择症状'}}</i></p>
+      <p><span>无:</span><i :style="{'color':noStr?'#6678FF':'#7C828E'}">{{noStr?noStr:'点击选择症状'}}</i></p>
     </div>
     <SymptomLis 
       v-if="show"

+ 1 - 1
src/common/UploadImg.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="img-wrap">
+  <div class="img-wrap bgques">
     <div class="box">
       
       <ul class="upload-imgs">

+ 8 - 1
src/components/DiagTreat.vue

@@ -199,13 +199,20 @@
 @import '../less/base.less';
   .treat-wrap{
     font-size: .3rem;
+    .bgques {
+      padding-left:0;
+      padding-right: 0;
+    }
+    .label-wrap {
+      padding-bottom: 0;
+    } 
     .quest{
       color: #colors[quest];
-      margin-bottom: .3rem;
       font-weight: 700;
     }
     .label{
       .label;
+      padding-bottom: 0;
     }
     .result{
       .result;

+ 52 - 43
src/components/Login.vue

@@ -25,7 +25,7 @@
         <input
           @focus="focus"
           @blur="blur"
-          :maxlength="type==103?11:type==101?18:type==102?7:type==104?9:30"
+          :maxlength="type==103?11:type==101?18:type==102?20:type==104?9:30"
           v-model="value"
           @input="changeVal"
           :type="type==101||type==104?'text':'tel'"
@@ -46,7 +46,7 @@
           placeholder="请输入姓名"
         />
       </div>
-      <div :class="['btn',value&&patName&&allow?'btnClick':'btnDis']" @click="handleDepart">进入预问诊</div>
+      <div :class="['btn',canClick&&allow?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
     </div>
     <!-- <div class="tip">注:建议您可先输入病情情况,方便医生提前了解情况</div> -->
     <Submit v-if="submit" :showType="showType" :fail="failMsg" @showSubmit="showSubmit"></Submit>
@@ -82,28 +82,40 @@ export default {
       },
       code:'',
       allow:true,
-      he:'',
+      canClick:false,
     };
   },
   created(){
     this.code = this.$route.query.hospitalCode||''
   },
-  // mounted(){
-    
-  //   (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
-  //     // 这里加了个类型判断,因为a等元素也会触发blur事件
-  //     if(['input', 'textarea'].includes(e.target.localName)) {
-  //       iscanscrollpage = true;
-  //       setTimeout(function() {
-  //         if(iscanscrollpage) {
-  //           // alert(document.scrollingElement.scrollTop)
-  //           document.scrollingElement.scrollTo(0, document.scrollingElement.scrollTop);
-  //           document.body && (document.body.scrollTop = document.body.scrollTop);
-  //         }
-  //       }, 200);
-  //     }
-  //   }, true)
-  // },
+  watch:{
+    value:{
+      handler: function (val, oldVal) {
+        if(val&&this.patName){
+          this.canClick = true
+        }else{
+          this.canClick = false
+        }
+      },
+      deep: true
+    },
+    patName:{
+      handler: function (val, oldVal) {
+        if(val&&this.value){
+          this.canClick = true
+        }else{
+          this.canClick = false
+        }
+      },
+      deep: true
+    }
+  },
+  beforeRouteLeave(to, from, next){
+    if(JSON.stringify(to.params) == '{}'){
+      return
+    }
+    next();
+  },
   methods: {
     close() {
       this.showTip = false;
@@ -126,9 +138,9 @@ export default {
     },
     blur() {
       // iscanscrollpage = true;
-      if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
-        document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
-      }
+      // if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+      //   document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+      // }
     },
     changeName() {
       // document.activeElement.scrollIntoViewIfNeeded(true);
@@ -154,32 +166,36 @@ export default {
         clearTimeout(timer);
       }, 2000);
     },
-    showSubmit(flg) {
+    showSubmit(flg){
       this.submit = flg;
     },
-    handleDepart() {
+    handleDepart(){
       const { type, value,patName,allow } = this;
+      this.allow = false
       if (value&&patName&&allow) {
-        this.allow = false
         let timer = setTimeout(() => {
-          if (type == 103) {
-            if (!phoneTest.test(value)) {//验证不通过
-              this.defaultWaring("输入信息格式有误");
+          if (type == 102) {
+            if (!jgpattern.test(value)) {//验证不通过
+              this.defaultWaring("请输入正确的病历号");
+              this.allow = true
               return;
             }
           } else if (type == 101) {//身份证
             if (!identify.test(value)) {//验证不通过
-              this.defaultWaring("输入信息格式有误");
+              this.defaultWaring("请输入正确的身份证号");
+              this.allow = true
               return;
             }
-          } else if (type == 104) {//病历号只能输入数字字母
-            if (!jgpattern.test(value)) {//验证不通过
-              this.defaultWaring("输入信息格式有误");
+          } else if (type == 104) {//市民卡号只能输入数字字母
+            if (!jgpattern.test(value)||value.length!=9) {//验证不通过
+              this.defaultWaring("请输入正确的9位市民卡号");
+              this.allow = true
               return;
             }
           }
           if(!this.code){
             this.defaultWaring("医院编码必填");
+            this.allow = true
             return;
           }
           const param = {
@@ -248,15 +264,12 @@ export default {
 };
 </script>
 <style lang="less" scoped>
+@import "../less/index.less";
 .login {
   height: 100%;
   width: 100%;
   position: absolute;
-  background: linear-gradient(
-    180deg,
-    rgba(79, 79, 255, 1) 0%,
-    rgba(79, 137, 255, 1) 100%
-  );
+  background: #colors[btn];
   padding: 0rem 0.6rem;
   box-sizing: border-box;
   .top {
@@ -351,12 +364,8 @@ export default {
       height: 0.88rem;
       line-height: 0.88rem;
       text-align: center;
-      background: linear-gradient(
-        270deg,
-        rgba(79, 139, 255, 1) 0%,
-        rgba(79, 79, 255, 1) 100%
-      );
-      border-radius: 0.44rem;
+      background: #colors[btn];
+      border-radius: 0.2rem;
       color: #fff;
       font-size: 0.32rem;
       font-weight: 500;

+ 1 - 1
src/components/Others.vue

@@ -194,7 +194,7 @@
   .other-wrap{
     font-size: .3rem;
     // .btscroll;
-    .check-wrap {
+    .bgques {
       padding-left:0;
       padding-right: 0;
     } 

+ 1 - 1
src/components/Symptom.vue

@@ -385,7 +385,7 @@ export default {
   padding-bottom: .2rem;
   .choo-symp{
       display: inline-block;
-      min-width:2.05rem;
+      min-width:2rem;
       height: .74rem;
       background: #colors[btn];
       border-radius: .08rem;

+ 1 - 1
src/less/base.less

@@ -82,7 +82,7 @@
   padding-bottom: .2rem;
   .symp{
     display: inline-block;
-    min-width:2.05rem;
+    min-width:2rem;
     height: .74rem;
     line-height: .74rem;
     border: 1px solid #DFE0E4;