|
|
@@ -5,6 +5,7 @@
|
|
|
@touchstart.prevent="onTouchStart"
|
|
|
@touchmove.prevent="onTouchMove"
|
|
|
@touchend.prevent="onTouchend"
|
|
|
+ @click.prevent="$router.push('/rice')"
|
|
|
v-if="showRice"
|
|
|
>
|
|
|
<img src="@assets/rice-door.png" @click.stop="$router.push('/rice')" alt="" />
|
|
|
@@ -13,6 +14,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, computed, inject, getCurrentInstance, onMounted } from 'vue';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
|
const {
|
|
|
appContext: {
|
|
|
@@ -23,15 +25,23 @@ const {
|
|
|
const pageScrollYoffset = ref(0);
|
|
|
|
|
|
const inIos = /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
|
+const time = ref(0);
|
|
|
function onTouchStart(e) {
|
|
|
global.emitter.emit('startRefreash', false);
|
|
|
if (inIos) {
|
|
|
document.getElementById('scroll-wrapper').className =
|
|
|
document.getElementById('scroll-wrapper').className + ' van-overflow-hidden';
|
|
|
}
|
|
|
+ time.value = new Date().getTime();
|
|
|
}
|
|
|
|
|
|
+const router = new useRouter();
|
|
|
function onTouchend(e) {
|
|
|
+ let _time = new Date().getTime() - time.value;
|
|
|
+ console.log(_time);
|
|
|
+ if (_time <= 100) {
|
|
|
+ router.push('/rice');
|
|
|
+ }
|
|
|
global.emitter.emit('startRefreash', true);
|
|
|
if (inIos) {
|
|
|
document.getElementById('scroll-wrapper').className = document
|