Browse Source

错误提示

zhouna 5 years ago
parent
commit
c88bb237f6
4 changed files with 25 additions and 10 deletions
  1. 2 2
      config/index.js
  2. 3 2
      src/common/PushSymptom.vue
  3. 9 4
      src/common/TipWarning.vue
  4. 11 2
      src/components/MainPage.vue

+ 2 - 2
config/index.js

@@ -5,8 +5,8 @@
 const path = require('path')
 // const proxy_path = 'http://192.168.2.236:80';
 // const proxy_path = 'http://192.168.2.236:5050';
-// const proxy_path = 'http://192.168.2.236:5050';
-const proxy_path = 'http://223.93.170.82:23650';
+const proxy_path = 'http://192.168.2.241:5050';
+// const proxy_path = 'http://223.93.170.82:23650';
 
 module.exports = {
   dev: {

+ 3 - 2
src/common/PushSymptom.vue

@@ -131,8 +131,9 @@
         this.$store.commit("setChoose",{choose:[...this.chooseSymp,...this.selecteds]});
       },
       selectResult(item) {
-        if(this.selecteds.length>2){
-
+        if(this.selecteds.length>2&&item.name!=="没有了"){
+          this.$emit('warning','最多选择3个症状');
+          return;
         }
         const hasNone = this.selecteds.findIndex((it)=>{
           return it.name==='没有了';

+ 9 - 4
src/common/TipWarning.vue

@@ -1,5 +1,5 @@
 <template>
-  <div v-if="show" class="tip">{{text}}</div>
+  <div class="tip">{{text}}</div>
 </template>
 <script>
   export default {
@@ -9,13 +9,17 @@
         show:true
       }
     },
+    mounted(){
+      this.close();
+    },
     methods:{
       close(){
         const that = this;
-        setTimeout(()=>{
-          that.show=false;
+        const timer=setTimeout(()=>{
+          //that.show=false;
           that.$emit("close");
-        },4000);
+          clearTimeout(timer);
+        },3900);
       }
     }
   }
@@ -31,6 +35,7 @@
     position: fixed;
     top: 40%;
     left: 50%;
+    z-index: 9999;
     animation:toHidden 4s ease;
     -moz-animation: toHidden 4s ease;	/* Firefox */
     -webkit-animation: toHidden 4s ease;	/* Safari 和 Chrome */

+ 11 - 2
src/components/MainPage.vue

@@ -21,7 +21,7 @@
         <div class="left clearfix">
           <img src="../images/doctor.png" alt="" class="fl">
           <div class="content fl">
-            <p>欢迎来到{{userInfo.hospitalName}}!候诊期间请先填写自己实际症状,信息会马上传送到您预约的医生,便于您实现快速就诊。</p>
+            <p>{{wrong}}欢迎来到{{userInfo.hospitalName}}!候诊期间请先填写自己实际症状,信息会马上传送到您预约的医生,便于您实现快速就诊。</p>
           </div>
         </div>
         <!--<div class="left clearfix" @click="selectToggle(2,disData.symptom.result,true)">
@@ -56,7 +56,7 @@
     <Picker v-if="type==10" @confirm="updataResultSingle" :num="num" :defaultIndex = "defaultIndex"></Picker>
     <!--时间拨盘,拨盘内容写死-->
     <Picker v-if="type == 9" :symptomResult="symptomResult" :columns="getTimeColumns()" :defaultVal="pickDVal" @confirm="updataResultSingle" :num="num" :defaultIndex = "defaultIndex"></Picker>
-    <PushSymptom v-if="type == 99" @updataResult="updataResultSingle" :num="num"></PushSymptom>
+    <PushSymptom v-if="type == 99" @updataResult="updataResultSingle" :num="num" @warning="showWarn"></PushSymptom>
     <!-- 上传图片 -->
     <UploadImg v-if="type==4"
                :num="num"
@@ -299,8 +299,17 @@ export default {
         this.scroll.scrollTo(0, this.scroll.maxScrollY,500)
       })
     },
+    showWarn(text){
+      this.waring=text;
+      this.wrong=true;
+    },
     closeTip(){
       this.wrong=false;
+      /*const _this=this;
+      const timer=setTimeout(()=>{
+        _this.wrong=false;
+        clearTimeout(timer)
+      },4500);*/
     },
     cancelSymptom(){      //修改(即删除)已选主症
       this.allquestionLis = [];