yangsunyue_wd

横滑卡3:2 UI

  1 +import { CommonConstants } from 'wdConstant'
  2 +import { CompDTO } from '../repository/bean/CompDTO'
  3 +
  4 +@Component
  5 +export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
  6 + @State compDTO: CompDTO = {} as CompDTO
  7 + private arr: number[] = [0, 1, 2]
  8 + build() {
  9 + Column() {
  10 + Row() {
  11 + Row() {
  12 + Image($r("app.media.redLine"))
  13 + .width(3)
  14 + .height(16)
  15 + .margin({ right: 4 })
  16 + Text("大标题")
  17 + .fontSize($r("app.float.font_size_17"))
  18 + .fontColor($r("app.color.color_222222"))
  19 + .fontWeight(600)
  20 + }
  21 +
  22 + Row() {
  23 + Text("更多")
  24 + .fontSize($r("app.float.font_size_14"))
  25 + .fontColor($r("app.color.color_999999"))
  26 + .margin({ right: 1 })
  27 + Image($r("app.media.more"))
  28 + .width(14)
  29 + .height(14)
  30 + }
  31 + }.justifyContent(FlexAlign.SpaceBetween)
  32 + .padding({left:16,right:16})
  33 + .margin({top:8 ,bottom:8})
  34 + .width('100%')
  35 + // .backgroundColor($r("app.color.white"))
  36 + List({ space: 12 }) {
  37 +
  38 + ForEach(this.arr, (item: number) => {
  39 + ListItem() {
  40 + Column() {
  41 + Image($r("app.media.setting"))
  42 + .aspectRatio(1.5)
  43 + .width(150)
  44 + .borderRadius(4)
  45 + .objectFit(ImageFit.Cover)
  46 +
  47 + Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
  48 + .fontSize($r("app.float.font_size_14"))
  49 + .fontColor($r("app.color.color_212228"))
  50 + .fontWeight(400)
  51 + .maxLines(2)
  52 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  53 + .textAlign(TextAlign.Start)
  54 + .margin({ top: 8 })
  55 + .width(150)
  56 + }
  57 + }
  58 + .padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0})
  59 + // .offset({x:16})
  60 + }, item => item)
  61 +
  62 + }.listDirection(Axis.Horizontal)
  63 + .width('100%')
  64 + // .backgroundColor($r("app.color.color_FE4B05"))
  65 + // .padding({left:16,right:16})
  66 + // .margin({left:16,right:16})
  67 +
  68 + }
  69 + .width("100%")
  70 + .padding({
  71 + top: 14,
  72 + left: 0,
  73 + right: 0,
  74 + bottom: 14
  75 + })
  76 + .backgroundColor($r("app.color.white"))
  77 + // .backgroundColor($r("app.color.color_FE4B05"))
  78 + .margin({ bottom: 8 })
  79 + }
  80 +}
  81 +
  1 +import { CommonConstants } from 'wdConstant'
  2 +import { CompDTO } from '../repository/bean/CompDTO'
  3 +
  4 +@Component
  5 +export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
  6 + @State compDTO: CompDTO = {} as CompDTO
  7 + build() {
  8 + Column() {
  9 + Row() {
  10 + Row() {
  11 + Image($r("app.media.redLine"))
  12 + .width(3)
  13 + .height(16)
  14 + .margin({ right: 4 })
  15 + Text("大标题")
  16 + .fontSize($r("app.float.font_size_17"))
  17 + .fontColor($r("app.color.color_222222"))
  18 + .fontWeight(600)
  19 + }
  20 +
  21 + Row() {
  22 + Text("更多")
  23 + .fontSize($r("app.float.font_size_14"))
  24 + .fontColor($r("app.color.color_999999"))
  25 + .margin({ right: 1 })
  26 + Image($r("app.media.more"))
  27 + .width(14)
  28 + .height(14)
  29 + }
  30 + }.justifyContent(FlexAlign.SpaceBetween)
  31 + .margin({ top: 8 ,bottom: 8})
  32 + .width('100%')
  33 +
  34 +
  35 + Image($r("app.media.setting"))
  36 + .aspectRatio(1.5)
  37 + .width('100%')
  38 + .borderRadius(4)
  39 + .objectFit(ImageFit.Cover)
  40 +
  41 + Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
  42 + .fontSize($r("app.float.font_size_14"))
  43 + .fontColor($r("app.color.color_212228"))
  44 + .fontWeight(400)
  45 + .maxLines(1)
  46 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  47 + .textAlign(TextAlign.Start)
  48 + .margin({ top: 8 })
  49 + .width('100%')
  50 +
  51 + }.width("100%")
  52 + .padding({
  53 + top: 14,
  54 + left: 16,
  55 + right: 16,
  56 + bottom: 14
  57 + })
  58 + .backgroundColor($r("app.color.white"))
  59 + .margin({ bottom: 8 })
  60 + }
  61 +}
  1 +import { CommonConstants } from 'wdConstant'
  2 +import { CompDTO } from '../repository/bean/CompDTO'
  3 +
  4 +@Component
  5 +export struct HorizontalStrokeCardThreeTwoRadioForTwoComponent {
  6 + @State compDTO: CompDTO = {} as CompDTO
  7 + private arr: number[] = [0, 1, 2]
  8 + build() {
  9 + Column() {
  10 + Row() {
  11 + Row() {
  12 + Image($r("app.media.redLine"))
  13 + .width(3)
  14 + .height(16)
  15 + .margin({ right: 4 })
  16 + Text("大标题")
  17 + .fontSize($r("app.float.font_size_17"))
  18 + .fontColor($r("app.color.color_222222"))
  19 + .fontWeight(600)
  20 + }
  21 +
  22 + Row() {
  23 + Text("更多")
  24 + .fontSize($r("app.float.font_size_14"))
  25 + .fontColor($r("app.color.color_999999"))
  26 + .margin({ right: 1 })
  27 + Image($r("app.media.more"))
  28 + .width(14)
  29 + .height(14)
  30 + }
  31 + }.justifyContent(FlexAlign.SpaceBetween)
  32 + .padding({left:16,right:16})
  33 + .margin({top:8 ,bottom:8})
  34 + .width('100%')
  35 + // .backgroundColor($r("app.color.white"))
  36 + List({ space: 12 }) {
  37 +
  38 + ForEach(this.arr, (item: number) => {
  39 + ListItem() {
  40 + Column() {
  41 + Image($r("app.media.setting"))
  42 + .aspectRatio(1.5)
  43 + .width(210)
  44 + .borderRadius(4)
  45 + .objectFit(ImageFit.Cover)
  46 +
  47 + Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
  48 + .fontSize($r("app.float.font_size_14"))
  49 + .fontColor($r("app.color.color_212228"))
  50 + .fontWeight(400)
  51 + .maxLines(2)
  52 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  53 + .textAlign(TextAlign.Start)
  54 + .margin({ top: 8 })
  55 + .width(210)
  56 + }
  57 + }
  58 + .padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0})
  59 + // .offset({x:16})
  60 + }, item => item)
  61 +
  62 + }.listDirection(Axis.Horizontal)
  63 + .width('100%')
  64 + // .backgroundColor($r("app.color.color_FE4B05"))
  65 + // .padding({left:16,right:16})
  66 + // .margin({left:16,right:16})
  67 +
  68 + }
  69 + .width("100%")
  70 + .padding({
  71 + top: 14,
  72 + left: 0,
  73 + right: 0,
  74 + bottom: 14
  75 + })
  76 + .backgroundColor($r("app.color.white"))
  77 + // .backgroundColor($r("app.color.color_FE4B05"))
  78 + .margin({ bottom: 8 })
  79 + }
  80 +}
  81 +
