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
yuzhilin
2024-05-07 18:54:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f457735c4be80f3fe13bb49cd7274b7f9950e4c2
f457735c
1 parent
292113d8
fix:动态详情页样式
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
f457735
...
...
@@ -29,7 +29,8 @@ import { publishCommentModel } from './comment/model/PublishCommentModel';
import { CommentComponent } from './comment/view/CommentComponent';
const TAG = 'DynamicDetailComponent'
@Preview
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
// @Preview
@Component
export struct DynamicDetailComponent {
//入参
...
...
@@ -53,6 +54,7 @@ export struct DynamicDetailComponent {
//跳转
private mJumpInfo: ContentDTO = {} as ContentDTO;
@State publishTime: string = ''
async aboutToAppear() {
...
...
@@ -71,7 +73,7 @@ export struct DynamicDetailComponent {
.height($r('app.float.margin_28'))
.margin({ left: $r('app.float.margin_16') })
Blank()
Text(
StringUtils.isEmpty(this.contentDetailData.publishTime)?"":this.contentDetailData.publishTime.replace('-','年').replace('-','月').replace(' ','日 ').substring(0,this.contentDetailData.publishTime.length-2)
)
Text(
this.publishTime
)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize($r('app.float.font_size_12'))
.lineHeight($r('app.float.margin_28'))
...
...
@@ -79,6 +81,8 @@ export struct DynamicDetailComponent {
}
.height($r('app.float.margin_48'))
.width('100%')
.alignItems(VerticalAlign.Bottom)
.padding({bottom:5})
//分割线
Image($r('app.media.ic_news_detail_division'))
.width('100%')
...
...
@@ -338,23 +342,23 @@ export struct DynamicDetailComponent {
,left: $r('app.float.vp_12')
,right: $r('app.float.vp_12') })
//微信/朋友圈/微博
Row(){
Image($r('app.media.xxhdpi_pic_wechat'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.objectFit(ImageFit.Cover)
Image($r('app.media.xxhdpi_pic_pyq'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.margin({ left: $r('app.float.margin_4_negative')})
.objectFit(ImageFit.Cover)
Image($r('app.media.xxhdpi_pic_wb'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.margin({ left: $r('app.float.margin_4_negative')})
.objectFit(ImageFit.Cover)
}
.margin({ top: $r('app.float.margin_24')})
// Row(){
// Image($r('app.media.xxhdpi_pic_wechat'))
// .width($r('app.float.margin_116'))
// .height($r('app.float.margin_36'))
// .objectFit(ImageFit.Cover)
// Image($r('app.media.xxhdpi_pic_pyq'))
// .width($r('app.float.margin_116'))
// .height($r('app.float.margin_36'))
// .margin({ left: $r('app.float.margin_4_negative')})
// .objectFit(ImageFit.Cover)
// Image($r('app.media.xxhdpi_pic_wb'))
// .width($r('app.float.margin_116'))
// .height($r('app.float.margin_36'))
// .margin({ left: $r('app.float.margin_4_negative')})
// .objectFit(ImageFit.Cover)
// }
// .margin({ top: $r('app.float.margin_24')})
//点赞
Row(){
Blank().layoutWeight(1)
...
...
@@ -435,6 +439,10 @@ export struct DynamicDetailComponent {
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.contentDetailData = data[0];
let dateTime =
DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime)
console.log('动态详情',JSON.stringify(this.contentDetailData))
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
...
...
Please
register
or
login
to post a comment