|
|
@@ -8,9 +8,9 @@
|
|
|
:key="index"
|
|
|
type="info"
|
|
|
size="mini"
|
|
|
- :plain="currentCategory !== index"
|
|
|
- @click="chooseCategory(item, index)"
|
|
|
- >{{ item }}
|
|
|
+ :plain="currentCategory !== item.id"
|
|
|
+ @click="chooseCategory(item)"
|
|
|
+ >{{ item.name }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
@@ -23,8 +23,8 @@
|
|
|
:key="index"
|
|
|
type="warning"
|
|
|
size="mini"
|
|
|
- :plain="currentChildCategory !== index"
|
|
|
- @click="getVideoList(item.id, index)"
|
|
|
+ :plain="currentChildCategory !== item.id"
|
|
|
+ @click="getVideoList(item.id)"
|
|
|
>{{ item.name }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
videoList: [],
|
|
|
prevId: '0',
|
|
|
nextId: '0',
|
|
|
- categoryId: 2,
|
|
|
+ categoryId: 1,
|
|
|
currentIndex: 0,
|
|
|
currentCategory: 0,
|
|
|
currentChildCategory: 0,
|
|
|
@@ -114,9 +114,13 @@ export default {
|
|
|
if (res.code === 0) {
|
|
|
for (let i = 0; i < res.data.length; i++) {
|
|
|
const name = res.data[i].name
|
|
|
- this.category.push(name)
|
|
|
- this.categoryMap.Set(name, res.data[i])
|
|
|
+ this.category.push(res.data[i])
|
|
|
+ this.categoryMap.Set(res.data[i].id, res.data[i])
|
|
|
}
|
|
|
+
|
|
|
+ this.currentCategory = 1
|
|
|
+ this.childCategory = this.categoryMap.Get(this.currentCategory).children
|
|
|
+ this.currentChildCategory = 19
|
|
|
} else {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
@@ -186,12 +190,12 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- chooseCategory(item, index) {
|
|
|
- this.currentCategory = index
|
|
|
- this.childCategory = this.categoryMap.Get(item).children
|
|
|
+ chooseCategory(item) {
|
|
|
+ this.currentCategory = item.id
|
|
|
+ this.childCategory = this.categoryMap.Get(item.id).children
|
|
|
},
|
|
|
- getVideoList(categoryId, index) {
|
|
|
- this.currentChildCategory = index
|
|
|
+ getVideoList(categoryId) {
|
|
|
+ this.currentChildCategory = categoryId
|
|
|
this.categoryId = categoryId;
|
|
|
this.prevId = 0
|
|
|
this.nextId = 0
|