Bladeren bron

症状模块滑动容易弹出详情bug

luolei 5 jaren geleden
bovenliggende
commit
5ed8393b3a
4 gewijzigde bestanden met toevoegingen van 20 en 7 verwijderingen
  1. 1 1
      src/common/Picker.vue
  2. 2 0
      src/common/UploadImg.vue
  3. 5 1
      src/components/Preview.vue
  4. 12 5
      src/components/Symptom.vue

+ 1 - 1
src/common/Picker.vue

@@ -45,7 +45,7 @@
         ],
         showTip:false,
         columIndx:[],
-        time:100
+        time:10
       }
     },
     props:['show','picIndex'],

+ 2 - 0
src/common/UploadImg.vue

@@ -93,6 +93,7 @@ export default {
         var fileSize = file.size / 1024; //kb 图片大小
         var uploadSrc;
         var uploadFile;
+        // console.log(fileSize,'大小')
         if (fileSize > maxSize) { // 如果图片大小大于4m,进行压缩
           uploadSrc = canvas.toDataURL(file.type, maxSize / fileSize);
           uploadFile = that.dataURLtoFile(uploadSrc, file.name.split('.')[0]); // 转成file文件
@@ -103,6 +104,7 @@ export default {
         }
 
         var compressedSize = uploadFile.size / 1024 / 1024;
+        // console.log('压缩',compressedSize)
         if (compressedSize.toFixed(2) > 4.00) {
           alert('上传图片不可超过4M');
         } else {

+ 5 - 1
src/components/Preview.vue

@@ -63,10 +63,14 @@
       </div>
     </div>
     <div class="foot">
+        <!-- <span
+          class="back"
+          @click="back"
+        >{{'返回'+ preName}}</span> -->
         <span
           class="back"
           @click="back"
-        >{{'返回'+ preName}}</span>
+        >上一步</span>
         <span
           class="next"
           @click="saveAllImage"

+ 12 - 5
src/components/Symptom.vue

@@ -35,7 +35,7 @@
           class="symp"
           v-for="(it,ind) in symp"
           :key="it.conceptId"
-          @touchstart.prevent="touchstart($event,it)"
+          @touchstart.prevent="touchstart(it)"
           @touchend.prevent="touchend(it)"
         >{{it.description || it.name}}</span>
         <p class="tip" v-show="chooseSymp.length==0">长按症状按钮可显示症状解释说明</p>
@@ -92,7 +92,7 @@ export default {
   name: 'Symptom',
   props:['modluesLen','nameStr'],
   data() {
-    let { datas, pathInfo,searchShow } = this.$store.state;
+    let { datas, pathInfo,searchShow,scroll } = this.$store.state;
     const { choose, text } = this.$store.state.symptom;
     return {
       age: pathInfo.patientAge,
@@ -118,7 +118,10 @@ export default {
       message:{
         title:'',
         text:''
-      }
+      },
+      position:scroll,
+      start:{},
+      end:{},
     }
   },
   created() {
@@ -141,14 +144,18 @@ export default {
   methods: {
     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 = "";
     },
-    touchstart(event,it){
-      console.log(event)
+    touchstart(it){
+      this.start = this.$store.state.scroll
       this.startTime = +new Date();
       const that = this;
       this.timer = setTimeout(function(){