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-28 12:31:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a9b7c7fe490989d967d584dc4f277244193de18a
a9b7c7fe
1 parent
53fa6ed2
新增时间链卡类型
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
154 additions
and
8 deletions
sight_harmony/commons/wdConstant/src/main/ets/enum/CompStyle.ts
sight_harmony/features/wdBean/Index.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdBean/src/main/ets/bean/morningevening/slideShows.ets
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/CompStyle_09.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/local_selection.png
sight_harmony/commons/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
a9b7c7f
...
...
@@ -28,6 +28,6 @@ export const enum CompStyle {
ZhGrid_Layout_03
=
'Zh_Grid_Layout-03'
,
//金刚位卡
Album_Card_01
=
'17'
,
//图卡集
Zh_Single_Row_04
=
'Zh_Single_Row-04'
,
// 地方精选卡
CompStyle_09
=
9
,
// 时间链卡
CompStyle_10
=
10
,
// 大专题卡
CompStyle_09
=
'9'
,
// 时间链卡
CompStyle_10
=
'10'
,
// 大专题卡
}
...
...
sight_harmony/features/wdBean/Index.ets
View file @
a9b7c7f
...
...
@@ -91,3 +91,4 @@ export { OperDataList } from './src/main/ets/bean/morningevening/OperDataList';
export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo';
export { slideShows } from './src/main/ets/bean/morningevening/slideShows';
\ No newline at end of file
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
a9b7c7f
...
...
@@ -2,6 +2,8 @@ import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO';
import { LiveInfoDTO } from '../detail/LiveInfoDTO';
import { VideoInfoDTO } from '../detail/VideoInfoDTO';
import { InteractDataDTO } from './InteractDataDTO';
import { slideShows } from '../morningevening/slideShows'
export interface ContentDTO {
cityCode: string;
...
...
@@ -58,4 +60,7 @@ export interface ContentDTO {
// 二次请求接口,返回的数据,这里组装到content里;TODO 后续优化
interactData:InteractDataDTO;
hasMore: number,
slideShows: slideShows[]
}
\ No newline at end of file
...
...
sight_harmony/features/wdBean/src/main/ets/bean/morningevening/slideShows.ets
0 → 100644
View file @
a9b7c7f
import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO';
export interface slideShows {
fullColumnImgUrls: FullColumnImgUrlDTO[];
linkUrl?: string;
newsId?: string;
newsTitle?: string;
newsTitleColor?: string;
objectLevel?: string;
objectType?: string;
pageId?: string;
photoNum?: string;
publishTime: number;
relId?: string;
source?: string;
timeBlurred?: string;
videoDuration?: string;
videoLandscape?: string;
videoUrl?: string;
voiceDuration?: string;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
a9b7c7f
import { CompDTO, ContentDTO } from 'wdBean';
import { CompDTO, ContentDTO
, slideShows
} from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant';
import { BannerComponent } from './view/BannerComponent';
import { LabelComponent } from './view/LabelComponent';
...
...
@@ -16,10 +16,10 @@ import {
import {
HorizontalStrokeCardThreeTwoRadioForOneComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
import {
HorizontalStrokeCardThreeTwoRadioForTwoComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForTwoComponent';
import { AlbumCardComponent } from './view/AlbumCardComponent';
import { ZhSingleRow04 } from './view/ZhSingleRow04'
import { CompStyle_09 } from './view/CompStyle_09'
import { CompStyle_10 } from './view/CompStyle_10'
/**
* comp适配器.
...
...
@@ -126,8 +126,12 @@ export struct CompParser {
ZhGridLayoutComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Album_Card_01) {
AlbumCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Single_Row_02) {
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: compDTO})
} else if (compDTO.compStyle === CompStyle.CompStyle_09) {
CompStyle_09({ compDTO: compDTO})
} else if (compDTO.compStyle === CompStyle.CompStyle_10) {
CompStyle_10({ compDTO: compDTO})
}
else {
// todo:组件未实现 / Component Not Implemented
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/CompStyle_09.ets
0 → 100644
View file @
a9b7c7f
import { CompDTO, slideShows } from 'wdBean';
import { CommonConstants } from 'wdConstant'
import { DateTimeUtils } from 'wdKit';
/**
* 时间链卡--CompStyle: 09
*/
@Component
export struct CompStyle_09 {
@State compDTO: CompDTO = {} as CompDTO
build() {
Column(){
// 顶部标题,最多两行
if(this.compDTO.operDataList[0].newsTitle) {
Text(this.compDTO.operDataList[0].newsTitle)
.width(CommonConstants.FULL_WIDTH)
.fontSize($r('app.float.font_size_17'))
.fontWeight(600)
.maxLines(2)
.textOverflow({overflow: TextOverflow.Ellipsis})
.margin({ bottom: 19 })
}
// 大图
Image(this.compDTO.operDataList[0].coverUrl)
.width('100%')
// 时间线--后端返回三个,
Column(){
ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
this.timelineItem(item, index)
})
}
// 底部-查看更多。根据接口返回的isMore判断是否显示查看更多
if(this.compDTO.operDataList[0].hasMore == 1) {
Row() {
Text("查看更多")
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_222222"))
.margin({ right: 1 })
Image($r("app.media.more"))
.width(14)
.height(14)
}
.backgroundColor($r('app.color.color_F5F5F5'))
.width(CommonConstants.FULL_WIDTH)
.height(40)
.borderRadius(3)
.justifyContent(FlexAlign.Center)
.margin({top: 5})
.onClick(() => {
// TODO
console.log('跳转到查看更多的页面')
})
}
}
.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
@Builder timelineItem (item:slideShows, index:number) {
Column(){
Stack() {
if(index < this.compDTO.operDataList[0].slideShows.length - 1) {
Line()
.width(1)
.startPoint([4, index > 0 ? 0 : 20])
.endPoint([4, 100])
.stroke($r('app.color.color_EDEDED'))
.strokeWidth(1)
.strokeLineCap(LineCapStyle.Butt)
}
Column(){
Row() {
// 标题
Image($r("app.media.point_icon"))
.width(9)
.height(6)
.margin({ right: 5 })
Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm"))
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
}
.width(CommonConstants.FULL_WIDTH)
.height(32)
Row() {
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.layoutWeight(1)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.alignSelf(ItemAlign.Center)
.margin({left: 12})
if(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
Image(item.fullColumnImgUrls[0].url)
.width(90)
.height(60)
.borderRadius(4)
}
}
}
}
.alignContent(Alignment.Start)
}
.height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78)
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/local_selection.png
0 → 100644
View file @
a9b7c7f
1.48 KB
Please
register
or
login
to post a comment