Bläddra i källkod

主症状添加展开收起,默认9个

zhouna 5 år sedan
förälder
incheckning
c553fea128
2 ändrade filer med 29 tillägg och 1 borttagningar
  1. 6 1
      src/components/Detail.vue
  2. 23 0
      src/components/Symptom.vue

+ 6 - 1
src/components/Detail.vue

@@ -2,7 +2,7 @@
   <div class="detail-wrap">
     <!-- <div v-for="(item,index) in datas"> -->
     <div v-for="(item,index) in checkDatas.questionMapping">
-      <p class="quest"><span v-show="item.required==1" style="color: red;">*</span>{{index + 1 +'.' + (item.description || item.name)}}</p>
+      <p class="quest"><img v-show="item.required==1" src="../images/ip.svg"/>{{index + 1 +'.' + (item.description || item.name)}}</p>
       <img class="questionImg" :src="item.url.replace('{imageUrlPrefix}',imgUrl)" v-if="item.url">
       <Radio v-if="item.controlType==1"
             :item="item"
@@ -261,6 +261,11 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
     .quest{
       color:#colors[quest];
       margin-bottom: .2rem;
+      img{
+        width: 10px;
+        vertical-align: text-top;
+        margin-right: 4px;
+      }
     }
     .questionImg {
       width: 100%;

+ 23 - 0
src/components/Symptom.vue

@@ -34,10 +34,12 @@
         <span
           class="symp"
           v-for="(it,ind) in symp"
+          v-if="ind<9||showAll"
           :key="it.conceptId"
           @touchstart.stop.prevent="touchstart(it)"
           @touchend.stop.prevent="touchend(it)"
         >{{it.description || it.name}}</span>
+        <p class="show-all" @click="showAllLabel">{{showAll?"收起":"展开全部"}}</p>
         <p class="tip" v-show="chooseSymp.length==0">长按症状按钮可显示症状解释说明</p>
       </div>
       <div
@@ -109,6 +111,7 @@ export default {
       startTime:'',
       timer:null,
       showExp:false,
+      showAll:false,    //默认显示9个症状,showAll=true展开全部
       message:{
         title:'',
         text:''
@@ -136,6 +139,7 @@ export default {
     touchstart(it){
       this.startTime = +new Date();
       const that = this;
+      this.start = this.$store.state.scroll;
       this.timer = setTimeout(function(){
         // 长按事件
           that.showExp = true;
@@ -228,12 +232,19 @@ export default {
     },
     touchend(item,flg) {//症状点开详情
       clearTimeout(this.timer);
+      this.end = this.$store.state.scroll;
+      if(JSON.stringify(this.start)!== JSON.stringify(this.end)){
+        return;
+      }
       let endTime = +new Date();
       if(endTime - this.startTime < 500){//点击事件
         this.common(item,flg);
       }
       this.startTime = "";
     },
+    showAllLabel(){
+      this.showAll = !this.showAll;
+    },
     getSympText() {//推送使用医生端信息
       const text = this.$store.state.symptom.text;
       let msg = "";
@@ -397,6 +408,18 @@ export default {
 }
 .label{
   .label;
+  .show-all{
+    text-align: right;
+    color: #4f7aff;
+    font-size: 0.25rem;
+    height:35px;
+    line-height: 35px;
+    float: right;
+   /* width: 80px;
+    border:1px #4f7aff solid;
+    border-radius: 5px;
+    margin: auto;*/
+  }
 }
 .result{
   .result;