From 6631b8f5688d1ff7e0c07aecbb4cdb10fa78519a Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Tue, 10 Nov 2020 13:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=90=8E=E5=8F=B0=E8=BF=98?= =?UTF-8?q?=E5=9C=A8=E8=BF=90=E8=A1=8C=E7=9A=84=E6=90=9C=E7=B4=A2=E8=A2=AB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B0=E6=96=B0=E6=90=9C=E7=B4=A2=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Film.vue b/src/components/Film.vue index d27a0b8..04bccb9 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -245,6 +245,7 @@ export default { list: [], statusText: ' ', infiniteId: +new Date(), + searchID: 0, searchList: [], searchTxt: '', searchContents: [], @@ -596,6 +597,7 @@ export default { setting.update(this.setting) } if (!wd) return + this.searchID += 1 var searchSites = [] if (this.searchGroup === '站内') searchSites.push(this.site) if (this.searchGroup === '全部') searchSites = this.sites @@ -609,12 +611,15 @@ export default { this.statusText = ' ' if (wd) { searchSites.forEach(site => { + const id = this.searchID zy.search(site.key, wd).then(res => { + if (id !== this.searchID) return const type = Object.prototype.toString.call(res) if (type === '[object Array]') { res.forEach(element => { zy.detail(site.key, element.id).then(detailRes => { detailRes.site = site + if (id !== this.searchID) return this.searchContents.push(detailRes) this.searchContents.sort(function (a, b) { return a.site.id - b.site.id @@ -626,6 +631,7 @@ export default { if (type === '[object Object]') { zy.detail(site.key, res.id).then(detailRes => { detailRes.site = site + if (id !== this.searchID) return this.searchContents.push(detailRes) this.searchContents.sort(function (a, b) { return a.site.id - b.site.id