Showing
7 changed files
with
134 additions
and
61 deletions
| 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 | */ |
| @@ -114,6 +184,8 @@ export class ProcessUtils { | @@ -114,6 +184,8 @@ export class ProcessUtils { | ||
| 114 | ProcessUtils.gotoAudio(content) | 184 | ProcessUtils.gotoAudio(content) |
| 115 | break; | 185 | break; |
| 116 | case ContentConstants.TYPE_TELETEXT: | 186 | case ContentConstants.TYPE_TELETEXT: |
| 187 | + ProcessUtils.gotoWeb(content); | ||
| 188 | + break; | ||
| 117 | case ContentConstants.TYPE_Activity: | 189 | case ContentConstants.TYPE_Activity: |
| 118 | // 图文详情,跳转h5 | 190 | // 图文详情,跳转h5 |
| 119 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 | 191 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 |
| @@ -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,8 +56,22 @@ export class CompDTO implements BaseDTO { | @@ -51,8 +56,22 @@ export class CompDTO implements BaseDTO { | ||
| 51 | 56 | ||
| 52 | // keyGenerator相关字符串,用于刷新list布局 | 57 | // keyGenerator相关字符串,用于刷新list布局 |
| 53 | timestamp: String = '1' | 58 | timestamp: String = '1' |
| 54 | - relId?: String = '' | ||
| 55 | - relType?: String = '' | 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 = ''; | ||
| 56 | /** | 75 | /** |
| 57 | * 创建新的compbean对象 | 76 | * 创建新的compbean对象 |
| 58 | * @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(); |
| @@ -91,29 +91,19 @@ export struct CardSourceInfo { | @@ -91,29 +91,19 @@ export struct CardSourceInfo { | ||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | build() { | 93 | build() { |
| 94 | - Flex({ alignItems: ItemAlign.Center }) { | 94 | + Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) { |
| 95 | // 标签 | 95 | // 标签 |
| 96 | - if (this.contentDTO.corner) { | ||
| 97 | - Text(this.contentDTO.corner) | ||
| 98 | - .fontSize($r("app.float.font_size_11")) | ||
| 99 | - .fontColor($r("app.color.color_ED2800")) | ||
| 100 | - .margin({ right: 6 }) | ||
| 101 | - } | ||
| 102 | - if (this.contentDTO.cornerMark) { | ||
| 103 | - Text(this.contentDTO.cornerMark) | 96 | + if (this.contentDTO.cornerMark || this.contentDTO.corner) { |
| 97 | + Text(this.contentDTO.cornerMark || this.contentDTO.corner) | ||
| 104 | .fontSize($r("app.float.font_size_11")) | 98 | .fontSize($r("app.float.font_size_11")) |
| 105 | .fontColor($r("app.color.color_ED2800")) | 99 | .fontColor($r("app.color.color_ED2800")) |
| 106 | .margin({ right: 6 }) | 100 | .margin({ right: 6 }) |
| 101 | + .flexShrink(0) | ||
| 107 | } | 102 | } |
| 103 | + | ||
| 108 | // 来源信息 | 104 | // 来源信息 |
| 109 | - if (this.contentDTO.rmhPlatform === 1) { | ||
| 110 | - Text(this.contentDTO.rmhInfo?.rmhName) | ||
| 111 | - .fontSize($r("app.float.font_size_11")) | ||
| 112 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 113 | - .maxLines(1) | ||
| 114 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 115 | - } else if (this.contentDTO.source) { | ||
| 116 | - Text(`${this.contentDTO.source}`) | 105 | + if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { |
| 106 | + Text(this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source) | ||
| 117 | .fontSize($r("app.float.font_size_11")) | 107 | .fontSize($r("app.float.font_size_11")) |
| 118 | .fontColor($r("app.color.color_B0B0B0")) | 108 | .fontColor($r("app.color.color_B0B0B0")) |
| 119 | .maxLines(1) | 109 | .maxLines(1) |
| @@ -169,6 +159,7 @@ export struct CardSourceInfo { | @@ -169,6 +159,7 @@ export struct CardSourceInfo { | ||
| 169 | 159 | ||
| 170 | } | 160 | } |
| 171 | .width(CommonConstants.FULL_WIDTH) | 161 | .width(CommonConstants.FULL_WIDTH) |
| 162 | + .height(16) | ||
| 172 | .margin({ top: this.viewShowData ? 8 : 0 }) | 163 | .margin({ top: this.viewShowData ? 8 : 0 }) |
| 173 | } | 164 | } |
| 174 | 165 |
| @@ -116,7 +116,8 @@ export struct RmhTitle { | @@ -116,7 +116,8 @@ export struct RmhTitle { | ||
| 116 | Stack() { | 116 | Stack() { |
| 117 | Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) | 117 | Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) |
| 118 | .width(36) | 118 | .width(36) |
| 119 | - .height(36).borderRadius(50) | 119 | + .height(36) |
| 120 | + .borderRadius(50) | ||
| 120 | Image(this.rmhInfo?.authIcon) | 121 | Image(this.rmhInfo?.authIcon) |
| 121 | .width(14) | 122 | .width(14) |
| 122 | .height(14) | 123 | .height(14) |
| @@ -128,10 +129,13 @@ export struct RmhTitle { | @@ -128,10 +129,13 @@ export struct RmhTitle { | ||
| 128 | 129 | ||
| 129 | Column() { | 130 | Column() { |
| 130 | Text(this.rmhInfo?.rmhName) | 131 | Text(this.rmhInfo?.rmhName) |
| 131 | - .fontSize($r('app.float.font_size_13')) | 132 | + .fontSize(15) |
| 132 | .fontColor($r('app.color.color_222222')) | 133 | .fontColor($r('app.color.color_222222')) |
| 133 | .fontWeight(600) | 134 | .fontWeight(600) |
| 134 | .alignSelf(ItemAlign.Start) | 135 | .alignSelf(ItemAlign.Start) |
| 136 | + .height(21) | ||
| 137 | + .lineHeight(21) | ||
| 138 | + .margin({bottom: 1}) | ||
| 135 | Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { | 139 | Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { |
| 136 | Row() { | 140 | Row() { |
| 137 | if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) { | 141 | if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) { |
| @@ -139,11 +143,13 @@ export struct RmhTitle { | @@ -139,11 +143,13 @@ export struct RmhTitle { | ||
| 139 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) | 143 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) |
| 140 | .fontSize($r("app.float.font_size_12")) | 144 | .fontSize($r("app.float.font_size_12")) |
| 141 | .fontColor($r("app.color.color_B0B0B0")) | 145 | .fontColor($r("app.color.color_B0B0B0")) |
| 146 | + .height(14) | ||
| 147 | + .lineHeight(14) | ||
| 142 | } | 148 | } |
| 143 | if (this.publishTime && this.rmhInfo?.rmhDesc) { | 149 | if (this.publishTime && this.rmhInfo?.rmhDesc) { |
| 144 | Image($r('app.media.point')) | 150 | Image($r('app.media.point')) |
| 145 | - .width(16) | ||
| 146 | - .height(16) | 151 | + .width(14) |
| 152 | + .height(14) | ||
| 147 | } | 153 | } |
| 148 | } | 154 | } |
| 149 | if(this.rmhInfo?.rmhDesc != undefined){ | 155 | if(this.rmhInfo?.rmhDesc != undefined){ |
| @@ -154,12 +160,16 @@ export struct RmhTitle { | @@ -154,12 +160,16 @@ export struct RmhTitle { | ||
| 154 | .alignSelf(ItemAlign.Start) | 160 | .alignSelf(ItemAlign.Start) |
| 155 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 161 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 156 | .textAlign(TextAlign.Start) | 162 | .textAlign(TextAlign.Start) |
| 163 | + .height(14) | ||
| 164 | + .lineHeight(14) | ||
| 157 | } | 165 | } |
| 158 | 166 | ||
| 159 | } | 167 | } |
| 160 | .width('75%') | 168 | .width('75%') |
| 169 | + .height(14) | ||
| 161 | } | 170 | } |
| 162 | } | 171 | } |
| 172 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 163 | 173 | ||
| 164 | Blank() | 174 | Blank() |
| 165 | if (this.rmhInfo?.cnIsAttention) { | 175 | if (this.rmhInfo?.cnIsAttention) { |
| @@ -51,41 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -51,41 +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 | - // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'JUMP_H5_BY_WEB_VIEW') | ||
| 66 | - let taskAction: Action = { | ||
| 67 | - type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 68 | - params: { | ||
| 69 | - url: this.compDTO.linkUrl | ||
| 70 | - } as Params, | ||
| 71 | - }; | ||
| 72 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 73 | - } else { | ||
| 74 | - // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'jumpToLiveMorePage') | ||
| 75 | - this.jumpToLiveMorePage() | ||
| 76 | - } | ||
| 77 | - } else { | ||
| 78 | - if (this.compDTO?.objectType === '11') { | ||
| 79 | - } else { | ||
| 80 | - const contentDTO: ContentDTO = { | ||
| 81 | - objectId: this.compDTO.objectId, | ||
| 82 | - objectType: this.compDTO.objectType, | ||
| 83 | - linkUrl: this.compDTO.linkUrl, | ||
| 84 | - pageId: this.compDTO.pageId | ||
| 85 | - } as ContentDTO | ||
| 86 | - // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'ProcessUtils.processPage') | ||
| 87 | - ProcessUtils.processPage(contentDTO) | ||
| 88 | - } | 54 | + ProcessUtils.compJumpPage(this.compDTO) |
| 89 | } | 55 | } |
| 90 | } | 56 | } |
| 91 | 57 | ||
| @@ -118,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -118,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 118 | } | 84 | } |
| 119 | .visibility(this.showMore() ? Visibility.Visible : Visibility.None) | 85 | .visibility(this.showMore() ? Visibility.Visible : Visibility.None) |
| 120 | .onClick(() => { | 86 | .onClick(() => { |
| 121 | - this.liveToMore(); | 87 | + ProcessUtils.compJumpPage(this.compDTO) |
| 122 | }) | 88 | }) |
| 123 | 89 | ||
| 124 | }.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 { |
-
Please register or login to post a comment