|
@@ -53,7 +53,7 @@
|
|
|
<span>最新求购信息</span>
|
|
<span>最新求购信息</span>
|
|
|
<nuxt-link to="/mobile/applyPurchase/list">查看更多 <img src="/images/mobile/@2x/applyPurchase/home/arrow-right.png" alt=""></nuxt-link>
|
|
<nuxt-link to="/mobile/applyPurchase/list">查看更多 <img src="/images/mobile/@2x/applyPurchase/home/arrow-right.png" alt=""></nuxt-link>
|
|
|
</div>
|
|
</div>
|
|
|
- <seek-list :purchaseManList="purchaseManList"></seek-list>
|
|
|
|
|
|
|
+ <seek-list :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="mobile-modal" v-if="showStoreInfo">
|
|
<div class="mobile-modal" v-if="showStoreInfo">
|
|
|
<div class="mobile-modal-box">
|
|
<div class="mobile-modal-box">
|
|
@@ -96,7 +96,13 @@
|
|
|
},
|
|
},
|
|
|
remindText: '',
|
|
remindText: '',
|
|
|
timeoutCount: 0,
|
|
timeoutCount: 0,
|
|
|
- showLoginBox: false
|
|
|
|
|
|
|
+ showLoginBox: false,
|
|
|
|
|
+ isSearchSearchingMore: false,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ size: 5,
|
|
|
|
|
+ purchaseManListData: [],
|
|
|
|
|
+ isChange: false,
|
|
|
|
|
+ isDataChange: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
@@ -105,12 +111,48 @@
|
|
|
RemindBox,
|
|
RemindBox,
|
|
|
LoginBox
|
|
LoginBox
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted: function () {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ window.addEventListener('scroll', this.scroll, false)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ '$store.state.applyPurchase.purchaseManList.purchaseHomeList.data': {
|
|
|
|
|
+ handler: function (val) {
|
|
|
|
|
+ if (this.isChange) {
|
|
|
|
|
+ this.purchaseManListData = []
|
|
|
|
|
+ this.page = 1
|
|
|
|
|
+ this.isChange = false
|
|
|
|
|
+ this.isDataChange = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.purchaseManListData = this.purchaseManListData.concat(val.content)
|
|
|
|
|
+ this.isSearchSearchingMore = false
|
|
|
|
|
+ this.isDataChange = true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ immediate: true
|
|
|
|
|
+ }
|
|
|
|
|
+// $route: {
|
|
|
|
|
+// handler: function (val) {
|
|
|
|
|
+// window.removeEventListener('scroll', this.scroll)
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+ },
|
|
|
computed: {
|
|
computed: {
|
|
|
purchaseManList () {
|
|
purchaseManList () {
|
|
|
- return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.data.content
|
|
|
|
|
|
|
+ return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.data
|
|
|
|
|
+ },
|
|
|
|
|
+ allPage () {
|
|
|
|
|
+ return Math.floor(this.purchaseManList.totalElements / this.purchaseManList.size) + Math.floor(this.purchaseManList.totalElements % this.purchaseManList.size > 0 ? 1 : 0)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ scroll: function () {
|
|
|
|
|
+ let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
|
|
|
|
|
+ if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
|
|
|
|
|
+ this.getMoreSearch()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
onHomeSearchClick () {
|
|
onHomeSearchClick () {
|
|
|
this.showMainSearch = true
|
|
this.showMainSearch = true
|
|
|
this.$store.dispatch('searchData/getSearchHistory')
|
|
this.$store.dispatch('searchData/getSearchHistory')
|
|
@@ -132,6 +174,14 @@
|
|
|
onRemind: function (str) {
|
|
onRemind: function (str) {
|
|
|
this.remindText = str
|
|
this.remindText = str
|
|
|
this.timeoutCount ++
|
|
this.timeoutCount ++
|
|
|
|
|
+ },
|
|
|
|
|
+ reloadData: function () {
|
|
|
|
|
+ this.$store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: this.page, pageSize: this.size, sorting: {'releaseDate': 'DESC'}, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, isLogin: this.user.logged ? '1' : '0'})
|
|
|
|
|
+ },
|
|
|
|
|
+ getMoreSearch: function () {
|
|
|
|
|
+ this.page++
|
|
|
|
|
+ this.isSearchSearchingMore = true
|
|
|
|
|
+ this.reloadData()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|