张善主

fix(公共跳转): 更多跳转优化

1 -import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean'; 1 +import { Action, ContentDTO, Params, PhotoListBean, commentInfo, CompDTO } from 'wdBean';
2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; 2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
3 import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; 3 import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
4 import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; 4 import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
@@ -72,6 +72,76 @@ export class ProcessUtils { @@ -72,6 +72,76 @@ export class ProcessUtils {
72 ProcessUtils.processPage(content); 72 ProcessUtils.processPage(content);
73 } 73 }
74 74
  75 + //更多
  76 + static compJumpPage(bean:CompDTO){
  77 + let contentBean = ProcessUtils.compBeanToContentBean(bean)
  78 + if(contentBean == null){
  79 + return
  80 + }
  81 + if(ProcessUtils.checkMoreJumpPage(bean)){
  82 + ProcessUtils.processPage(contentBean)
  83 + }else{
  84 + ProcessUtils.moreTojumpLivePage(contentBean);
  85 + }
  86 + }
  87 +
  88 + static moreTojumpLivePage(contentBean:ContentDTO){
  89 + if(!StringUtils.isEmpty(contentBean.dataSourceType)){
  90 + if(contentBean.dataSourceType == 'LIVE_HORIZONTAL_CARD') {
  91 + //直播中
  92 + WDRouterRule.jumpWithPage(WDRouterPage.liveMorePage)
  93 + }else if(contentBean.dataSourceType == 'LIVE_RESERVATION'){
  94 + //预约列表
  95 + WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage)
  96 + }else if(contentBean.dataSourceType == 'LIVE_MONTHLY_RANKING'){
  97 + contentBean.objectType = '6'
  98 + ProcessUtils.processPage(contentBean)
  99 + }
  100 + }
  101 + }
  102 +
  103 + static checkMoreJumpPage(content:CompDTO){
  104 + let loacalJump = true
  105 + if(content.dataSourceType == 'LIVE_HORIZONTAL_CARD'){
  106 + loacalJump = false
  107 + }else if(content.dataSourceType == 'LIVE_RESERVATION'){
  108 + loacalJump = false
  109 + }else if(content.dataSourceType == 'LIVE_MONTHLY_RANKING'){
  110 + loacalJump = false
  111 + }
  112 + return loacalJump
  113 + }
  114 +
  115 + static compBeanToContentBean(compDTO:CompDTO){
  116 + if(compDTO == null){
  117 + return
  118 + }
  119 + let content = new ContentDTO()
  120 + content.objectType = compDTO.objectType||'0'
  121 + content.objectLevel = compDTO.objectLevel
  122 + content.objectId = compDTO.objectId
  123 + content.pageId = compDTO.pageId||''
  124 + content.newsTitle = compDTO.objectTitle
  125 + content.newsSummary = compDTO.objectSummary
  126 + // compContentBean.setTopicInfoBean(getTopicInfoBean());
  127 + // compContentBean.setChannelInfoBean(getChannelInfoBean());
  128 + content.bottomNavId = compDTO.bottomNavId
  129 + content.sourceInterfaceVal = compDTO.sourceInterfaceVal
  130 + content.dataSourceType = compDTO.dataSourceType
  131 + content.compId = compDTO.id+''
  132 + content.linkUrl = compDTO.linkUrl
  133 + content.appStyle = compDTO.appStyle
  134 + content.recommend = compDTO.recommend
  135 + content.expIds = compDTO.expIds
  136 + content.relId = compDTO.relId
  137 + content.relType = compDTO.relType
  138 + content.itemId = compDTO.itemId
  139 + content.itemType = compDTO.itemType
  140 + content.sceneId = compDTO.sceneId
  141 + content.traceId = compDTO.traceId
  142 + content.traceInfo = compDTO.traceInfo
  143 + return content
  144 + }
