王士厅

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

@@ -129,6 +129,7 @@ export struct EmptyComponent { @@ -129,6 +129,7 @@ export struct EmptyComponent {
129 .fontWeight(FontWeight.Normal) 129 .fontWeight(FontWeight.Normal)
130 .opacity(this.TEXT_OPACITY) 130 .opacity(this.TEXT_OPACITY)
131 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 131 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
  132 + .fontColor(this.emptyType !== 15 ? '#FFCCCCCC' : '#999999')
132 .onClick((event: ClickEvent) => { 133 .onClick((event: ClickEvent) => {
133 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 134 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
134 }) 135 })
@@ -36,6 +36,7 @@ export struct DetailVideoListPage { @@ -36,6 +36,7 @@ export struct DetailVideoListPage {
36 @State data: ContentDetailDTO[] = [] 36 @State data: ContentDetailDTO[] = []
37 @State currentIndex: number = 0 37 @State currentIndex: number = 0
38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
  39 + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
39 @State interactDataList: InteractDataDTO[] = [] 40 @State interactDataList: InteractDataDTO[] = []
40 pageShowTime:number = 0; 41 pageShowTime:number = 0;
41 pageHideTime:number = 0; 42 pageHideTime:number = 0;
@@ -140,6 +141,7 @@ export struct DetailVideoListPage { @@ -140,6 +141,7 @@ export struct DetailVideoListPage {
140 relType: relType 141 relType: relType
141 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 142 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
142 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) 143 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  144 + this.isOffLine = resDTO.data == null ? true : false
143 if (resDTO.data) { 145 if (resDTO.data) {
144 const params: contentListParams = { 146 const params: contentListParams = {
145 contentList: [{ 147 contentList: [{
@@ -202,7 +204,7 @@ export struct DetailVideoListPage { @@ -202,7 +204,7 @@ export struct DetailVideoListPage {
202 build() { 204 build() {
203 if (this.netStatus !== undefined) { 205 if (this.netStatus !== undefined) {
204 EmptyComponent({ 206 EmptyComponent({
205 - emptyType: this.netStatus, emptyButton: true, retry: () => { 207 + emptyType: 1, emptyButton: true, retry: () => {
206 this.getContentDetail(this.contentId, this.relId, this.relType) 208 this.getContentDetail(this.contentId, this.relId, this.relType)
207 } 209 }
208 }) 210 })
@@ -211,6 +213,18 @@ export struct DetailVideoListPage { @@ -211,6 +213,18 @@ export struct DetailVideoListPage {
211 center: { anchor: "__container__", align: VerticalAlign.Center }, 213 center: { anchor: "__container__", align: VerticalAlign.Center },
212 middle: { anchor: "__container__", align: HorizontalAlign.Center } 214 middle: { anchor: "__container__", align: HorizontalAlign.Center }
213 }) 215 })
  216 + } else if (this.isOffLine) {
  217 + EmptyComponent({
  218 + emptyType: 15, emptyButton: true, retry: () => {
  219 + this.getContentDetail(this.contentId, this.relId, this.relType)
  220 + }
  221 + })
  222 + .id('e_empty_content')
  223 + .alignRules({
  224 + center: { anchor: "__container__", align: VerticalAlign.Center },
  225 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  226 + })
  227 + .backgroundColor(Color.Black)
214 } else { 228 } else {
215 Column() { 229 Column() {
216 Swiper(this.swiperController) { 230 Swiper(this.swiperController) {
@@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent { @@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent {
55 @Provide showCommentList: boolean = false 55 @Provide showCommentList: boolean = false
56 private scroller: Scroller = new Scroller() 56 private scroller: Scroller = new Scroller()
57 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 57 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
  58 + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
58 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 59 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏
59 @State publishCommentModel: publishCommentModel = new publishCommentModel() 60 @State publishCommentModel: publishCommentModel = new publishCommentModel()
60 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] 61 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@@ -330,7 +331,7 @@ export struct MultiPictureDetailPageComponent { @@ -330,7 +331,7 @@ export struct MultiPictureDetailPageComponent {
330 } 331 }
331 if (this.netStatus !== undefined) { 332 if (this.netStatus !== undefined) {
332 EmptyComponent({ 333 EmptyComponent({
333 - emptyType: this.netStatus, emptyButton: true, retry: () => { 334 + emptyType: 1, emptyButton: true, retry: () => {
334 this.getContentDetailData() 335 this.getContentDetailData()
335 } 336 }
336 }) 337 })
@@ -340,6 +341,19 @@ export struct MultiPictureDetailPageComponent { @@ -340,6 +341,19 @@ export struct MultiPictureDetailPageComponent {
340 middle: { anchor: "__container__", align: HorizontalAlign.Center } 341 middle: { anchor: "__container__", align: HorizontalAlign.Center }
341 }) 342 })
342 } 343 }
  344 + if (this.isOffLine) {
  345 + EmptyComponent({
  346 + emptyType: 15, emptyButton: true, retry: () => {
  347 + this.getContentDetailData
  348 + }
  349 + })
  350 + .id('e_empty_content')
  351 + .alignRules({
  352 + center: { anchor: "__container__", align: VerticalAlign.Center },
  353 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  354 + })
  355 + .backgroundColor(Color.Black)
  356 + }
343 Column() { 357 Column() {
344 if (!this.showDownload) { 358 if (!this.showDownload) {
345 Column() { 359 Column() {
@@ -487,6 +501,7 @@ export struct MultiPictureDetailPageComponent { @@ -487,6 +501,7 @@ export struct MultiPictureDetailPageComponent {
487 try { 501 try {
488 PageRepository.fetchDetailData(this.relId, this.contentId, this.relType) 502 PageRepository.fetchDetailData(this.relId, this.contentId, this.relType)
489 .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 503 .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  504 + this.isOffLine = resDTO.data == null ? true : false
490 if (!resDTO || !resDTO.data) { 505 if (!resDTO || !resDTO.data) {
491 Logger.error(TAG, 'fetchDetailData is empty'); 506 Logger.error(TAG, 'fetchDetailData is empty');
492 return 507 return