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}}集
+
+
+
+
@@ -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