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,51 +67,56 @@ export struct CompStyle_10 { @@ -63,51 +67,56 @@ 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() {  
70 - Column(){  
71 - Text(item.newsTitle)  
72 - .fontSize($r('app.float.font_size_17'))  
73 - .fontWeight(400)  
74 - .fontColor($r('app.color.color_222222'))  
75 - .maxLines(2)  
76 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
77 - Row(){  
78 - // 展示发稿人  
79 - if(item.source) {  
80 - Text(item.source)  
81 - .fontSize($r('app.float.font_size_12'))  
82 - .fontColor($r('app.color.color_B0B0B0'))  
83 - .textOverflow({overflow: TextOverflow.Ellipsis})  
84 - .maxLines(1)  
85 - .width(item.source.length > 10 ? '60%' : '') 71 + Row() {
  72 + Column(){
  73 + Text(item.newsTitle)
  74 + .fontSize($r('app.float.font_size_17'))
  75 + .fontWeight(400)
  76 + .fontColor($r('app.color.color_222222'))
  77 + .maxLines(2)
  78 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  79 + Row(){
  80 + // 展示发稿人
  81 + if(item.source) {
  82 + Text(item.source)
  83 + .fontSize($r('app.float.font_size_12'))
  84 + .fontColor($r('app.color.color_B0B0B0'))
  85 + .textOverflow({overflow: TextOverflow.Ellipsis})
  86 + .maxLines(1)
  87 + .width(item.source.length > 10 ? '60%' : '')
86 88
87 - Image($r('app.media.point'))  
88 - .width(16)  
89 - .height(16)  
90 - }  
91 - Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime))))  
92 - .fontSize($r("app.float.font_size_12"))  
93 - .fontColor($r("app.color.color_B0B0B0")) 89 + Image($r('app.media.point'))
  90 + .width(16)
  91 + .height(16)
94 } 92 }
95 - .margin({top: 12}) 93 + Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime))))
  94 + .fontSize($r("app.float.font_size_12"))
  95 + .fontColor($r("app.color.color_B0B0B0"))
96 } 96 }
97 - .layoutWeight(1)  
98 - .alignItems(HorizontalAlign.Start) 97 + .margin({top: 12})
  98 + }
  99 + .layoutWeight(1)
  100 + .alignItems(HorizontalAlign.Start)
99 101
100 - // 右侧图片  
101 - if(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {  
102 - Image(item.fullColumnImgUrls[0].url)  
103 - .width(117)  
104 - .height(78)  
105 - .objectFit(ImageFit.Cover)  
106 - .borderRadius(4)  
107 - .margin({left: 12})  
108 - } 102 + // 右侧图片
  103 + if(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
  104 + Image(item.fullColumnImgUrls[0].url)
  105 + .width(117)
  106 + .height(78)
  107 + .objectFit(ImageFit.Cover)
  108 + .borderRadius(4)
  109 + .margin({left: 12})
109 } 110 }
110 - .padding({top: 10, bottom: 10})  
111 } 111 }
  112 + .padding({top: 10, bottom: 10})
  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 }