liyubing

Merge remote-tracking branch 'origin/main'

import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean';
import { Action, ContentDTO, Params, PhotoListBean, commentInfo, CompDTO } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
... ... @@ -72,6 +72,76 @@ export class ProcessUtils {
ProcessUtils.processPage(content);
}
//更多
static compJumpPage(bean:CompDTO){
let contentBean = ProcessUtils.compBeanToContentBean(bean)
if(contentBean == null){
return
}
if(ProcessUtils.checkMoreJumpPage(bean)){
ProcessUtils.processPage(contentBean)
}else{
ProcessUtils.moreTojumpLivePage(contentBean);
}
}
static moreTojumpLivePage(contentBean:ContentDTO){
if(!StringUtils.isEmpty(contentBean.dataSourceType)){
if(contentBean.dataSourceType == 'LIVE_HORIZONTAL_CARD') {
//直播中
WDRouterRule.jumpWithPage(WDRouterPage.liveMorePage)
}else if(contentBean.dataSourceType == 'LIVE_RESERVATION'){
//预约列表
WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage)
}else if(contentBean.dataSourceType == 'LIVE_MONTHLY_RANKING'){
contentBean.objectType = '6'
ProcessUtils.processPage(contentBean)
}
}
}
static checkMoreJumpPage(content:CompDTO){
let loacalJump = true
if(content.dataSourceType == 'LIVE_HORIZONTAL_CARD'){
loacalJump = false
}else if(content.dataSourceType == 'LIVE_RESERVATION'){
loacalJump = false
}else if(content.dataSourceType == 'LIVE_MONTHLY_RANKING'){
loacalJump = false
}
return loacalJump
}
static compBeanToContentBean(compDTO:CompDTO){
if(compDTO == null){
return
}
let content = new ContentDTO()
content.objectType = compDTO.objectType||'0'
content.objectLevel = compDTO.objectLevel
content.objectId = compDTO.objectId
content.pageId = compDTO.pageId||''
content.newsTitle = compDTO.objectTitle
content.newsSummary = compDTO.objectSummary
// compContentBean.setTopicInfoBean(getTopicInfoBean());
// compContentBean.setChannelInfoBean(getChannelInfoBean());
content.bottomNavId = compDTO.bottomNavId
content.sourceInterfaceVal = compDTO.sourceInterfaceVal
content.dataSourceType = compDTO.dataSourceType
content.compId = compDTO.id+''
content.linkUrl = compDTO.linkUrl
content.appStyle = compDTO.appStyle
content.recommend = compDTO.recommend
content.expIds = compDTO.expIds
content.relId = compDTO.relId
content.relType = compDTO.relType
content.itemId = compDTO.itemId
content.itemType = compDTO.itemType
content.sceneId = compDTO.sceneId
content.traceId = compDTO.traceId
content.traceInfo = compDTO.traceInfo
return content
}
/**
* 页面跳转
*/
... ... @@ -114,6 +184,8 @@ export class ProcessUtils {
ProcessUtils.gotoAudio(content)
break;
case ContentConstants.TYPE_TELETEXT:
ProcessUtils.gotoWeb(content);
break;
case ContentConstants.TYPE_Activity:
// 图文详情,跳转h5
if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑
... ...
... ... @@ -25,7 +25,12 @@ export class CompDTO implements BaseDTO {
// meddleDataList: any[];
name: string = '';
objectId: string = ''; // 跳转页面id?
/**
* 频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间轴专题)
*/
objectLevel:string = ''
objectTitle: string = ''; // comp标题
objectSummary: string = ''; // 跳转频道、专题摘要【BFF聚合】
// objectType?: string; // 跳转类型,枚举:
operDataList: ContentDTO[] = []; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
// pageId?: any;
... ... @@ -51,8 +56,22 @@ export class CompDTO implements BaseDTO {
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1'
relId?: String = ''
relType?: String = ''
bottomNavId:string = ''
//数据来源接口 0:非推荐楼层接口;1:推荐楼层接口
sourceInterfaceVal: number = 0
appStyle: string = '';
/**
* 是否推荐数据;默认0:否,1:是
*/
recommend:number = 0
relId: string = '';
relType: string = '';
itemType: string = '';
sceneId: string = '';
traceId: string = '';
traceInfo: string = '';
/**
* 创建新的compbean对象
* @param old
... ...
... ... @@ -27,6 +27,7 @@ export class ContentDTO implements BaseDTO {
liveType?: string; // 直播新闻-直播状态
expIds: string = '';
itemId: string = '';
itemType: string = '';
shareFlag?: string = '1';
appStyle: string = '';
cityCode: string = '';
... ... @@ -123,6 +124,20 @@ export class ContentDTO implements BaseDTO {
timestamp: String = '1'
// 自定义参数,用于跳转对应页面时 传递targetLayout参数用
customParamTargetLayout?: string
//数据来源接口 0:非推荐楼层接口;1:推荐楼层接口
sourceInterfaceVal: number = 0
/**
* 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING )
*/
dataSourceType: string = '';
//组件ID
compId: string = '';
/**
* 是否推荐数据;默认0:否,1:是
*/
recommend:number = 0
traceId: string = '';
traceInfo: string = '';
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
... ...
... ... @@ -91,29 +91,19 @@ export struct CardSourceInfo {
}
build() {
Flex({ alignItems: ItemAlign.Center }) {
Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) {
// 标签
if (this.contentDTO.corner) {
Text(this.contentDTO.corner)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_ED2800"))
.margin({ right: 6 })
}
if (this.contentDTO.cornerMark) {
Text(this.contentDTO.cornerMark)
if (this.contentDTO.cornerMark || this.contentDTO.corner) {
Text(this.contentDTO.cornerMark || this.contentDTO.corner)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_ED2800"))
.margin({ right: 6 })
.flexShrink(0)
}
// 来源信息
if (this.contentDTO.rmhPlatform === 1) {
Text(this.contentDTO.rmhInfo?.rmhName)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (this.contentDTO.source) {
Text(`${this.contentDTO.source}`)
if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
Text(this.contentDTO.rmhPlatform === 1 ? this.contentDTO.rmhInfo?.rmhName : this.contentDTO.source)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
... ... @@ -169,6 +159,7 @@ export struct CardSourceInfo {
}
.width(CommonConstants.FULL_WIDTH)
.height(16)
.margin({ top: this.viewShowData ? 8 : 0 })
}
... ...
... ... @@ -116,7 +116,8 @@ export struct RmhTitle {
Stack() {
Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag'))
.width(36)
.height(36).borderRadius(50)
.height(36)
.borderRadius(50)
Image(this.rmhInfo?.authIcon)
.width(14)
.height(14)
... ... @@ -128,10 +129,13 @@ export struct RmhTitle {
Column() {
Text(this.rmhInfo?.rmhName)
.fontSize($r('app.float.font_size_13'))
.fontSize(15)
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.alignSelf(ItemAlign.Start)
.height(21)
.lineHeight(21)
.margin({bottom: 1})
Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) {
Row() {
if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) {
... ... @@ -139,11 +143,13 @@ export struct RmhTitle {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.height(14)
.lineHeight(14)
}
if (this.publishTime && this.rmhInfo?.rmhDesc) {
Image($r('app.media.point'))
.width(16)
.height(16)
.width(14)
.height(14)
}
}
if(this.rmhInfo?.rmhDesc != undefined){
... ... @@ -154,12 +160,16 @@ export struct RmhTitle {
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textAlign(TextAlign.Start)
.height(14)
.lineHeight(14)
}
}
.width('75%')
.height(14)
}
}
.justifyContent(FlexAlign.SpaceBetween)
Blank()
if (this.rmhInfo?.cnIsAttention) {
... ...
... ... @@ -51,41 +51,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
toMore() {
if (this.moreWidth > this.initMoreWidth * 2) {
this.liveToMore();
}
}
liveToMore() {
if (!!this.compDTO.dataSourceType) {
// if (this.compDTO.dataSourceType === 'OBJECT_POS') {
// ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
// return;
// }
if (this.compDTO.linkUrl) {
// console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'JUMP_H5_BY_WEB_VIEW')
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
} else {
// console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'jumpToLiveMorePage')
this.jumpToLiveMorePage()
}
} else {
if (this.compDTO?.objectType === '11') {
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
// console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'ProcessUtils.processPage')
ProcessUtils.processPage(contentDTO)
}
ProcessUtils.compJumpPage(this.compDTO)
}
}
... ... @@ -118,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
}
.visibility(this.showMore() ? Visibility.Visible : Visibility.None)
.onClick(() => {
this.liveToMore();
ProcessUtils.compJumpPage(this.compDTO)
})
}.justifyContent(FlexAlign.SpaceBetween)
... ...
... ... @@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences';
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'SpacialTopicPage';
//H5专题
@Entry
@Component
struct SpacialTopicPage {
... ...