Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
张善主
2024-06-26 10:37:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ad296e434d1e18037abf697543c00a93c15e0273
ad296e43
1 parent
707c43fa
fix(公共跳转): 更多跳转优化
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
35 deletions
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/features/wdBean/src/main/ets/bean/component/CompDTO.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
ad296e4
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
}
/**
* 页面跳转
*/
...
...
sight_harmony/features/wdBean/src/main/ets/bean/component/CompDTO.ets
View file @
ad296e4
...
...
@@ -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,6 +56,22 @@ export class CompDTO implements BaseDTO {
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1'
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
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
ad296e4
...
...
@@ -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();
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
View file @
ad296e4
...
...
@@ -51,38 +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) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
} else {
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
ProcessUtils.processPage(contentDTO)
}
ProcessUtils.compJumpPage(this.compDTO)
}
}
...
...
@@ -115,7 +84,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
}
.visibility(this.showMore() ? Visibility.Visible : Visibility.None)
.onClick(() => {
this.liveToMore();
ProcessUtils.compJumpPage(this.compDTO)
})
}.justifyContent(FlexAlign.SpaceBetween)
...
...
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
View file @
ad296e4
...
...
@@ -7,7 +7,7 @@ import dataPreferences from '@ohos.data.preferences';
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'SpacialTopicPage';
//H5专题
@Entry
@Component
struct SpacialTopicPage {
...
...
Please
register
or
login
to post a comment