From f76c71c95082ea1bd4d084357f9f14c15e23ea8f Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Thu, 13 Aug 2020 21:46:23 +0200 Subject: [PATCH 01/14] Merge searchClickEvent and searchEvent --- src/components/Film.vue | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index c84a9a0..f158d49 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -18,10 +18,10 @@
-
+
    -
  • {{i.keywords}}
  • +
  • {{i.keywords}}
  • 清空历史记录
@@ -378,8 +378,8 @@ export default { this.searchList = res.reverse() }) }, - searchEvent () { - const wd = this.searchTxt + searchEvent (wd) { + this.searchTxt = wd this.searchContents = [] this.pagecount = 0 this.show.search = false @@ -412,29 +412,6 @@ export default { }) } }, - searchClickEvent (e) { - this.searchContents = [] - this.pagecount = 0 - this.searchTxt = e.keywords - this.show.search = false - this.show.find = true - search.remove(e.id).then(res => { - search.add({ keywords: e.keywords }) - this.getAllSearch() - }) - zy.search(this.site.key, e.keywords).then(res => { - const type = Object.prototype.toString.call(res) - if (type === '[object Undefined]') { - this.$message.info('无搜索结果') - } - if (type === '[object Array]') { - this.searchContents.push(...res) - } - if (type === '[object Object]') { - this.searchContents.push(res) - } - }) - }, clearSearch () { search.clear().then(res => { this.getAllSearch() From 1df7b41eddc2ca0bd583b931003b276e30217b46 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Thu, 13 Aug 2020 22:04:50 +0200 Subject: [PATCH 02/14] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=B5=84=E6=BA=90=E7=BD=91=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index f158d49..7a3990f 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -88,6 +88,7 @@ {{i.type}} {{i.year}} {{i.last}} + {{i.site}} {{i.note}} 播放 @@ -397,9 +398,13 @@ export default { this.$message.info('无搜索结果') } if (type === '[object Array]') { - this.searchContents.push(...res) + res.forEach(element => { + element.site = this.site.name + this.searchContents.push(element) + }) } if (type === '[object Object]') { + res.site = this.site.name this.searchContents.push(res) } }) From 1105c46f08fea4dcd433b71b388b61b284217d3b Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Fri, 14 Aug 2020 19:29:39 +0200 Subject: [PATCH 03/14] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E2=80=9C=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=89=80=E6=9C=89=E8=B5=84=E6=BA=90=E2=80=9Dcheckbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 55 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index 7a3990f..a03cce1 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -26,6 +26,9 @@
+
+ 搜索所有资源 +
@@ -135,7 +138,8 @@ export default { infiniteId: +new Date(), searchList: [], searchTxt: '', - searchContents: [] + searchContents: [], + searchAllSites: false } }, components: { @@ -379,7 +383,7 @@ export default { this.searchList = res.reverse() }) }, - searchEvent (wd) { + searchSingleSiteEvent (wd) { this.searchTxt = wd this.searchContents = [] this.pagecount = 0 @@ -417,6 +421,53 @@ export default { }) } }, + searchAllSitesEvent (wd) { + this.searchTxt = wd + this.searchContents = [] + this.pagecount = 0 + this.show.search = false + this.show.find = true + if (wd) { + search.find({ keywords: wd }).then(res => { + if (!res) { + search.add({ keywords: wd }) + } + this.getAllSearch() + }) + this.sites.forEach(site => + zy.search(site.key, wd).then(res => { + const type = Object.prototype.toString.call(res) + if (type === '[object Undefined]') { + this.$message.info('无搜索结果') + } + if (type === '[object Array]') { + res.forEach(element => { + element.site = site.name + this.searchContents.push(element) + }) + } + if (type === '[object Object]') { + res.site = site.name + this.searchContents.push(res) + } + }) + ) + } else { + this.show.find = false + this.getClass().then(res => { + if (res) { + this.infiniteId += 1 + } + }) + } + }, + searchEvent (wd) { + if (this.searchAllSites) { + this.searchAllSitesEvent(wd) + } else { + this.searchSingleSiteEvent(wd) + } + }, clearSearch () { search.clear().then(res => { this.getAllSearch() From 37b41b0e20142d4912b53327071dd564ea8a24a7 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Fri, 14 Aug 2020 19:41:00 +0200 Subject: [PATCH 04/14] =?UTF-8?q?=E6=97=A0=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=BD=91=E7=AB=99=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index a03cce1..f25a51e 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -399,7 +399,7 @@ export default { zy.search(this.site.key, wd).then(res => { const type = Object.prototype.toString.call(res) if (type === '[object Undefined]') { - this.$message.info('无搜索结果') + this.$message.info(this.site.name + ' 无搜索结果') } if (type === '[object Array]') { res.forEach(element => { @@ -438,7 +438,7 @@ export default { zy.search(site.key, wd).then(res => { const type = Object.prototype.toString.call(res) if (type === '[object Undefined]') { - this.$message.info('无搜索结果') + this.$message.info(site.name + ' 无搜索结果') } if (type === '[object Array]') { res.forEach(element => { From cea797b6d0f5711416cbcb4090684e990c3d0cfb Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Fri, 14 Aug 2020 21:49:52 +0200 Subject: [PATCH 05/14] Save whole site data to res.site --- src/components/Film.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index f25a51e..67e2361 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -91,7 +91,7 @@ {{i.type}} {{i.year}} {{i.last}} - {{i.site}} + {{i.site.name}} {{i.note}} 播放 @@ -403,12 +403,12 @@ export default { } if (type === '[object Array]') { res.forEach(element => { - element.site = this.site.name + element.site = this.site this.searchContents.push(element) }) } if (type === '[object Object]') { - res.site = this.site.name + res.site = this.site this.searchContents.push(res) } }) @@ -442,12 +442,12 @@ export default { } if (type === '[object Array]') { res.forEach(element => { - element.site = site.name + element.site = site this.searchContents.push(element) }) } if (type === '[object Object]') { - res.site = site.name + res.site = site this.searchContents.push(res) } }) From 3a499766afcb9dd1d98b36db21b533f70c9dc6fc Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Fri, 14 Aug 2020 22:07:04 +0200 Subject: [PATCH 06/14] playEvent starEvent shareEvent downloadEvent all take site as the input argument --- src/components/Film.vue | 56 ++++++++++++++++++++--------------------- src/components/Star.vue | 14 +++++------ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index 67e2361..4cb7a5d 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -27,7 +27,7 @@
- 搜索所有资源 + 搜索所有资源
@@ -40,16 +40,16 @@