From d247a2fa2333063a8cf24f03cd89329c69c67316 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=9C=A8=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E5=8F=AF=E9=80=89=E5=AE=9A=E9=9B=86=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=A1=B5=E9=9D=A2=E5=88=86=E4=BA=AB=E4=B8=BA?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E9=9B=86=EF=BC=8C=E5=85=B6=E5=AE=83=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=88=86=E4=BA=AB=E9=BB=98=E8=AE=A4=E9=A6=96=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail.vue | 13 +++++++++---- src/components/Play.vue | 3 ++- src/components/Share.vue | 9 +++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/Detail.vue b/src/components/Detail.vue index e23e1cf..022c9a6 100644 --- a/src/components/Detail.vue +++ b/src/components/Detail.vue @@ -36,7 +36,7 @@
- 播放 + 播放 收藏 下载 分享 @@ -61,7 +61,7 @@
- {{i | ftName}} + {{i | ftName}}
@@ -87,6 +87,7 @@ export default { videoFullList: [], info: {}, playOnline: false, + selectedEpisode: 0, // 选定集数 selectedOnlineSite: '哔嘀', onlineSites: ['哔嘀', '素白白', '简影', '极品', '喜欢看', '1080影视'] } @@ -256,7 +257,8 @@ export default { this.share = { show: true, key: this.detail.key, - info: this.info + info: this.info, + index: this.selectedEpisode } }, doubanLinkEvent () { @@ -276,7 +278,10 @@ export default { const id = this.detail.info.ids || this.detail.info.id const cacheKey = this.detail.key + '@' + id const db = await history.find({ site: this.detail.key, ids: id }) - if (db) this.videoFlag = db.videoFlag + if (db) { + this.videoFlag = db.videoFlag + this.selectedEpisode = db.index + } if (!this.DetailCache[cacheKey]) { this.DetailCache[cacheKey] = await zy.detail(this.detail.key, id) } diff --git a/src/components/Play.vue b/src/components/Play.vue index b133ca8..b078751 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -910,7 +910,8 @@ export default { this.share = { show: true, key: this.video.key, - info: this.DetailCache[this.video.key + '@' + this.video.info.id] + info: this.DetailCache[this.video.key + '@' + this.video.info.id], + index: this.video.info.index } }, issueEvent () { diff --git a/src/components/Share.vue b/src/components/Share.vue index 487eede..1ad3fab 100644 --- a/src/components/Share.vue +++ b/src/components/Share.vue @@ -76,10 +76,10 @@ export default { info: {} } }, - async getUrl (dl) { + async getUrl (dl, index) { const t = dl.dd._t if (t) { - return t.split('#')[0].split('$')[1] + return t.split('#')[index].split('$')[1] } else { const id = this.share.info.ids || this.share.info.id const cacheKey = this.share.key + '@' + id @@ -89,14 +89,15 @@ export default { this.DetailCache[cacheKey] = res } if (res) { - return res.fullList[0].list[0] + return res.fullList[0].list[index] } } }, async getDetail () { this.loading = true this.pic = this.share.info.pic - const url = await this.getUrl(this.share.info.dl) + const index = this.share.index || 0 + const url = await this.getUrl(this.share.info.dl, index) this.link = 'http://hunlongyu.gitee.io/zy-player-web?url=' + url + '&name=' + this.share.info.name this.loading = false },