|
|
@@ -45,7 +45,7 @@
|
|
|
<a @click="goLastPage">返回上一页</a>
|
|
|
</div>
|
|
|
<remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
|
|
|
- <loading v-show="isSearchingMore"></loading>
|
|
|
+ <loading v-show="isSearchSearchingMore"></loading>
|
|
|
<login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -68,7 +68,7 @@
|
|
|
collectResult: '收藏成功',
|
|
|
timeoutCount: 0,
|
|
|
searchLists: [],
|
|
|
- isSearchingMore: false,
|
|
|
+ isSearchSearchingMore: false,
|
|
|
showLoginBox: false
|
|
|
}
|
|
|
},
|
|
|
@@ -99,12 +99,8 @@
|
|
|
computed: {
|
|
|
productList () {
|
|
|
let list = this.$store.state.searchData.searchList.lists.data
|
|
|
- if (this.isSearchingMore) {
|
|
|
- this.searchLists = this.searchLists.concat(list.components)
|
|
|
- this.isSearchingMore = false
|
|
|
- } else {
|
|
|
- this.searchLists = list.components
|
|
|
- }
|
|
|
+ this.searchLists = this.searchLists.concat(list.components)
|
|
|
+ this.isSearchSearchingMore = false
|
|
|
return list
|
|
|
},
|
|
|
allPage () {
|
|
|
@@ -177,12 +173,13 @@
|
|
|
},
|
|
|
getMoreSearch: function () {
|
|
|
this.page++
|
|
|
- this.isSearchingMore = true
|
|
|
- this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: this.$route.query.w, page: this.page, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}})
|
|
|
+ this.isSearchSearchingMore = true
|
|
|
+ this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: this.$route.query.w, page: this.page, sorting: {'RESERVE': 'DESC'}})
|
|
|
},
|
|
|
scroll: function () {
|
|
|
let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
|
|
|
- if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchingMore && this.page < this.allPage) {
|
|
|
+ console.log(Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight)
|
|
|
+ if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
|
|
|
this.getMoreSearch()
|
|
|
}
|
|
|
}
|