diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue index 52e1d856..81cbe8d3 100644 --- a/src/views/portal/case/Index.vue +++ b/src/views/portal/case/Index.vue @@ -344,6 +344,17 @@ export default { window.removeEventListener("scroll", this.handleScroll); }, methods: { + debounce(func, wait) {// 非立即执行 + let timeout; + return function () { + let context = this; + let args = arguments; + if (timeout) clearTimeout(timeout); + timeout = setTimeout(() => { + func.apply(context, args) + }, wait); + } + }, //展示全部 displayAll(item) { if (!item.isAll && item.summary && item.summary.length > 190) { @@ -426,8 +437,8 @@ export default { let outerHeight = document.documentElement.clientHeight; let scrollTop = document.documentElement.scrollTop; if (outerHeight + scrollTop + 350 >= innerHeight) { - if (this.moreState == 1 && this.queryCondition.pageIndex < 4) { - this.loadMore(); + if (this.moreState == 1) { + this.debounce(this.loadMore(),5000); } } if (scrollTop > 630) {