From 95c58095ee55f3f8e4da04470d410f448277361f Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Sun, 13 Sep 2020 15:39:54 +0200 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E7=A6=8F=E5=88=A9=E7=89=87?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 17 ++++++++++++++++- src/components/Setting.vue | 18 +++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index 86135d8..a3730db 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -232,11 +232,26 @@ export default { const key = this.site.key // 屏蔽主分类 const classToHide = ['电影', '电影片', '电视剧', '连续剧', '综艺', '动漫'] + // 福利片关键词 + const r18KeyWords = ['福利', '激情', '伦理', '理论', '写真', '情色', '美女', '街拍', '赤足', '性感', '倫理', '里番'] + zy.class(key).then(res => { var allClass = [{ name: '最新', tid: 0 }] res.class.forEach(element => { if (!classToHide.includes(element.name)) { - allClass.push(element) + if (this.setting.excludeR18Films) { + var containKeyWord = false + r18KeyWords.forEach(ele => { + if (element && element.name && element.name.includes(ele)) { + containKeyWord = true + } + }) + if (!containKeyWord) { + allClass.push(element) + } + } else { + allClass.push(element) + } } }) this.classList = allClass diff --git a/src/components/Setting.vue b/src/components/Setting.vue index 3eab3ca..c5eb79a 100644 --- a/src/components/Setting.vue +++ b/src/components/Setting.vue @@ -92,6 +92,9 @@
重置源
+
+ 屏蔽福利片 +
@@ -163,6 +166,7 @@ export default { }, externalPlayer: '', editPlayerPath: false, + excludeR18Films: false, d: { id: 0, site: '', @@ -171,7 +175,8 @@ export default { searchAllSites: true, view: 'picture', externalPlayer: '', - editPlayerPath: false + editPlayerPath: false, + excludeR18Films: true } } }, @@ -208,7 +213,8 @@ export default { view: res.view, searchAllSites: res.searchAllSites, externalPlayer: res.externalPlayer, - editPlayerPath: false + editPlayerPath: false, + excludeR18Films: res.excludeR18Films } this.setting = this.d }) @@ -246,9 +252,11 @@ export default { }, updateSearchOption (e) { this.d.searchAllSites = this.setting.searchAllSites - setting.update(this.d).then(res => { - this.setting = this.d - }) + setting.update(this.setting) + }, + updateExcludeR18FilmOption (e) { + this.d.excludeR18Films = this.setting.excludeR18Films + setting.update(this.setting) }, exportFavorites () { this.getFavorites()