wangyong_wd

大专题卡跳转事件添加

... ... @@ -2,15 +2,15 @@ import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO';
export interface slideShows {
fullColumnImgUrls: FullColumnImgUrlDTO[];
linkUrl?: string;
newsId?: string;
newsId: string;
newsTitle?: string;
newsTitleColor?: string;
objectLevel?: string;
objectType?: string;
objectType: string;
pageId?: string;
photoNum?: string;
publishTime: number;
relId?: string;
relId: string;
source?: string;
timeBlurred?: string;
videoDuration?: string;
... ...
import { CompDTO, slideShows } from 'wdBean';
import { CompDTO, ContentDTO, slideShows } from 'wdBean';
import { CommonConstants } from 'wdConstant'
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 大专题卡--CompStyle: 10
... ... @@ -24,6 +26,9 @@ export struct CompStyle_10 {
// 大图
Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)
.width('100%')
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.compDTO?.operDataList[0])
})
// 专题列表--后端返回三个,
Column(){
ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
... ... @@ -47,9 +52,8 @@ export struct CompStyle_10 {
.borderRadius(3)
.justifyContent(FlexAlign.Center)
.margin({top: 5})
.onClick(() => {
// TODO
console.log('跳转到查看更多的页面')
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.compDTO?.operDataList[0])
})
}
}
... ... @@ -63,9 +67,7 @@ export struct CompStyle_10 {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
@Builder timelineItem (item:slideShows, index:number) {
Column(){
Row() {
Column(){
Text(item.newsTitle)
... ... @@ -108,6 +110,13 @@ export struct CompStyle_10 {
}
}
.padding({top: 10, bottom: 10})
}
.onClick((event: ClickEvent) => {
const str: string = JSON.stringify(this.compDTO.operDataList[0]);
const data: ContentDTO = JSON.parse(str)
data.objectId = item.newsId
data.relId = item.relId
data.objectType = String(item.objectType)
ProcessUtils.processPage(data)
})
}
}
\ No newline at end of file
... ...