wangyong_wd

大专题卡跳转事件添加

@@ -2,15 +2,15 @@ import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'; @@ -2,15 +2,15 @@ import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO';
2 export interface slideShows { 2 export interface slideShows {
3 fullColumnImgUrls: FullColumnImgUrlDTO[]; 3 fullColumnImgUrls: FullColumnImgUrlDTO[];
4 linkUrl?: string; 4 linkUrl?: string;
5 - newsId?: string; 5 + newsId: string;
6 newsTitle?: string; 6 newsTitle?: string;
7 newsTitleColor?: string; 7 newsTitleColor?: string;
8 objectLevel?: string; 8 objectLevel?: string;
9 - objectType?: string; 9 + objectType: string;
10 pageId?: string; 10 pageId?: string;
11 photoNum?: string; 11 photoNum?: string;
12 publishTime: number; 12 publishTime: number;
13 - relId?: string; 13 + relId: string;
14 source?: string; 14 source?: string;
15 timeBlurred?: string; 15 timeBlurred?: string;
16 videoDuration?: string; 16 videoDuration?: string;
1 -import { CompDTO, slideShows } from 'wdBean'; 1 +import { CompDTO, ContentDTO, slideShows } from 'wdBean';
2 import { CommonConstants } from 'wdConstant' 2 import { CommonConstants } from 'wdConstant'
3 import { DateTimeUtils } from 'wdKit'; 3 import { DateTimeUtils } from 'wdKit';
  4 +import { ProcessUtils } from '../../utils/ProcessUtils';
  5 +
4 6
5 /** 7 /**
6 * 大专题卡--CompStyle: 10 8 * 大专题卡--CompStyle: 10
@@ -24,6 +26,9 @@ export struct CompStyle_10 { @@ -24,6 +26,9 @@ export struct CompStyle_10 {
24 // 大图 26 // 大图
25 Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl) 27 Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)
26 .width('100%') 28 .width('100%')
  29 + .onClick((event: ClickEvent) => {
  30 + ProcessUtils.processPage(this.compDTO?.operDataList[0])
  31 + })
27 // 专题列表--后端返回三个, 32 // 专题列表--后端返回三个,
28 Column(){ 33 Column(){
29 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => { 34 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
@@ -47,9 +52,8 @@ export struct CompStyle_10 { @@ -47,9 +52,8 @@ export struct CompStyle_10 {
47 .borderRadius(3) 52 .borderRadius(3)
48 .justifyContent(FlexAlign.Center) 53 .justifyContent(FlexAlign.Center)
49 .margin({top: 5}) 54 .margin({top: 5})
50 - .onClick(() => {  
51 - // TODO  
52 - console.log('跳转到查看更多的页面') 55 + .onClick((event: ClickEvent) => {
  56 + ProcessUtils.processPage(this.compDTO?.operDataList[0])
53 }) 57 })
54 } 58 }
55 } 59 }
@@ -63,9 +67,7 @@ export struct CompStyle_10 { @@ -63,9 +67,7 @@ export struct CompStyle_10 {
63 .backgroundColor($r("app.color.white")) 67 .backgroundColor($r("app.color.white"))
64 .margin({ bottom: 8 }) 68 .margin({ bottom: 8 })
65 } 69 }
66 -  
67 @Builder timelineItem (item:slideShows, index:number) { 70 @Builder timelineItem (item:slideShows, index:number) {
68 - Column(){  
69 Row() { 71 Row() {
70 Column(){ 72 Column(){
71 Text(item.newsTitle) 73 Text(item.newsTitle)
@@ -108,6 +110,13 @@ export struct CompStyle_10 { @@ -108,6 +110,13 @@ export struct CompStyle_10 {
108 } 110 }
109 } 111 }
110 .padding({top: 10, bottom: 10}) 112 .padding({top: 10, bottom: 10})
111 - } 113 + .onClick((event: ClickEvent) => {
  114 + const str: string = JSON.stringify(this.compDTO.operDataList[0]);
  115 + const data: ContentDTO = JSON.parse(str)
  116 + data.objectId = item.newsId
  117 + data.relId = item.relId
  118 + data.objectType = String(item.objectType)
  119 + ProcessUtils.processPage(data)
  120 + })
112 } 121 }
113 } 122 }