|
@@ -6,7 +6,10 @@
|
|
|
<van-sidebar-item :title="item.chapterName" v-for="(item,index) in carVideoList" :key='index' />
|
|
|
</van-sidebar>
|
|
|
<view class="video-box">
|
|
|
- <m-video-leftright :carVideoItem='item' v-for="(item,index) in carVideoList[activeKey].list" :key='index'>
|
|
|
+ <view v-if="currentList.length===0">
|
|
|
+ 暂无视频
|
|
|
+ </view>
|
|
|
+ <m-video-leftright v-else :carVideoItem='item' v-for="(item,index) in currentList" :key='index'>
|
|
|
</m-video-leftright>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -23,17 +26,21 @@
|
|
|
data: () => ({
|
|
|
bannerList: [],
|
|
|
loading: true,
|
|
|
- activeKey: 0
|
|
|
+ activeKey: 0,
|
|
|
+ currentList:[]
|
|
|
}),
|
|
|
methods: {
|
|
|
- sidebarOnChange(e) {
|
|
|
+ async sidebarOnChange(e) {
|
|
|
this.activeKey = e.detail
|
|
|
+ const {data} = await this.$api.carVideo.getCarVideoList(this.carVideoList[this.activeKey].id)
|
|
|
+ this.currentList=data
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
|
let {
|
|
|
data: bannerListData
|
|
|
} = await this.$api.home.getHomePageDataList(['carouselChart'])
|
|
|
+ this.sidebarOnChange({detail:this.activeKey})
|
|
|
this.bannerList = bannerListData.carouselChart
|
|
|
this.$nextTick(() => {
|
|
|
this.loading = false
|