Showing
4 changed files
with
55 additions
and
15 deletions
| @@ -79,8 +79,7 @@ export struct MultiPictureDetailPageComponent { | @@ -79,8 +79,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 79 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 79 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 80 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 80 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 81 | }) | 81 | }) |
| 82 | - .width('100%') | ||
| 83 | - .height(56) | 82 | + .width('100%').height(56).margin(16) |
| 84 | .border({ width: {top: 0.5}, color: '#FFFFFF' }) | 83 | .border({ width: {top: 0.5}, color: '#FFFFFF' }) |
| 85 | .id('e_oper_row') | 84 | .id('e_oper_row') |
| 86 | } | 85 | } |
| @@ -8,10 +8,16 @@ export interface OperationItem { | @@ -8,10 +8,16 @@ export interface OperationItem { | ||
| 8 | 8 | ||
| 9 | const TAG = 'OperRowListView'; | 9 | const TAG = 'OperRowListView'; |
| 10 | 10 | ||
| 11 | +@Preview | ||
| 11 | @Component | 12 | @Component |
| 12 | export struct OperRowListView { | 13 | export struct OperRowListView { |
| 13 | @State operationList: OperationItem[] = [ | 14 | @State operationList: OperationItem[] = [ |
| 14 | { | 15 | { |
| 16 | + icon: $r('app.media.ic_comment'), | ||
| 17 | + text: "评论", | ||
| 18 | + num: 500, | ||
| 19 | + }, | ||
| 20 | + { | ||
| 15 | icon: $r('app.media.ic_like_uncheck'), | 21 | icon: $r('app.media.ic_like_uncheck'), |
| 16 | text: "点赞", | 22 | text: "点赞", |
| 17 | num: 6622 | 23 | num: 6622 |
| @@ -22,11 +28,6 @@ export struct OperRowListView { | @@ -22,11 +28,6 @@ export struct OperRowListView { | ||
| 22 | num: 662, | 28 | num: 662, |
| 23 | }, | 29 | }, |
| 24 | { | 30 | { |
| 25 | - icon: $r('app.media.ic_comment'), | ||
| 26 | - text: "评论", | ||
| 27 | - num: 500, | ||
| 28 | - }, | ||
| 29 | - { | ||
| 30 | icon: $r('app.media.ic_share'), | 31 | icon: $r('app.media.ic_share'), |
| 31 | text: "分享" | 32 | text: "分享" |
| 32 | } | 33 | } |
| @@ -36,16 +37,55 @@ export struct OperRowListView { | @@ -36,16 +37,55 @@ export struct OperRowListView { | ||
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | build() { | 39 | build() { |
| 39 | - | ||
| 40 | - Row() { | ||
| 41 | - ForEach(this.operationList, (item: OperationItem, index: number) => { | ||
| 42 | - this.buildOperationItem(item, index) | ||
| 43 | - }, (item: OperationItem, index: number) => JSON.stringify(item)) | 40 | + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems:ItemAlign.Center }){ |
| 41 | + Row() { | ||
| 42 | + Column() { | ||
| 43 | + Image($r('app.media.icon_arrow_left_white')) | ||
| 44 | + .width(24) | ||
| 45 | + .height(24) | ||
| 46 | + .aspectRatio(1) | ||
| 47 | + } | ||
| 48 | + .margin({ | ||
| 49 | + top: 0, | ||
| 50 | + left: 8, | ||
| 51 | + right: 8, | ||
| 52 | + bottom: 0 | ||
| 53 | + }) | ||
| 54 | + .alignItems(HorizontalAlign.Center) | ||
| 55 | + .hoverEffect(HoverEffect.Scale) | ||
| 56 | + .onClick((event: ClickEvent) => { | ||
| 57 | + ToastUtils.showToast('体验版,本功能暂未开发', 1000); | ||
| 58 | + }) | ||
| 59 | + TextInput({placeholder:'说两句...'}) | ||
| 60 | + .placeholderColor('#999999') | ||
| 61 | + .placeholderFont( | ||
| 62 | + { | ||
| 63 | + size: 12, | ||
| 64 | + weight: 400, | ||
| 65 | + family: 'PingFang SC-Regular' | ||
| 66 | + } | ||
| 67 | + ) | ||
| 68 | + .caretColor('#1A1A1A') | ||
| 69 | + .backgroundColor('#1A1A1A') | ||
| 70 | + .width('61.5%') | ||
| 71 | + .height(30) | ||
| 72 | + .borderRadius(0) | ||
| 73 | + } | ||
| 74 | + .width('45.5%') | ||
| 75 | + .alignItems(VerticalAlign.Center) | ||
| 76 | + .justifyContent(FlexAlign.Start) | ||
| 77 | + Row() { | ||
| 78 | + ForEach(this.operationList, (item: OperationItem, index: number) => { | ||
| 79 | + this.buildOperationItem(item, index) | ||
| 80 | + }, (item: OperationItem, index: number) => JSON.stringify(item)) | ||
| 81 | + } | ||
| 82 | + .width('54.5%') | ||
| 83 | + .alignItems(VerticalAlign.Center) | ||
| 84 | + .justifyContent(FlexAlign.Center) | ||
| 44 | } | 85 | } |
| 45 | .width('100%') | 86 | .width('100%') |
| 46 | - .height('100%') | ||
| 47 | - .alignItems(VerticalAlign.Center) | ||
| 48 | - .justifyContent(FlexAlign.Center) | 87 | + .height(56) |
| 88 | + .backgroundColor(Color.Black) | ||
| 49 | } | 89 | } |
| 50 | 90 | ||
| 51 | /** | 91 | /** |
| @@ -68,5 +108,6 @@ export struct OperRowListView { | @@ -68,5 +108,6 @@ export struct OperRowListView { | ||
| 68 | Logger.info(TAG, `buildOperationItem onClick event index: ${index}`); | 108 | Logger.info(TAG, `buildOperationItem onClick event index: ${index}`); |
| 69 | ToastUtils.showToast('体验版,本功能暂未开发', 1000); | 109 | ToastUtils.showToast('体验版,本功能暂未开发', 1000); |
| 70 | }) | 110 | }) |
| 111 | + .width('19%') | ||
| 71 | } | 112 | } |
| 72 | } | 113 | } |
1.27 KB
-
Please register or login to post a comment