liyubing

feat:规整为一,跳转直播详情页面方法

@@ -295,6 +295,10 @@ export class ProcessUtils { @@ -295,6 +295,10 @@ export class ProcessUtils {
295 Logger.debug(TAG, `gotoVod, ${content.objectId}`); 295 Logger.debug(TAG, `gotoVod, ${content.objectId}`);
296 } 296 }
297 297
  298 + /**
  299 + * 进入直播详情页面
  300 + * @param content
  301 + */
298 public static async gotoLive(content: ContentDTO) { 302 public static async gotoLive(content: ContentDTO) {
299 let taskAction: Action = { 303 let taskAction: Action = {
300 type: 'JUMP_DETAIL_PAGE', 304 type: 'JUMP_DETAIL_PAGE',
1 import { Action, CompDTO, ContentDTO, Params } from 'wdBean' 1 import { Action, CompDTO, ContentDTO, Params } from 'wdBean'
2 -import { WDRouterRule } from 'wdRouter/Index' 2 +import { ProcessUtils, WDRouterRule } from 'wdRouter/Index'
3 import { Logger } from 'wdKit/Index' 3 import { Logger } from 'wdKit/Index'
4 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 4 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
5 import { LiveModel } from '../../viewmodel/LiveModel' 5 import { LiveModel } from '../../viewmodel/LiveModel'
@@ -69,24 +69,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { @@ -69,24 +69,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
69 .onClick(() => { 69 .onClick(() => {
70 InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName) 70 InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
71 this.clicked = true; 71 this.clicked = true;
72 - this.gotoLive(this.compDTO?.operDataList[0]) 72 + ProcessUtils.gotoLive(this.compDTO?.operDataList[0])
73 }) 73 })
74 } 74 }
75 75
76 - async gotoLive(content: ContentDTO) {  
77 76
78 - let taskAction: Action = {  
79 - type: 'JUMP_DETAIL_PAGE',  
80 - params: {  
81 - detailPageType: 2,  
82 - contentID: content?.objectId,  
83 - extra: {  
84 - relType: content?.relType,  
85 - relId: content?.relId,  
86 - } as ExtraDTO  
87 - } as Params,  
88 - };  
89 - WDRouterRule.jumpWithAction(taskAction)  
90 - // Logger.debug(TAG, `gotoLive, ${content.objectId}`);  
91 - }  
92 } 77 }
@@ -5,7 +5,7 @@ import { CommonConstants } from 'wdConstant' @@ -5,7 +5,7 @@ import { CommonConstants } from 'wdConstant'
5 import { StringUtils } from 'wdKit/Index' 5 import { StringUtils } from 'wdKit/Index'
6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
8 -import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 8 +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'
9 9
10 @Component 10 @Component
11 export struct LiveHorizontalReservationComponent { 11 export struct LiveHorizontalReservationComponent {
@@ -76,7 +76,7 @@ export struct LiveHorizontalReservationComponent { @@ -76,7 +76,7 @@ export struct LiveHorizontalReservationComponent {
76 .onClick(() => { 76 .onClick(() => {
77 if (item.objectType != '0') { 77 if (item.objectType != '0') {
78 console.log(item.objectId) 78 console.log(item.objectId)
79 - this.gotoLive(item) 79 + ProcessUtils.gotoLive(item)
80 } 80 }
81 }) 81 })
82 }) 82 })
@@ -107,20 +107,5 @@ export struct LiveHorizontalReservationComponent { @@ -107,20 +107,5 @@ export struct LiveHorizontalReservationComponent {
107 WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) 107 WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage)
108 } 108 }
109 109
110 - async gotoLive(content: ContentDTO) {  
111 110
112 - let taskAction: Action = {  
113 - type: 'JUMP_DETAIL_PAGE',  
114 - params: {  
115 - detailPageType: 2,  
116 - contentID: content?.objectId,  
117 - extra: {  
118 - relType: content?.relType,  
119 - relId: content?.relId,  
120 - } as ExtraDTO  
121 - } as Params,  
122 - };  
123 - WDRouterRule.jumpWithAction(taskAction)  
124 - // Logger.debug(TAG, `gotoLive, ${content.objectId}`);  
125 - }  
126 } 111 }
@@ -10,6 +10,7 @@ import { SpConstants } from 'wdConstant/Index'; @@ -10,6 +10,7 @@ import { SpConstants } from 'wdConstant/Index';
10 const TAG = 'LiveModel' 10 const TAG = 'LiveModel'
11 11
12 export class LiveModel { 12 export class LiveModel {
  13 +
13 getContentDetail(contentId: string, relId: string, relType: string) { 14 getContentDetail(contentId: string, relId: string, relType: string) {
14 return new Promise<Array<ContentDetailDTO>>((success, fail) => { 15 return new Promise<Array<ContentDetailDTO>>((success, fail) => {
15 ContentDetailRequest.getContentDetail({ 16 ContentDetailRequest.getContentDetail({
@@ -19,9 +20,14 @@ export class LiveModel { @@ -19,9 +20,14 @@ export class LiveModel {
19 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 20 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
20 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) 21 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
21 if (resDTO.data) { 22 if (resDTO.data) {
  23 + console.error("XXXXZZZZ", '---getContentDetail-0---1------------')
22 success(resDTO.data) 24 success(resDTO.data)
  25 + }else {
  26 + console.error("XXXXZZZZ", '---getContentDetail-0--2------------')
  27 + fail("数据为空")
23 } 28 }
24 }).catch(() => { 29 }).catch(() => {
  30 + console.error("XXXXZZZZ", '---getContentDetail-0--2------------')
25 fail("数据为空") 31 fail("数据为空")
26 }) 32 })
27 33
@@ -22,8 +22,10 @@ export class LiveViewModel { @@ -22,8 +22,10 @@ export class LiveViewModel {
22 getContentDetail(contentId: string, relId: string, relType: string) { 22 getContentDetail(contentId: string, relId: string, relType: string) {
23 return new Promise<Array<ContentDetailDTO>>((success, fail) => { 23 return new Promise<Array<ContentDetailDTO>>((success, fail) => {
24 this.liveModel.getContentDetail(contentId, relId, relType).then((data) => { 24 this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
  25 + console.error("XXXXZZZZ", '---getContentDetail---1------------')
25 success(data) 26 success(data)
26 }).catch((message: string) => { 27 }).catch((message: string) => {
  28 + console.error("XXXXZZZZ", '----getContentDetail--2------------')
27 fail(message) 29 fail(message)
28 }) 30 })
29 }) 31 })
@@ -76,7 +76,6 @@ export struct PlayerComponent { @@ -76,7 +76,6 @@ export struct PlayerComponent {
76 playerController: this.playerController, 76 playerController: this.playerController,
77 onLoad: () => { 77 onLoad: () => {
78 this.isCanplay = true 78 this.isCanplay = true
79 - console.error("XXXXZZZZ", '------2------------')  
80 this.playerController?.firstPlay(this.playUrl); 79 this.playerController?.firstPlay(this.playUrl);
81 } 80 }
82 }) 81 })
@@ -85,7 +84,6 @@ export struct PlayerComponent { @@ -85,7 +84,6 @@ export struct PlayerComponent {
85 playerController: this.playerController, 84 playerController: this.playerController,
86 onLoad: () => { 85 onLoad: () => {
87 this.isCanplay = true 86 this.isCanplay = true
88 - console.error('XXXXZZZZ', '------1------------')  
89 this.playerController?.firstPlay(this.playUrl); 87 this.playerController?.firstPlay(this.playUrl);
90 } 88 }
91 }).margin({ top: 195 }).height(211) 89 }).margin({ top: 195 }).height(211)