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
wangyong_wd
2024-03-31 21:52:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2437b647bd5bcce7c908f8baf96d9a015b17fc61
2437b647
1 parent
40e0f424
大专题卡跳转事件添加
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
46 deletions
sight_harmony/features/wdBean/src/main/ets/bean/morningevening/slideShows.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/CompStyle_10.ets
sight_harmony/features/wdBean/src/main/ets/bean/morningevening/slideShows.ets
View file @
2437b64
...
...
@@ -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;
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/CompStyle_10.ets
View file @
2437b64
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,51 +67,56 @@ export struct CompStyle_10 {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
@Builder timelineItem (item:slideShows, index:number) {
Column(){
Row() {
Column(){
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
Row(){
// 展示发稿人
if(item.source) {
Text(item.source)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_B0B0B0'))
.textOverflow({overflow: TextOverflow.Ellipsis})
.maxLines(1)
.width(item.source.length > 10 ? '60%' : '')
Row() {
Column(){
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
Row(){
// 展示发稿人
if(item.source) {
Text(item.source)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_B0B0B0'))
.textOverflow({overflow: TextOverflow.Ellipsis})
.maxLines(1)
.width(item.source.length > 10 ? '60%' : '')
Image($r('app.media.point'))
.width(16)
.height(16)
}
Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime))))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
Image($r('app.media.point'))
.width(16)
.height(16)
}
.margin({top: 12})
Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime))))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
.margin({top: 12})
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
// 右侧图片
if(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
Image(item.fullColumnImgUrls[0].url)
.width(117)
.height(78)
.objectFit(ImageFit.Cover)
.borderRadius(4)
.margin({left: 12})
}
// 右侧图片
if(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
Image(item.fullColumnImgUrls[0].url)
.width(117)
.height(78)
.objectFit(ImageFit.Cover)
.borderRadius(4)
.margin({left: 12})
}
.padding({top: 10, bottom: 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
...
...
Please
register
or
login
to post a comment