Showing
2 changed files
with
55 additions
and
26 deletions
| @@ -27,35 +27,51 @@ export struct PaperTitleComponent { | @@ -27,35 +27,51 @@ export struct PaperTitleComponent { | ||
| 27 | 27 | ||
| 28 | Row() { | 28 | Row() { |
| 29 | // 在 29 * 18 的矩形框中绘制一个三角形,起点(0, 0),经过(0, 18),经过(20, 18),终点(29, 0) | 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) | 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({ | 34 | // .linearGradient({ |
| 35 | // direction: GradientDirection.Right, | 35 | // direction: GradientDirection.Right, |
| 36 | // colors: [[0xffffff, 1.0], [0xffffff, 0.75], [0xffffff, 0.5], [0xffffff, 0.0], [0xffffff, 0.0]] | 36 | // colors: [[0xffffff, 1.0], [0xffffff, 0.75], [0xffffff, 0.5], [0xffffff, 0.0], [0xffffff, 0.0]] |
| 37 | // }) | 37 | // }) |
| 38 | + Row() | ||
| 39 | + .width('29vp') | ||
| 40 | + .height('18vp') | ||
| 41 | + .clip(new Path({ | ||
| 42 | + commands: `M0 0 H${vp2px(29)} L${vp2px(20)} ${vp2px(18)} L0 ${vp2px(18)} Z` | ||
| 43 | + })) | ||
| 44 | + .linearGradient({ | ||
| 45 | + direction: GradientDirection.Right, // 渐变方向 | ||
| 46 | + repeating: false, // 渐变颜色是否重复 | ||
| 47 | + colors: [[0x1affffff, 0.0],[0x1affffff, 0.3], [0x33ffffff, 0.6], [0x4dffffff,1]] // 数组末尾元素占比小于1时满足重复着色效果 | ||
| 48 | + }) | ||
| 49 | + | ||
| 38 | Text(this.title ?? "") | 50 | Text(this.title ?? "") |
| 39 | - .margin({ left: 5 }) | ||
| 40 | - .fontSize(20) | 51 | + .margin({ left: 10 }) |
| 52 | + .fontSize(22) | ||
| 41 | .fontColor($r('app.color.white')) | 53 | .fontColor($r('app.color.white')) |
| 54 | + .fontWeight(900) | ||
| 42 | .maxLines(1) | 55 | .maxLines(1) |
| 43 | 56 | ||
| 57 | + | ||
| 44 | Text(this.subTitle ?? '')// Text('2024年\n1月16日') | 58 | Text(this.subTitle ?? '')// Text('2024年\n1月16日') |
| 45 | // .width(50) | 59 | // .width(50) |
| 46 | - .margin({ left: 5 }) | ||
| 47 | - .fontSize(8) | 60 | + .margin({ left: 6 }) |
| 61 | + .fontSize(10) | ||
| 48 | .fontColor($r('app.color.white')) | 62 | .fontColor($r('app.color.white')) |
| 49 | .maxLines(2) | 63 | .maxLines(2) |
| 64 | + .textAlign(TextAlign.End) | ||
| 50 | this.rightDecorateBuilder() | 65 | this.rightDecorateBuilder() |
| 51 | // .linearGradient({ | 66 | // .linearGradient({ |
| 52 | // direction: GradientDirection.Right, | 67 | // direction: GradientDirection.Right, |
| 53 | // colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x4Dffffff, 0.75], [0x1ffffff, 0.0]] | 68 | // colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x4Dffffff, 0.75], [0x1ffffff, 0.0]] |
| 54 | // }) | 69 | // }) |
| 55 | - Image($r('app.media.bg_event_status_end')) | ||
| 56 | - .height($r('app.float.top_arrow_size')) | ||
| 57 | - .width(100) | ||
| 58 | - .visibility(Visibility.None) | 70 | + // Image($r('app.media.bg_event_status_end')) |
| 71 | + // .height($r('app.float.top_arrow_size')) | ||
| 72 | + // .width(100) | ||
| 73 | + // .visibility(Visibility.None) | ||
| 74 | + | ||
| 59 | } | 75 | } |
| 60 | .height('100%') | 76 | .height('100%') |
| 61 | .alignItems(VerticalAlign.Center) | 77 | .alignItems(VerticalAlign.Center) |
| @@ -87,7 +103,7 @@ export struct PaperTitleComponent { | @@ -87,7 +103,7 @@ export struct PaperTitleComponent { | ||
| 87 | center: { anchor: "__container__", align: VerticalAlign.Center } | 103 | center: { anchor: "__container__", align: VerticalAlign.Center } |
| 88 | }) | 104 | }) |
| 89 | .id('img_share') | 105 | .id('img_share') |
| 90 | - .margin({ right: 13 }) | 106 | + .margin({ right: 16 }) |
| 91 | .onClick(() => { | 107 | .onClick(() => { |
| 92 | ToastUtils.showToast('分享为公共方法,待开发', 1000) | 108 | ToastUtils.showToast('分享为公共方法,待开发', 1000) |
| 93 | }) | 109 | }) |
| @@ -105,19 +121,32 @@ export struct PaperTitleComponent { | @@ -105,19 +121,32 @@ export struct PaperTitleComponent { | ||
| 105 | 121 | ||
| 106 | @Builder | 122 | @Builder |
| 107 | rightDecorateBuilder() { | 123 | 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) | 124 | + Row() |
| 125 | + .width('100vp') | ||
| 126 | + .height('18vp') | ||
| 127 | + .clip(new Path({ | ||
| 128 | + commands: `M${vp2px(9)} 0 H${vp2px(91)} V${vp2px(18)} L0 ${vp2px(18)} Z` | ||
| 129 | + })) | ||
| 116 | .linearGradient({ | 130 | .linearGradient({ |
| 117 | - direction: GradientDirection.Right, | ||
| 118 | - colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x40ffffff, 0.25], [0x1ffffff, 0.0]] | 131 | + direction: GradientDirection.Right, // 渐变方向 |
| 132 | + repeating: false, // 渐变颜色是否重复 | ||
| 133 | + colors: [[0x4dffffff, 0.0], [0x33ffffff, 0.3], [0x1affffff,0.6], [0x03ffffff,1]] // 数组末尾元素占比小于1时满足重复着色效果 | ||
| 119 | }) | 134 | }) |
| 120 | - } | ||
| 121 | - .margin({ left: 6 }) | 135 | + .margin({ left:8, right: 0}) |
| 136 | + | ||
| 137 | + // Row() { | ||
| 138 | + // Polygon({ width: 20, height: 18 }) | ||
| 139 | + // .points([[8, 0], [0, 18], [20, 18], [20, 0]])// .fill(Color.White) | ||
| 140 | + // .fillOpacity(0.3) | ||
| 141 | + // .fill(Color.White) | ||
| 142 | + // Rect({ width: 80, height: 18 })// .fillOpacity(0.3) | ||
| 143 | + // .fill(Color.White) | ||
| 144 | + // .fillOpacity(0.01) | ||
| 145 | + // .linearGradient({ | ||
| 146 | + // direction: GradientDirection.Right, | ||
| 147 | + // colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x40ffffff, 0.25], [0x1ffffff, 0.0]] | ||
| 148 | + // }) | ||
| 149 | + // } | ||
| 150 | + // .margin({ left: 6 }) | ||
| 122 | } | 151 | } |
| 123 | } | 152 | } |
| @@ -517,7 +517,7 @@ export struct PaperSingleColumn999CardView { | @@ -517,7 +517,7 @@ export struct PaperSingleColumn999CardView { | ||
| 517 | } | 517 | } |
| 518 | } | 518 | } |
| 519 | .backgroundColor(Color.White) | 519 | .backgroundColor(Color.White) |
| 520 | - .margin({ bottom: 5, left: 12, right: 12 }) | 520 | + .margin({ bottom: 14, left: 12, right: 12 }) |
| 521 | .borderRadius(4) | 521 | .borderRadius(4) |
| 522 | .onClick(() => { | 522 | .onClick(() => { |
| 523 | ProcessUtils.processPage(this.item) | 523 | ProcessUtils.processPage(this.item) |
-
Please register or login to post a comment