From 17845e6ab4dbb82e9fd77e9ded8f9d5b6028da04 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Sun, 1 Nov 2020 12:06:10 +0100 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=8D=A2=E6=BA=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD,=E5=9C=A8=E6=96=B0=E6=BA=90=E4=B8=AD=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=BD=93=E5=89=8D=E5=89=A7=E9=9B=86=E5=92=8C=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=BF=9B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index 48d9d01..da046db 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -131,7 +131,7 @@ @@ -744,46 +744,38 @@ export default { this.$message.warning('删除历史记录失败, 错误信息: ' + err) }) }, - async getAllsites () { - const all = await sites.all() + async getOtherSites () { this.right.other = [] - for (const i of all) { - if (i.isActive) { - try { - const searchRes = await zy.search(i.key, this.name) + sites.all().then(sitesRes => { + for (const siteItem of sitesRes.filter(x => x.isActive)) { + zy.search(siteItem.key, this.name).then(searchRes => { const type = Object.prototype.toString.call(searchRes) if (type === '[object Array]') { searchRes.forEach(async item => { const detailRes = item - detailRes.key = i.key - detailRes.site = i.site + detailRes.key = siteItem.key + detailRes.site = siteItem this.right.other.push(detailRes) }) } if (type === '[object Object]') { const detailRes = searchRes - detailRes.key = i.key - detailRes.site = i.name + detailRes.key = siteItem.key + detailRes.site = siteItem this.right.other.push(detailRes) } - } catch (err) { - console.error(err) - } + }) } - } + }) }, otherEvent (m) { this.right.type = 'other' - this.getAllsites() + this.getOtherSites() this.right.show = true }, async otherItemEvent (e) { - const db = await history.find({ site: e.key, ids: e.id }) - if (db) { - this.video = { key: db.site, info: { id: db.ids, name: db.name, index: db.index, site: e.key } } - } else { - this.video = { key: e.key, info: { id: e.id, name: e.name, index: 0, site: e.key } } - } + // 打开当前播放的剧集index, 定位到当前的时间 + this.video = { key: e.key, info: { id: e.id, name: e.name, site: e.site, index: this.video.info.index, time: this.video.info.time } } this.right.show = false this.right.type = '' },