手机端-标准化动态-资料中心搜索换接口

This commit is contained in:
zyn
2023-09-14 10:39:48 +08:00
parent 006e4b46cd
commit b8165c73e9
+23 -16
View File
@@ -77,7 +77,7 @@
<div @click="onCancel">取消</div> <div @click="onCancel">取消</div>
</template> </template>
</van-search> </van-search>
<div class="card-box" ref="cardBoxTwo" @scroll="scroolThree"> <div class="card-box-three" ref="cardBoxThree" @scroll="scroolThree">
<div v-if="loading"> <div v-if="loading">
<van-loading size="24px" color="#3170A8">加载中...</van-loading> <van-loading size="24px" color="#3170A8">加载中...</van-loading>
</div> </div>
@@ -173,12 +173,11 @@ export default {
} }
}, },
scroolThree() { scroolThree() {
this.scrolled = this.$refs.cardBoxTwo.scrollTop; this.scrolled = this.$refs.cardBoxThree.scrollTop;
console.log(this.$refs.cardBoxTwo.scrollTop);
//获得可视区的高度 //获得可视区的高度
const windowHeight = this.$refs.cardBoxTwo.clientHeight; const windowHeight = this.$refs.cardBoxThree.clientHeight;
//获取滚动条的总高度 //获取滚动条的总高度
const scrollHeight = this.$refs.cardBoxTwo.scrollHeight; const scrollHeight = this.$refs.cardBoxThree.scrollHeight;
let windowScrolled = this.scrolled + windowHeight; let windowScrolled = this.scrolled + windowHeight;
if (scrollHeight - windowScrolled < 100 && this.scrolled !== 0) { if (scrollHeight - windowScrolled < 100 && this.scrolled !== 0) {
//把距离顶部的距离加上可视区域的高度 //把距离顶部的距离加上可视区域的高度
@@ -233,37 +232,37 @@ export default {
this.standList = []; this.standList = [];
this.standardReleaseList = []; this.standardReleaseList = [];
if (this.messageType == "ZLZX") { if (this.messageType == "ZLZX") {
this.getAdvice(); this.getAdvice(true);
} else { } else {
this.onDynamics(); this.onDynamics();
} }
}, },
//获取数据 //获取数据
getAdvice() { getAdvice(first = false) {
this.$http.get("fileMaterialCenter/file-material/getFileMaterialIndex", { this.listFlag = false;
page: this.page, this.$http.get("fileMaterialCenter/file-material", {
page: first ? 1 : this.page,
pageSize: 10, pageSize: 10,
treeId: this.currentSearch.id || '' treeId: this.currentSearch.id || ''
}, { }, {
_this: this, loading: "loading" _this: this, loading: "loading"
}, res => { }, res => {
if (res.ok) { if (res.ok) {
let mList = res.data; let mList = res.data.records || [];
if (mList.length) { if (mList.length) {
if (this.standardReleaseList.length) { if (!first && this.standardReleaseList.length) {
this.standardReleaseList = this.standardReleaseList.concat(mList); this.standardReleaseList = this.standardReleaseList.concat(mList);
} else { } else {
this.standardReleaseList = mList; this.standardReleaseList = mList;
} }
this.loading = false;
} else { } else {
this.loading = false; this.standardReleaseList = [];
this.listFlag = true; this.listFlag = true;
} }
} else { } else {
this.standardReleaseList = []; this.standardReleaseList = [];
this.loading = false;
} }
this.loading = false;
}, e => { }, e => {
this.standardReleaseList = []; this.standardReleaseList = [];
this.total = 0; this.total = 0;
@@ -310,11 +309,11 @@ export default {
}, },
onCancel () { onCancel () {
this.$set(this, 'currentSearch', {}) this.$set(this, 'currentSearch', {})
this.getAdvice() this.getAdvice(true)
}, },
setChecked (currentData) { setChecked (currentData) {
this.currentSearch = currentData this.currentSearch = currentData
this.getAdvice() this.getAdvice(true)
} }
}, },
mounted() { mounted() {
@@ -398,6 +397,14 @@ export default {
} }
.card-box-three {
height: calc(85% - 54px);
position: relative;
overflow-x: hidden;
overflow-y: scroll;
top: 10px;
}
.card-content { .card-content {
width: 95%; width: 95%;
height: auto; height: auto;