王士厅

频道列表点击已下线视频,未展示内容找不到了缺省页,而是推荐其它视频播放

... ... @@ -129,6 +129,7 @@ export struct EmptyComponent {
.fontWeight(FontWeight.Normal)
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
.fontColor(this.emptyType !== 15 ? '#FFCCCCCC' : '#999999')
.onClick((event: ClickEvent) => {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
... ...
... ... @@ -36,6 +36,7 @@ export struct DetailVideoListPage {
@State data: ContentDetailDTO[] = []
@State currentIndex: number = 0
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
@State interactDataList: InteractDataDTO[] = []
pageShowTime:number = 0;
pageHideTime:number = 0;
... ... @@ -140,6 +141,7 @@ export struct DetailVideoListPage {
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data) {
const params: contentListParams = {
contentList: [{
... ... @@ -202,7 +204,7 @@ export struct DetailVideoListPage {
build() {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: this.netStatus, emptyButton: true, retry: () => {
emptyType: 1, emptyButton: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
}
})
... ... @@ -211,6 +213,18 @@ export struct DetailVideoListPage {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
} else if (this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
} else {
Column() {
Swiper(this.swiperController) {
... ...
... ... @@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent {
@Provide showCommentList: boolean = false
private scroller: Scroller = new Scroller()
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
@State showDownload: Boolean = false // 控制是否显示下载默认隐藏
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
... ... @@ -330,7 +331,7 @@ export struct MultiPictureDetailPageComponent {
}
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: this.netStatus, emptyButton: true, retry: () => {
emptyType: 1, emptyButton: true, retry: () => {
this.getContentDetailData()
}
})
... ... @@ -340,6 +341,19 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
if (this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetailData
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
}
Column() {
if (!this.showDownload) {
Column() {
... ... @@ -487,6 +501,7 @@ export struct MultiPictureDetailPageComponent {
try {
PageRepository.fetchDetailData(this.relId, this.contentId, this.relType)
.then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
this.isOffLine = resDTO.data == null ? true : false
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'fetchDetailData is empty');
return
... ...