From 5cc225d5a2c653154b475e170c850152d7c0bece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Tue, 31 May 2022 09:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 1 + src/pages/phone/databaseSearch.vue | 46 +- src/pages/phone/domesticDetails.vue | 4205 ++++++++++++++++++++++++++- 3 files changed, 4241 insertions(+), 11 deletions(-) diff --git a/src/App.vue b/src/App.vue index 1743c2d93..a35f61126 100644 --- a/src/App.vue +++ b/src/App.vue @@ -221,6 +221,7 @@ export default { && this.$route.name !== 'loginStandDetails' && this.$route.name !== 'error' && this.$route.name !== 'phoneHome'&& this.$route.name !== 'databaseSearch' && this.$route.name !== 'standDynamics' && this.$route.name !== 'domesticStand' + && this.$route.name !== 'domesticDetails' && this.$route.name !== 'OtherStandardExternalDetails' && this.$route.name !== 'OtherStandardExternalDetails') { this.isBoolean = true } else { diff --git a/src/pages/phone/databaseSearch.vue b/src/pages/phone/databaseSearch.vue index fb21954d2..71bb66fae 100644 --- a/src/pages/phone/databaseSearch.vue +++ b/src/pages/phone/databaseSearch.vue @@ -17,11 +17,11 @@ -
+
加载中...
-
+
{{item.title}}
@@ -46,23 +46,45 @@ export default { name: "databaseSearch", data(){ return{ + scrolled: '', + moreFlag: false, searchKey: '', standList: [], loading: true, + page: 1, } }, methods: { + scrool(){ + let scrolled = this.$refs.cardBox.scrollTop + //获得可视区的高度 + const windowHeight = this.$refs.cardBox.clientHeight + //获取滚动条的总高度 + const scrollHeight = this.$refs.cardBox.scrollHeight + let windowScrolled = scrolled + windowHeight + this.scrolled = scrolled + if(scrollHeight - windowScrolled < 600 ){ + //把距离顶部的距离加上可视区域的高度 等于或者大于滚动条的总高度就是到达底部 + this.moreFlag = true + this.page++ + } + }, onSearch(){ + this.moreFlag = false this.$http.post('search/searchCenter/searchSarBykey',{ selectIndex: 'fulltextserch', selectValue: this.searchKey, selectType: 'titleSearch', - page: 1, + page: this.page, pageSize: 20 },{ _this: this, }, res => { - this.standList = res.data.list + if(this.standList.length){ + this.standList = this.standList.concat(res.data.list) + }else{ + this.standList = res.data.list + } console.log(this.standList); this.loading = false }, e => { @@ -73,11 +95,21 @@ export default { back(){ this.$router.push('/phoneHome') }, + jumpDetails(item){ + this.$router.push({ + name: 'domesticDetails', + query: { + id: item.id, + pageType: 'INLAND_STAND' + } + }) + }, }, mounted(){ this.searchKey = this.$route.query.searchKey this.onSearch() - } + this.$refs.cardBox.addEventListener('scroll', this.scrool); + }, }; @@ -85,7 +117,6 @@ export default { #database-search{ width: 100%; height: 100%; - overflow: auto; margin: 0; padding: 0; background: #F6F6F6; @@ -130,8 +161,9 @@ export default { } } .card-box{ - height: 100%; + height: 85%; position: relative; + overflow-y: scroll; top: 100px; } .card-content{ diff --git a/src/pages/phone/domesticDetails.vue b/src/pages/phone/domesticDetails.vue index f42e31f8c..cfcf218d3 100644 --- a/src/pages/phone/domesticDetails.vue +++ b/src/pages/phone/domesticDetails.vue @@ -1,14 +1,4211 @@ - + -