yangc 8 years ago
parent
commit
9af1873c2e
2 changed files with 24 additions and 0 deletions
  1. 12 0
      pages/mobile/search/_keycode.vue
  2. 12 0
      pages/mobile/shop/index.vue

+ 12 - 0
pages/mobile/search/_keycode.vue

@@ -69,6 +69,11 @@
     components: {
       RemindBox
     },
+    mounted () {
+      this.$nextTick(function () {
+        window.addEventListener('scroll', this.onScroll(event))
+      })
+    },
     fetch ({store, route}) {
       return Promise.all([
         store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}}),
@@ -141,6 +146,13 @@
       },
       goLastPage: function () {
         window.history.back(-1)
+      },
+      onScroll: function (e) {
+//        let width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
+//        let height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
+//        let x = Math.min(width - 20, e.touches[0].clientX)
+//        let y = Math.min(height - 20, e.touches[0].clientY)
+        console.log(e.touches[0].clientY)
       }
     }
   }

+ 12 - 0
pages/mobile/shop/index.vue

@@ -58,7 +58,19 @@
         return this.$store.state.provider.stores.storeList.data
       }
     },
+    mounted () {
+      this.$nextTick(function () {
+        window.addEventListener('onScrollMove ', this.onScroll(event))
+      })
+    },
     methods: {
+      onScroll: function (e) {
+//        let width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
+//        let height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
+//        let x = Math.min(width - 20, e.touches[0].clientX)
+//        let y = Math.min(height - 20, e.touches[0].clientY)
+        console.log(1)
+      },
       isType (type) {
         let bgurl = ''
         if (type === 'ORIGINAL_FACTORY') {