Browse Source

首页拖拽

panhui 3 years ago
parent
commit
00be3de6bf
1 changed files with 5 additions and 7 deletions
  1. 5 7
      src/components/RiceDoor.vue

+ 5 - 7
src/components/RiceDoor.vue

@@ -2,9 +2,9 @@
     <div
         class="rice-door"
         :style="{ right: right, bottom: bottom }"
-        @touchstart.stop="onTouchStart"
-        @touchmove.stop="onTouchMove"
-        @touchend.stop="onTouchend"
+        @touchstart.prevent="onTouchStart"
+        @touchmove.prevent="onTouchMove"
+        @touchend.prevent="onTouchend"
         v-if="showRice"
     >
         <img src="@assets/rice-door.png" @click.stop="$router.push('/rice')" alt="" />
@@ -28,8 +28,6 @@ function onTouchStart(e) {
     if (inIos) {
         document.getElementById('scroll-wrapper').className =
             document.getElementById('scroll-wrapper').className + ' van-overflow-hidden';
-    } else {
-        document.body.className = 'van-overflow-hidden';
     }
 }
 
@@ -39,10 +37,10 @@ function onTouchend(e) {
         document.getElementById('scroll-wrapper').className = document
             .getElementById('scroll-wrapper')
             .className.replace(/ van-overflow-hidden/, '');
-    } else {
-        document.body.className = '';
     }
 }
+
+const show = ref(true);
 const pageX = ref(0);
 const pageY = ref(0);
 const safeBootom = inject('safeBottom');