chenjun3_wd

Changes图集卡

  1 +@Component
  2 +export struct AlbumCard {
  3 + // @Link isRefreshData: boolean; // Timer to fresh
  4 + // @State title: Resource = $r('app.string.title_default');
  5 +
  6 + build() {
  7 + Column({ space: 8 }) {
  8 + Text('测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字' +
  9 + '测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字' +
  10 + '测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字')
  11 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  12 + .fontSize(17)
  13 + .fontColor(0x222222)
  14 + .lineHeight(25)
  15 + .maxLines(3)
  16 + .margin({ top: 6,
  17 + left: 16,
  18 + right: 16 })
  19 + .width(343)
  20 + .height(75)
  21 +
  22 + RelativeContainer() {
  23 + Image($r('app.media.icon'))
  24 + .width(229)
  25 + .height(154)
  26 + .alignRules({
  27 + top: {anchor: "__container__", align: VerticalAlign.Top},
  28 + left: {anchor: "__container__", align: HorizontalAlign.Start}
  29 + })
  30 + .id('mainImage')
  31 +
  32 + Image($r('app.media.icon'))
  33 + .width(112)
  34 + .height(76)
  35 + .alignRules({
  36 + top: {anchor: "__container__", align: VerticalAlign.Top},
  37 + right: {anchor: "__container__", align: HorizontalAlign.End}
  38 + })
  39 + .id('subTopImage')
  40 +
  41 + Image($r('app.media.icon'))
  42 + .width(112)
  43 + .height(76)
  44 + .alignRules({
  45 + right: {anchor: "__container__", align: HorizontalAlign.End},
  46 + bottom: {anchor: "__container__", align: VerticalAlign.Bottom}
  47 + })
  48 + .id('subBottomImage')
  49 +
  50 + Shape() {
  51 + Rect().width(33).height(18)
  52 + }
  53 + // .viewPort({ x: -2, y: -2, width: 304, height: 130 })
  54 + .fill(0x000000)
  55 + .fillOpacity(0.3)
  56 + // .strokeDashArray([20])
  57 + // .strokeDashOffset(10)
  58 + .strokeLineCap(LineCapStyle.Round)
  59 + .strokeLineJoin(LineJoinStyle.Round)
  60 + .antiAlias(true)
  61 + .id('shape')
  62 + .alignRules({
  63 + right: {anchor: "__container__", align: HorizontalAlign.End},
  64 + bottom: {anchor: "__container__", align: VerticalAlign.Bottom}
  65 + })
  66 + .margin({right:4 ,
  67 + bottom:4})
  68 +
  69 + Image($r('app.media.album_card_shape'))
  70 + .width(22)
  71 + .height(18)
  72 + .alignRules({
  73 + left: {anchor: "shape", align: HorizontalAlign.Start},
  74 + top: {anchor: "shape", align: VerticalAlign.Top}
  75 + })
  76 + .id('shapeSubImage')
  77 +
  78 + Text('6')
  79 + .fontSize(13)
  80 + .fontColor(0xFFFFFF)
  81 + .id('pageIndex')
  82 + .alignRules({
  83 + right: {anchor: "shape", align: HorizontalAlign.End},
  84 + top: {anchor: "shape", align: VerticalAlign.Top}
  85 + })
  86 + .margin({right:2})
  87 + .textAlign(TextAlign.Center)
  88 + .width(17)
  89 + .height(17)
  90 + }
  91 + .width(343)
  92 + .height(154)
  93 +
  94 + Row() {
  95 + Text('人民日报')
  96 + .fontSize(13)
  97 + .fontColor(0xB0B0B0)
  98 + .margin({
  99 + left:16
  100 + })
  101 +
  102 + Image($r('app.media.album_card_divide'))
  103 + .width(16)
  104 + .height(16)
  105 +
  106 + Text('46分钟前')
  107 + .fontSize(13)
  108 + .fontColor(0xB0B0B0)
  109 +
  110 + Text('328评')
  111 + .fontSize(13)
  112 + .fontColor(0xB0B0B0)
  113 + .margin({
  114 + left:6
  115 + })
  116 + }
  117 + .width(375)
  118 + .height(16)
  119 + .id('label')
  120 + }
  121 + .width(375)
  122 + .height(289)
  123 + // .backgroundColor(0x000000)
  124 + }
  125 +}