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 },