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
zhangwenqiang
2024-08-21 17:48:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
003ee53ec2d07d7a4a4d32a73d73541a8b04faf8
003ee53e
1 parent
5368b896
动态详情页面UI优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
28 deletions
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
003ee53
...
...
@@ -173,10 +173,15 @@ export struct DynamicDetailComponent {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.alt(this.contentDetailData.rmhInfo?.userType == '1' ? $r('app.media.default_head') :
$r('app.media.icon_default_head_mater'))
.width($r('app.float.margin_32'))
.height($r('app.float.margin_32'))
.width($r('app.float.margin_36'))
.height($r('app.float.margin_36'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_16'))
.borderRadius(50)
.border({
width: 0.5,
color: '#0D000000', // 5% 透明度的黑色
style: BorderStyle.Solid
})
Image(this.contentDetailData.rmhInfo?.honoraryIcon)
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
...
...
@@ -185,12 +190,12 @@ export struct DynamicDetailComponent {
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_12'))
.height($r('app.float.vp_12'))
.width($r('app.float.vp_14'))
.height($r('app.float.vp_14'))
.objectFit(ImageFit.Cover)
}
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.width($r('app.float.margin_36'))
.height($r('app.float.margin_36'))
.alignContent(Alignment.BottomEnd)
}
}
...
...
@@ -209,24 +214,32 @@ export struct DynamicDetailComponent {
Column() {
//昵称
Text(this.contentDetailData.rmhInfo?.rmhName)
.fontSize(
$r('app.float.font_size_14')
)
.fontSize(
15
)
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.margin_5') })
.fontWeight(600)
.alignSelf(ItemAlign.Start)
.height(21)
.lineHeight(21)
.margin({bottom: 1})
// .fontSize($r('app.float.font_size_14'))
// .fontColor($r('app.color.color_222222'))
// .fontWeight(FontWeight.Medium)
// .margin({ left: $r('app.float.margin_5') })
// .alignSelf(ItemAlign.Start)
//简介
Text(this.contentDetailData.rmhInfo?.rmhDesc)
.fontSize($r('app.float.font_size_1
4
'))
.fontSize($r('app.float.font_size_1
2
'))
.fontColor($r('app.color.color_B0B0B0'))
.fontWeight(FontWeight.Medium)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ left: $r('app.float.margin_5') })
.alignSelf(ItemAlign.Start)
.height(14)
.lineHeight(14)
}
.width('
63
%')
.width('
70
%')
.margin({ right: $r('app.float.margin_6') })
Blank()
if (!StringUtils.isEmpty(this.followStatus)) {
if (this.followStatus == '0') {
Row() {
...
...
@@ -272,25 +285,22 @@ export struct DynamicDetailComponent {
})
}
}
}
.width('100%')
.margin({ left: $r('app.float.margin_16') })
//内容
Text(StringUtils.isEmpty(this.contentDetailData.newsContent)
? StringUtils.isEmpty(this.contentDetailData.newsSummary)
? this.contentDetailData.newsTitle
: this.contentDetailData.newsSummary
: this.contentDetailData.newsContent)
}.padding({
left: $r('app.float.vp_16')
, right: $r('app.float.vp_16')
})
//标题
Text(this.titleText())
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_18'))
.lineHeight($r('app.float.margin_25'))
.margin({
.width('100%')
.padding({
top: $r('app.float.margin_6')
, left: $r('app.float.margin_16')
, right: $r('app.float.margin_16')
, left: $r('app.float.vp_16')
, right: $r('app.float.margin_6')
})
.alignSelf(ItemAlign.Start)
//内容
if (this.contentDetailData.newsType + "" == ContentConstants.TYPE_FOURTEEN) {
//附件内容:图片/视频
if (this.contentDetailData.photoList != null && this.contentDetailData.photoList.length > 0) {
...
...
@@ -637,6 +647,16 @@ export struct DynamicDetailComponent {
.height('100%')
}
private titleText() {
if(!StringUtils.isEmpty(this.contentDetailData.newsContent)){
return this.contentDetailData.newsContent
}
if(StringUtils.isEmpty(this.contentDetailData.newsSummary)){
return this.contentDetailData.newsTitle
}
return this.contentDetailData.newsSummary
}
/**
* 请求(动态)详情页数据
* */
...
...
Please
register
or
login
to post a comment