Kaynağa Gözat

搜索症状已有症状不展开详情

zhouna 5 yıl önce
ebeveyn
işleme
ff27f5e2a4
2 değiştirilmiş dosya ile 7 ekleme ve 1 silme
  1. 6 1
      src/components/Search.vue
  2. 1 0
      src/components/Symptom.vue

+ 6 - 1
src/components/Search.vue

@@ -45,7 +45,7 @@
 <script>
 import api from '@utils/api.js';
 export default {
-  props: ['age', 'sexType', 'chooseSymp'],
+  props: ['age', 'sexType', 'chooseSymp','setText'],
   data() {
     return {
       searchVal: '',
@@ -69,6 +69,11 @@ export default {
   },
   methods: {
     showDetil(item) {
+      if(this.chooseSymp.length>0){     //已有选中症状,不展开详情
+        this.$emit('setText',item);     //选中症状
+        this.search();      //关闭搜索页
+        return;
+      }
       let flg = false;
       if(JSON.stringify(this.tmpItem)==JSON.stringify(item)){//eg:重复点击胸痛bug
         flg = true

+ 1 - 0
src/components/Symptom.vue

@@ -67,6 +67,7 @@
     <Search
       v-if="this.$store.state.searchShow"
       @search="search"
+      @setText="common"
       @showDetil="showDetil"
       :age="age"
       :chooseSymp="chooseSymp"