chenjun3_wd

16866 早晚报-背景色未填充到顶部、顶部元素缺失、字体不正确、日期规则不正确、评论数据统计不正确 渐变待完善

@@ -224,7 +224,7 @@ export struct MorningEveningPaperComponent { @@ -224,7 +224,7 @@ export struct MorningEveningPaperComponent {
224 // // subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '' 224 // // subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? ''
225 // subtitle: this.subTitle 225 // subtitle: this.subTitle
226 // }) 226 // })
227 - .margin({ left: 14, right: 14 }) 227 + // .margin({ left: 14, right: 14 })
228 } 228 }
229 .width('100%') 229 .width('100%')
230 // .backgroundColor(Color.Black) 230 // .backgroundColor(Color.Black)
@@ -26,6 +26,15 @@ export struct PaperTitleComponent { @@ -26,6 +26,15 @@ export struct PaperTitleComponent {
26 .id('img_logo1') 26 .id('img_logo1')
27 27
28 Row() { 28 Row() {
  29 + // 在 29 * 18 的矩形框中绘制一个三角形,起点(0, 0),经过(0, 18),经过(20, 18),终点(29, 0)
  30 + Polygon({ width: 29, height: 18 })
  31 + .points([[0, 0], [0, 18], [20, 18], [29, 0]])// .fill(Color.White)
  32 + .fillOpacity(0.2)
  33 + .fill(Color.White)
  34 + // .linearGradient({
  35 + // direction: GradientDirection.Right,
  36 + // colors: [[0xffffff, 1.0], [0xffffff, 0.75], [0xffffff, 0.5], [0xffffff, 0.0], [0xffffff, 0.0]]
  37 + // })
29 Text(this.title ?? "") 38 Text(this.title ?? "")
30 .margin({ left: 5 }) 39 .margin({ left: 5 })
31 .fontSize(20) 40 .fontSize(20)
@@ -38,7 +47,11 @@ export struct PaperTitleComponent { @@ -38,7 +47,11 @@ export struct PaperTitleComponent {
38 .fontSize(8) 47 .fontSize(8)
39 .fontColor($r('app.color.white')) 48 .fontColor($r('app.color.white'))
40 .maxLines(2) 49 .maxLines(2)
41 - 50 + this.rightDecorateBuilder()
  51 + // .linearGradient({
  52 + // direction: GradientDirection.Right,
  53 + // colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x4Dffffff, 0.75], [0x1ffffff, 0.0]]
  54 + // })
42 Image($r('app.media.bg_event_status_end')) 55 Image($r('app.media.bg_event_status_end'))
43 .height($r('app.float.top_arrow_size')) 56 .height($r('app.float.top_arrow_size'))
44 .width(100) 57 .width(100)
@@ -79,9 +92,32 @@ export struct PaperTitleComponent { @@ -79,9 +92,32 @@ export struct PaperTitleComponent {
79 ToastUtils.showToast('分享为公共方法,待开发', 1000) 92 ToastUtils.showToast('分享为公共方法,待开发', 1000)
80 }) 93 })
81 } 94 }
82 - .margin({ left: 14, right: 14 }) 95 + // .margin({ left: 14, right: 14 })
83 .height($r('app.float.top_bar_height')) 96 .height($r('app.float.top_bar_height'))
84 97
85 // .backgroundColor(Color.Black) 98 // .backgroundColor(Color.Black)
86 } 99 }
  100 +
  101 + @Builder
  102 + leftDecorateBuilder() {
  103 +
  104 + }
  105 +
  106 + @Builder
  107 + rightDecorateBuilder() {
  108 + Row() {
  109 + Polygon({ width: 20, height: 18 })
  110 + .points([[8, 0], [0, 18], [20, 18], [20, 0]])// .fill(Color.White)
  111 + .fillOpacity(0.3)
  112 + .fill(Color.White)
  113 + Rect({ width: 80, height: 18 })// .fillOpacity(0.3)
  114 + .fill(Color.White)
  115 + .fillOpacity(0.01)
  116 + .linearGradient({
  117 + direction: GradientDirection.Right,
  118 + colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x40ffffff, 0.25], [0x1ffffff, 0.0]]
  119 + })
  120 + }
  121 + .margin({ left: 6 })
  122 + }
87 } 123 }