75 /** 145 /**
76 * 页面跳转 146 * 页面跳转
77 */ 147 */
@@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO { @@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO {
25 // meddleDataList: any[]; 25 // meddleDataList: any[];
26 name: string = ''; 26 name: string = '';
27 objectId: string = ''; // 跳转页面id? 27 objectId: string = ''; // 跳转页面id?
  28 + /**
  29 + * 频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间轴专题)
  30 + */
  31 + objectLevel:string = ''
28 objectTitle: string = ''; // comp标题 32 objectTitle: string = ''; // comp标题
  33 + objectSummary: string = ''; // 跳转频道、专题摘要【BFF聚合】
29 // objectType?: string; // 跳转类型,枚举: 34 // objectType?: string; // 跳转类型,枚举:
30 operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 35 operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
31 // pageId?: any; 36 // pageId?: any;
@@ -51,6 +56,22 @@ export class CompDTO implements BaseDTO { @@ -51,6 +56,22 @@ export class CompDTO implements BaseDTO {
51 56
52 // keyGenerator相关字符串,用于刷新list布局 57 // keyGenerator相关字符串,用于刷新list布局
53 timestamp: String = '1' 58 timestamp: String = '1'
  59 +
  60 + bottomNavId:string = ''
  61 + //数据来源接口 0:非推荐楼层接口;1:推荐楼层接口
  62 + sourceInterfaceVal: number = 0
  63 +
  64 + appStyle: string = '';
  65 + /**
  66 + * 是否推荐数据;默认0:否,1:是
  67 + */
  68 + recommend:number = 0
  69 + relId: string = '';
  70 + relType: string = '';
  71 + itemType: string = '';
  72 + sceneId: string = '';
  73 + traceId: string = '';
  74 + traceInfo: string = '';
54 /** 75 /**
55 * 创建新的compbean对象 76 * 创建新的compbean对象
56 * @param old 77 * @param old
@@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO { @@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO {
27 liveType?: string; // 直播新闻-直播状态 27 liveType?: string; // 直播新闻-直播状态
28 expIds: string = ''; 28 expIds: string = '';
29 itemId: string = ''; 29 itemId: string = '';
  30 + itemType: string = '';
30 shareFlag?: string = '1'; 31 shareFlag?: string = '1';
31 appStyle: string = ''; 32 appStyle: string = '';
32 cityCode: string = ''; 33 cityCode: string = '';
@@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO { @@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO {
123 timestamp: String = '1' 124 timestamp: String = '1'
124 // 自定义参数,用于跳转对应页面时 传递targetLayout参数用 125 // 自定义参数,用于跳转对应页面时 传递targetLayout参数用
125 customParamTargetLayout?: string 126 customParamTargetLayout?: string
  127 + //数据来源接口 0:非推荐楼层接口;1:推荐楼层接口
  128 + sourceInterfaceVal: number = 0
  129 + /**
  130 + * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING )
  131 + */
  132 + dataSourceType: string = '';
  133 + //组件ID
  134 + compId: string = '';
  135 + /**
  136 + * 是否推荐数据;默认0:否,1:是
  137 + */
  138 + recommend:number = 0
  139 + traceId: string = '';
  140 + traceInfo: string = '';
126 141
127 static clone(old: ContentDTO): ContentDTO { 142 static clone(old: ContentDTO): ContentDTO {
128 let content = new ContentDTO(); 143 let content = new ContentDTO();
@@ -51,38 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -51,38 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
51 51
52 toMore() { 52 toMore() {
53 if (this.moreWidth > this.initMoreWidth * 2) { 53 if (this.moreWidth > this.initMoreWidth * 2) {
54 - this.liveToMore();  
55 - }  
56 - }  
57 -  
58 - liveToMore() {  
59 - if (!!this.compDTO.dataSourceType) {  
60 - // if (this.compDTO.dataSourceType === 'OBJECT_POS') {  
61 - // ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)  
62 - // return;  
63 - // }  
64 - if (this.compDTO.linkUrl) {  
65 - let taskAction: Action = {  
66 - type: 'JUMP_H5_BY_WEB_VIEW',  
67 - params: {  
68 - url: this.compDTO.linkUrl  
69 - } as Params,  
70 - };  
71 - WDRouterRule.jumpWithAction(taskAction)  
72 - } else {  
73 - this.jumpToLiveMorePage()  
74 - }  
75 - } else {  
76 - if (this.compDTO?.objectType === '11') {  
77 - } else {  
78 - const contentDTO: ContentDTO = {  
79 - objectId: this.compDTO.objectId,  
80 - objectType: this.compDTO.objectType,  
81 - linkUrl: this.compDTO.linkUrl,  
82 - pageId: this.compDTO.pageId  
83 - } as ContentDTO  
84 - ProcessUtils.processPage(contentDTO)  
85 - } 54 + ProcessUtils.compJumpPage(this.compDTO)
86 } 55 }
87 } 56 }
88 57
@@ -115,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -115,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
115 } 84 }
116 .visibility(this.showMore() ? Visibility.Visible : Visibility.None) 85 .visibility(this.showMore() ? Visibility.Visible : Visibility.None)
117 .onClick(() => { 86 .onClick(() => {
118 - this.liveToMore(); 87 + ProcessUtils.compJumpPage(this.compDTO)
119 }) 88 })
120 89
121 }.justifyContent(FlexAlign.SpaceBetween) 90 }.justifyContent(FlexAlign.SpaceBetween)
@@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences'; @@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences';
7 import { TrackConstants } from 'wdTracking/Index'; 7 import { TrackConstants } from 'wdTracking/Index';
8 8
9 const TAG = 'SpacialTopicPage'; 9 const TAG = 'SpacialTopicPage';
10 - 10 +//H5专题
11 @Entry 11 @Entry
12 @Component 12 @Component
13 struct SpacialTopicPage { 13 struct SpacialTopicPage {