diff --git a/src/components/Play.vue b/src/components/Play.vue index a9eeca5..3b36c47 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -84,6 +84,12 @@ + + + 快捷键指南 + + + 复制调试信息 @@ -98,7 +104,10 @@ - {{ right.type === 'list' ? '播放列表' : right.type === 'history' ? '历史记录' : '其他相同资源' }} + 播放列表 + 历史记录 + 快捷键指南 + 其他源的视频 关闭 @@ -117,6 +126,9 @@ 无数据 【{{m.site}}】{{m.name}} 第{{m.index+1}}集删除 + + {{m.desc}} -- [ {{m.key}} ] + 无数据 {{m.name}} - [{{m.site}}] @@ -185,9 +197,10 @@ export default { right: { show: false, type: '', - other: [], list: [], - history: [] + history: [], + shortcut: [], + other: [] }, config: { id: 'xgplayer', @@ -732,51 +745,30 @@ export default { this.$message.warning('删除历史记录失败, 错误信息: ' + err) }) }, - getAllsitestest () { - this.name = '喜宝' - sites.all().then(res => { - const sites = res - const arr = [] - for (const i of sites) { - zy.search(i.key, this.name).then(res => { - const type = Object.prototype.toString.call(res) - if (type === '[object Array]') { - res.forEach(element => { - zy.detail(i.key, element.id).then(detailRes => { - arr.push(detailRes) - }) - }) - } - if (type === '[object Object]') { - zy.detail(i.key, res.id).then(detailRes => { - arr.push(detailRes) - }) - } - }) - } - console.log(arr, 'arr') - }) - }, async getAllsites () { const all = await sites.all() this.right.other = [] for (const i of all) { if (i.isActive) { - const searchRes = await zy.search(i.key, this.name) - const type = Object.prototype.toString.call(searchRes) - if (type === '[object Array]') { - searchRes.forEach(async element => { - const detailRes = await zy.detail(i.key, element.id) + try { + const searchRes = await zy.search(i.key, this.name) + const type = Object.prototype.toString.call(searchRes) + if (type === '[object Array]') { + searchRes.forEach(async item => { + const detailRes = item + detailRes.key = i.key + detailRes.site = item.name + this.right.other.push(detailRes) + }) + } + if (type === '[object Object]') { + const detailRes = searchRes detailRes.key = i.key detailRes.site = i.name this.right.other.push(detailRes) - }) - } - if (type === '[object Object]') { - const detailRes = await zy.detail(i.key, searchRes.id) - detailRes.key = i.key - detailRes.site = i.name - this.right.other.push(detailRes) + } + } catch (err) { + console.log(err) } } } @@ -1152,6 +1144,14 @@ export default { } addPlayerView.bind(this, 'videoTitle', `${title}`, {})() }) + }, + showShortcutEvent () { + this.right.show = !this.right.show + shortcut.all().then(res => { + this.right.type = 'shortcut' + this.right.shortcut = res + console.log(res) + }) } }, created () {