陈剑华

fix: 16553 人民号动态下无法显示时间

@@ -3,10 +3,12 @@ @@ -3,10 +3,12 @@
3 */ 3 */
4 import { RmhInfoDTO } from 'wdBean' 4 import { RmhInfoDTO } from 'wdBean'
5 import { CommonConstants } from 'wdConstant/Index'; 5 import { CommonConstants } from 'wdConstant/Index';
  6 +import { DateTimeUtils } from 'wdKit';
6 7
7 @Component 8 @Component
8 export struct RmhTitle { 9 export struct RmhTitle {
9 @Prop rmhInfo: RmhInfoDTO 10 @Prop rmhInfo: RmhInfoDTO
  11 + @Prop publishTime: string | undefined
10 12
11 build() { 13 build() {
12 Flex() { 14 Flex() {
@@ -29,12 +31,22 @@ export struct RmhTitle { @@ -29,12 +31,22 @@ export struct RmhTitle {
29 .fontColor($r('app.color.color_222222')) 31 .fontColor($r('app.color.color_222222'))
30 .fontWeight(600) 32 .fontWeight(600)
31 .alignSelf(ItemAlign.Start) 33 .alignSelf(ItemAlign.Start)
32 - Text(this.rmhInfo.rmhDesc)  
33 - .fontSize($r("app.float.font_size_12"))  
34 - .fontColor($r("app.color.color_B0B0B0"))  
35 - .maxLines(1)  
36 - .alignSelf(ItemAlign.Start)  
37 - .textOverflow({ overflow: TextOverflow.Ellipsis }) 34 + Row() {
  35 + if (this.publishTime) {
  36 + Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
  37 + .fontSize($r("app.float.font_size_12"))
  38 + .fontColor($r("app.color.color_B0B0B0"))
  39 + Image($r('app.media.point'))
  40 + .width(16)
  41 + .height(16)
  42 + }
  43 + Text(this.rmhInfo.rmhDesc)
  44 + .fontSize($r("app.float.font_size_12"))
  45 + .fontColor($r("app.color.color_B0B0B0"))
  46 + .maxLines(1)
  47 + .alignSelf(ItemAlign.Start)
  48 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  49 + }
38 } 50 }
39 51
40 Blank() 52 Blank()
@@ -20,7 +20,7 @@ export struct Card12Component { @@ -20,7 +20,7 @@ export struct Card12Component {
20 Column() { 20 Column() {
21 // rmh信息 21 // rmh信息
22 if (this.contentDTO.rmhInfo) { 22 if (this.contentDTO.rmhInfo) {
23 - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) 23 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
24 } 24 }
25 // 标题 25 // 标题
26 if (this.contentDTO.newsTitle) { 26 if (this.contentDTO.newsTitle) {
@@ -52,7 +52,7 @@ export struct Card14Component { @@ -52,7 +52,7 @@ export struct Card14Component {
52 Column() { 52 Column() {
53 // rmh信息 53 // rmh信息
54 if (this.contentDTO.rmhInfo) { 54 if (this.contentDTO.rmhInfo) {
55 - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) 55 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
56 } 56 }
57 // 左标题,右图 57 // 左标题,右图
58 Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { 58 Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
@@ -58,7 +58,7 @@ export struct Card15Component { @@ -58,7 +58,7 @@ export struct Card15Component {
58 build() { 58 build() {
59 Column() { 59 Column() {
60 // rmh信息 60 // rmh信息
61 - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) 61 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
62 //新闻标题 62 //新闻标题
63 if (this.contentDTO.newsTitle) { 63 if (this.contentDTO.newsTitle) {
64 Text(this.contentDTO.newsTitle) 64 Text(this.contentDTO.newsTitle)
@@ -25,7 +25,7 @@ export struct Card16Component { @@ -25,7 +25,7 @@ export struct Card16Component {
25 Column() { 25 Column() {
26 // rmh信息 26 // rmh信息
27 if (this.contentDTO.rmhInfo) { 27 if (this.contentDTO.rmhInfo) {
28 - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) 28 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
29 } 29 }
30 // 标题 30 // 标题
31 if (this.contentDTO.newsTitle) { 31 if (this.contentDTO.newsTitle) {
@@ -77,7 +77,7 @@ export struct Card19Component { @@ -77,7 +77,7 @@ export struct Card19Component {
77 build() { 77 build() {
78 Column() { 78 Column() {
79 // rmh信息 79 // rmh信息
80 - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) 80 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
81 // 标题 81 // 标题
82 if (this.contentDTO.newsTitle) { 82 if (this.contentDTO.newsTitle) {
83 Text(this.contentDTO.newsTitle) 83 Text(this.contentDTO.newsTitle)
@@ -50,7 +50,7 @@ export struct Card20Component { @@ -50,7 +50,7 @@ export struct Card20Component {
50 build() { 50 build() {
51 Column() { 51 Column() {
52 // rmh信息 52 // rmh信息
53 - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) 53 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
54 // 标题 54 // 标题
55 if (this.contentDTO.newsTitle) { 55 if (this.contentDTO.newsTitle) {
56 Text(this.contentDTO.newsTitle) 56 Text(this.contentDTO.newsTitle)
@@ -16,7 +16,7 @@ export struct Card21Component { @@ -16,7 +16,7 @@ export struct Card21Component {
16 build() { 16 build() {
17 Column() { 17 Column() {
18 // 顶部 rmh信息 18 // 顶部 rmh信息
19 - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo }) 19 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
20 // 中间内容 20 // 中间内容
21 Grid() { 21 Grid() {
22 GridItem() { 22 GridItem() {