luolei 5 years ago
parent
commit
674e8e9421
2 changed files with 29 additions and 7 deletions
  1. 3 1
      src/common/OptionInp.vue
  2. 26 6
      src/components/Login.vue

+ 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];

+ 26 - 6
src/components/Login.vue

@@ -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,19 +82,39 @@ export default {
       },
       code:'',
       allow:true,
-      he:'',
+      canClick:false,
     };
   },
   created(){
     this.code = this.$route.query.hospitalCode||''
   },
   watch:{
-    value(){
-
+    value:{
+      handler: function (val, oldVal) {
+        if(val&&this.patName){
+          this.canClick = true
+        }else{
+          this.canClick = false
+        }
+      },
+      deep: true
     },
-    patName(){
-
+    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() {