From 5a17d1b9913be6de3d5a7f6f70745bc37891a3b6 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Sat, 31 Oct 2020 17:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=A1=B5=E9=9D=A2=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=A2=91=E9=81=93=E5=88=86=E7=BB=84(=E5=A4=96?= =?UTF-8?q?=E7=BD=AE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 56 +++++++++++++++++++++++++++++++++++++++- src/lib/element/index.js | 3 ++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index f850045..2cf6152 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -101,6 +101,16 @@ 上次播放到【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集
+ + + 频道列表 + + + + + + + 换源 @@ -171,6 +181,25 @@
+
+
+ 频道列表 + + + 关闭 + + + +
+
+ + +
+
@@ -277,7 +306,13 @@ export default { isStar: false, isTop: false, mini: {}, - channelList: [] + channelList: [], + channelListForShow: [], + channelListShow: false, + defaultProps: { + label: 'label', + children: 'children' + } } }, filters: { @@ -362,6 +397,12 @@ export default { }, methods: { ...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']), + handleNodeClick (node) { + console.log(node) + if (node.channel) { + this.playChannel(node.channel) + } + }, async getUrls () { if (this.video.key === '') { return false @@ -379,6 +420,7 @@ export default { // 是直播源,直接播放 this.playChannel(this.video.iptv) } else { + this.iptvMode = false const index = this.video.info.index | 0 var time = this.video.info.time if (!time) { @@ -1126,6 +1168,15 @@ export default { getChannelList () { channelList.all().then(res => { this.channelList = res.filter(e => e.isActive) + this.channelListForShow = [] + const groups = [...new Set(this.channelList.map(iptv => iptv.group))] + groups.forEach(g => { + var doc = { + label: g, + children: this.channelList.filter(x => x.group === g).map(i => { return { label: i.name, channel: i } }) + } + this.channelListForShow.push(doc) + }) }) }, bindEvent () { @@ -1447,6 +1498,9 @@ export default { padding: 6px; display: flex; flex-direction: column; + .el-tree{ + background-color: inherit; + } .list-top{ display: flex; justify-content: space-between; diff --git a/src/lib/element/index.js b/src/lib/element/index.js index 6661e9d..3a36e61 100644 --- a/src/lib/element/index.js +++ b/src/lib/element/index.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch, Select, Option, Checkbox, Autocomplete, Col } from 'element-ui' +import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch, Select, Option, Checkbox, Autocomplete, Col, Tree } from 'element-ui' import Plugin from 'v-fit-columns' Vue.use(Button) Vue.use(Col) @@ -16,4 +16,5 @@ Vue.use(Select) Vue.use(Option) Vue.use(Checkbox) Vue.use(Autocomplete) +Vue.use(Tree) Vue.prototype.$message = Message