From 40218521acf53477254b50e3afe06f9321404515 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Sat, 31 Oct 2020 15:33:28 +0800 Subject: [PATCH] =?UTF-8?q?Film=E9=87=8D=E6=9E=84=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E5=88=86=E7=BB=84=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 64 +++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index 03644bf..0e6050d 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -129,11 +129,11 @@ -
数据量过少时请重复操作一次,以防网站抽风
+ slot="append" + :identifier="infiniteId" + @infinite="infiniteHandler" + force-use-infinite-wrapper=".el-table__body-wrapper"> +
数据量过少时请重复操作一次,以防网站抽风
@@ -329,13 +329,16 @@ export default { siteClick (siteName) { this.list = [] this.site = this.sites.find(x => x.name === siteName) - this.classList = [] - this.type = {} - this.searchTxt = '' - this.getClass().then(res => { - this.infiniteId += 1 - this.classClick(this.classList[0].name) - }) + if (this.searchTxt.length > 0 && this.searchGroup === '站内') { + this.searchEvent() + } else { + this.classList = [] + this.type = {} + this.getClass().then(res => { + this.infiniteId += 1 + this.classClick(this.classList[0].name) + }) + } }, classClick (className) { this.show.classList = false @@ -567,23 +570,18 @@ export default { setting.update(this.setting) } if (!wd) return - if (this.searchGroup === '全部') { - this.searchAllSitesEvent(this.sites, wd) - } else { - this.searchSingleSiteEvent(this.site, wd) + var searchSites = [] + if (this.searchGroup === '站内') searchSites.push(this.site) + if (this.searchGroup === '全部') searchSites = this.sites + if (!searchSites.length) { + searchSites = this.sites.filter(site => site.group === this.searchGroup) } - }, - searchAndRecord () { - this.addSearchRecord() - this.searchEvent() - }, - searchAllSitesEvent (sites, wd) { this.searchContents = [] this.pagecount = 0 this.show.find = true this.statusText = ' ' if (wd) { - sites.forEach(site => { + searchSites.forEach(site => { zy.search(site.key, wd).then(res => { const type = Object.prototype.toString.call(res) if (type === '[object Array]') { @@ -610,19 +608,11 @@ export default { } }) }) - } else { - this.show.find = false - this.getClass().then(res => { - if (res) { - this.infiniteId += 1 - } - }) } }, - searchSingleSiteEvent (site, wd) { - var sites = [] - sites.push(this.site) - this.searchAllSitesEvent(sites, wd) + searchAndRecord () { + this.addSearchRecord() + this.searchEvent() }, searchChangeEvent () { if (this.searchTxt.length >= 1) { @@ -633,6 +623,12 @@ export default { this.show.find = false if (this.setting.view === 'picture' && this.$refs.filmWaterfall) { this.$refs.filmWaterfall.refresh() + } else { + this.getClass().then(res => { + if (res) { + this.infiniteId += 1 + } + }) } } },