Showing
3 changed files
with
15 additions
and
40 deletions
| @@ -29,8 +29,9 @@ export struct ImageDownloadComponent { | @@ -29,8 +29,9 @@ export struct ImageDownloadComponent { | ||
| 29 | // .width(24) | 29 | // .width(24) |
| 30 | // .height(24) | 30 | // .height(24) |
| 31 | // .margin({bottom:6}) | 31 | // .margin({bottom:6}) |
| 32 | - SaveButton({ icon: SaveIconStyle.LINES }) | 32 | + SaveButton({ icon: SaveIconStyle.FULL_FILLED, buttonType: ButtonType.Capsule }) |
| 33 | .iconSize(24) | 33 | .iconSize(24) |
| 34 | + .backgroundColor(Color.Transparent) | ||
| 34 | .iconColor(Color.White) | 35 | .iconColor(Color.White) |
| 35 | .onClick(async () => { | 36 | .onClick(async () => { |
| 36 | console.info(`cj2024 onClick ${this.imageBuffer}`) | 37 | console.info(`cj2024 onClick ${this.imageBuffer}`) |
| @@ -11,7 +11,6 @@ const TAG = 'MultiPictureListPage'; | @@ -11,7 +11,6 @@ const TAG = 'MultiPictureListPage'; | ||
| 11 | @Entry | 11 | @Entry |
| 12 | @Component | 12 | @Component |
| 13 | export struct MultiPictureListPage { | 13 | export struct MultiPictureListPage { |
| 14 | - private scroller: Scroller = new Scroller() | ||
| 15 | @State swiperIndex: number = 0; | 14 | @State swiperIndex: number = 0; |
| 16 | photoList: PhotoListBean[] = []; | 15 | photoList: PhotoListBean[] = []; |
| 17 | private swiperController: SwiperController = new SwiperController() | 16 | private swiperController: SwiperController = new SwiperController() |
| @@ -96,9 +95,6 @@ export struct MultiPictureListPage { | @@ -96,9 +95,6 @@ export struct MultiPictureListPage { | ||
| 96 | this.currentUrl = this.photoList[targetIndex]?.picPath | 95 | this.currentUrl = this.photoList[targetIndex]?.picPath |
| 97 | }) | 96 | }) |
| 98 | 97 | ||
| 99 | - Row() { | ||
| 100 | - Scroll(this.scroller) { | ||
| 101 | - Row() { | ||
| 102 | Flex({ | 98 | Flex({ |
| 103 | direction: FlexDirection.Row, | 99 | direction: FlexDirection.Row, |
| 104 | justifyContent: FlexAlign.SpaceBetween | 100 | justifyContent: FlexAlign.SpaceBetween |
| @@ -115,39 +111,22 @@ export struct MultiPictureListPage { | @@ -115,39 +111,22 @@ export struct MultiPictureListPage { | ||
| 115 | .fontWeight(500) | 111 | .fontWeight(500) |
| 116 | .lineHeight(19) | 112 | .lineHeight(19) |
| 117 | } | 113 | } |
| 114 | + .alignSelf(ItemAlign.Center) | ||
| 118 | .fontColor(Color.White) | 115 | .fontColor(Color.White) |
| 119 | - .margin(4) | ||
| 120 | - } | 116 | + ImageDownloadComponent({ url: this.currentUrl }) |
| 121 | } | 117 | } |
| 122 | - .width('100%') | ||
| 123 | .margin({ | 118 | .margin({ |
| 124 | - top: 8, | ||
| 125 | - left: 18, | ||
| 126 | - bottom: 24, | ||
| 127 | - right: 18 | 119 | + top: 14, |
| 120 | + left: 20, | ||
| 121 | + bottom: 14, | ||
| 122 | + right: 0 | ||
| 128 | }) | 123 | }) |
| 129 | - } | ||
| 130 | - .scrollable(ScrollDirection.Vertical) | ||
| 131 | - .scrollBarWidth(0) | ||
| 132 | - } | ||
| 133 | .id('e_swiper_titles') | 124 | .id('e_swiper_titles') |
| 134 | .alignRules({ | 125 | .alignRules({ |
| 135 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 126 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 136 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 127 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 137 | }) | 128 | }) |
| 138 | } | 129 | } |
| 139 | - ImageDownloadComponent({ url: this.currentUrl }) | ||
| 140 | - .alignRules({ | ||
| 141 | - bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 142 | - right: { anchor: "__container__", align: HorizontalAlign.End } | ||
| 143 | - }) | ||
| 144 | - .margin({ | ||
| 145 | - top: 8, | ||
| 146 | - left: 18, | ||
| 147 | - bottom: 24, | ||
| 148 | - right: 18 | ||
| 149 | - }) | ||
| 150 | - .id("downloadImg") | ||
| 151 | } | 130 | } |
| 152 | .width('100%') | 131 | .width('100%') |
| 153 | .height('100%') | 132 | .height('100%') |
| @@ -457,8 +457,6 @@ export struct MultiPictureDetailPageComponent { | @@ -457,8 +457,6 @@ export struct MultiPictureDetailPageComponent { | ||
| 457 | 457 | ||
| 458 | @Builder | 458 | @Builder |
| 459 | YShowDownload() { | 459 | YShowDownload() { |
| 460 | - Column() { | ||
| 461 | - Row() { | ||
| 462 | Flex({ | 460 | Flex({ |
| 463 | direction: FlexDirection.Row, | 461 | direction: FlexDirection.Row, |
| 464 | justifyContent: FlexAlign.SpaceBetween | 462 | justifyContent: FlexAlign.SpaceBetween |
| @@ -476,18 +474,12 @@ export struct MultiPictureDetailPageComponent { | @@ -476,18 +474,12 @@ export struct MultiPictureDetailPageComponent { | ||
| 476 | .fontWeight(500) | 474 | .fontWeight(500) |
| 477 | .lineHeight(19) | 475 | .lineHeight(19) |
| 478 | } | 476 | } |
| 477 | + .alignSelf(ItemAlign.Center) | ||
| 479 | .fontColor(Color.White) | 478 | .fontColor(Color.White) |
| 480 | - .margin(4) | ||
| 481 | } | 479 | } |
| 482 | 480 | ||
| 483 | if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) { | 481 | if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) { |
| 484 | ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) | 482 | ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) |
| 485 | - .margin({ | ||
| 486 | - top: 8, | ||
| 487 | - left: 18, | ||
| 488 | - bottom: 24, | ||
| 489 | - right: 18 | ||
| 490 | - }) | ||
| 491 | .parallelGesture( | 483 | .parallelGesture( |
| 492 | TapGesture() | 484 | TapGesture() |
| 493 | .onAction((event: GestureEvent) => { | 485 | .onAction((event: GestureEvent) => { |
| @@ -495,9 +487,12 @@ export struct MultiPictureDetailPageComponent { | @@ -495,9 +487,12 @@ export struct MultiPictureDetailPageComponent { | ||
| 495 | })) | 487 | })) |
| 496 | } | 488 | } |
| 497 | } | 489 | } |
| 498 | - } | ||
| 499 | - .width('100%') | ||
| 500 | - } | 490 | + .margin({ |
| 491 | + top: 14, | ||
| 492 | + left: 20, | ||
| 493 | + bottom: 14, | ||
| 494 | + right: 0 | ||
| 495 | + }) | ||
| 501 | .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | 496 | .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| 502 | TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` }) | 497 | TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` }) |
| 503 | )) | 498 | )) |
-
Please register or login to post a comment