@@ -8,6 +8,10 @@ import { LabelComponent } from './LabelComponent'; @@ -8,6 +8,10 @@ import { LabelComponent } from './LabelComponent';
8 import { LoadingComponent } from './LoadingComponent'; 8 import { LoadingComponent } from './LoadingComponent';
9 import { TitleAbbrComponent } from './TitleAbbrComponent'; 9 import { TitleAbbrComponent } from './TitleAbbrComponent';
10 import { TitleAllComponent } from './TitleAllComponent'; 10 import { TitleAllComponent } from './TitleAllComponent';
  11 +import { HorizontalStrokeCardThreeTwoRadioForOneComponent } from './HorizontalStrokeCardThreeTwoRadioForOneComponent';
  12 +import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './HorizontalStrokeCardThreeTwoRadioForTwoComponent';
  13 +import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './HorizontalStrokeCardThreeTwoRadioForMoreComponent';
  14 +
11 15
12 const TAG = 'PageComponent'; 16 const TAG = 'PageComponent';
13 17
@@ -31,6 +31,11 @@ @@ -31,6 +31,11 @@
31 { 31 {
32 "name": "color_B0B0B0", 32 "name": "color_B0B0B0",
33 "value": "#B0B0B0" 33 "value": "#B0B0B0"
34 - } 34 + },
  35 + {
  36 + "name": "color_212228",
  37 + "value": "#212228"
  38 + },
  39 +
35 ] 40 ]
36 } 41 }
@@ -21,6 +21,10 @@ @@ -21,6 +21,10 @@
21 "value": "16fp" 21 "value": "16fp"
22 }, 22 },
23 { 23 {
  24 + "name": "font_size_17",
  25 + "value": "17fp"
  26 + },
  27 + {
24 "name": "normal_text_size", 28 "name": "normal_text_size",
25 "value": "16fp" 29 "value": "16fp"
26 }, 30 },