zhenghy

视频频道点击底部或顶部tab刷新页面

... ... @@ -85,6 +85,7 @@ export struct BottomNavigationComponent {
VideoChannelPage({
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
autoRefresh: this.autoRefresh
})
} else {
TopNavigationComponent({
... ...
... ... @@ -13,6 +13,8 @@ export struct VideoChannelPage {
readonly MAX_LINE: number = 1;
private groupId: number = 0
private swiperController: SwiperController = new SwiperController()
// 自动刷新触发(双击tab自动刷新)
@Prop autoRefresh: number = 0
@Prop topNavList: TopNavDTO[]
@Link _currentNavIndex?: number;
@Consume barBackgroundColor: Color
... ... @@ -91,8 +93,12 @@ export struct VideoChannelPage {
right: $r('app.float.top_tab_item_padding_horizontal'),
})
.onClick(() => {
if (this.currentTopNavSelectedIndex === index) {
this.autoRefresh++
}
this.currentTopNavSelectedIndex = index
this.swiperController.changeIndex(index, true)
})
}, (item: TopNavDTO) => item.channelId + '')
}
... ... @@ -113,6 +119,7 @@ export struct VideoChannelPage {
groupId: this.groupId + '',
pageId: item.pageId + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh,
})
} else {
// 直播
... ... @@ -121,7 +128,7 @@ export struct VideoChannelPage {
navIndex: index,
pageId: item.pageId + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh2Page
autoRefresh: this.autoRefresh
}).margin({ top: 40 })
}
}, (item: TopNavDTO) => item.channelId + '')
... ...
... ... @@ -164,11 +164,12 @@ export struct PlayUIComponent {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 8,
lottieWidth: 9,
lottieHeight: 9,
autoplay: true,
loop: true,
})
.margin({ right: 2 })
}
Text('直播中')
... ...
... ... @@ -61,11 +61,12 @@ export struct PlayerTitleComponent {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 8,
lottieWidth: 9,
lottieHeight: 9,
autoplay: true,
loop: true,
})
.margin({ right: 2 })
}.margin({ right: 1 })
// Image($r('app.media.icon_live_status_running'))
... ...
... ... @@ -39,6 +39,7 @@ export struct VideoChannelDetail {
// private recommend?: string = '' // 0.非推荐,1.推荐;
@Link @Watch('navIndexChange') bottomNavIndex: number
@Link @Watch('navIndexChange') topNavIndex: number
@Prop @Watch('autoRefreshChange') autoRefresh: number = 0
@Consume barBackgroundColor: Color
private swiperController: SwiperController = new SwiperController()
@Provide showComment: boolean = false
... ... @@ -54,6 +55,18 @@ export struct VideoChannelDetail {
@State isMouted: boolean = false
@State isRequestError: boolean = false
autoRefreshChange() {
if (this.topNavIndex === 0) {
this.data = []
this.interactDataList = []
this.totalCount = 0
this.isMouted = false
this.getRecCompInfo()
this.getRecCompInfo()
}
}
pageShowChange() {
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
this.barBackgroundColor = Color.Black
... ...