Showing
1 changed file
with
53 additions
and
42 deletions
| 1 | -import { NetworkUtil, Logger, NetworkType, SPHelper, } from 'wdKit'; | 1 | +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit'; |
| 2 | import { ResponseDTO } from 'wdNetwork'; | 2 | import { ResponseDTO } from 'wdNetwork'; |
| 3 | import { | 3 | import { |
| 4 | ContentDetailDTO, | 4 | ContentDetailDTO, |
| @@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent { | @@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent { | ||
| 78 | 78 | ||
| 79 | build() { | 79 | build() { |
| 80 | RelativeContainer() { | 80 | RelativeContainer() { |
| 81 | - if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | ||
| 82 | - Swiper(this.swiperController) { | ||
| 83 | - ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { | ||
| 84 | - Swiper(this.swiperControllerItem) { | ||
| 85 | - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | 81 | + this.init() |
| 86 | } | 82 | } |
| 87 | .width('100%') | 83 | .width('100%') |
| 88 | .height('100%') | 84 | .height('100%') |
| 89 | - .vertical(true) | ||
| 90 | - .autoPlay(false) | ||
| 91 | - .cachedCount(1) | ||
| 92 | - .indicator(false) | ||
| 93 | - .displayCount(1) | ||
| 94 | - .onAnimationEnd(event => { | ||
| 95 | - router.back() | ||
| 96 | - }) | ||
| 97 | - }) | 85 | + .backgroundColor(Color.Black) |
| 86 | + .id('e_picture_container') | ||
| 87 | + // 设置顶部绘制延伸到状态栏 | ||
| 88 | + // 设置底部绘制延伸到导航条 | ||
| 89 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 98 | } | 90 | } |
| 99 | - .index(this.swiperIndex) | ||
| 100 | - .width('100%') | ||
| 101 | - .height(px2vp(this.picHeight) + 32) | ||
| 102 | - .vertical(false) | ||
| 103 | - .autoPlay(false) | ||
| 104 | - .cachedCount(3) | ||
| 105 | - .indicator(false) | ||
| 106 | - .displayCount(1) | ||
| 107 | - .loop(false) | ||
| 108 | - .id('e_swiper_content') | ||
| 109 | - .alignRules({ | ||
| 110 | - center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 111 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 112 | - }) | ||
| 113 | - .onChange((index: number) => { | ||
| 114 | - this.swiperIndex = index | ||
| 115 | - }) | ||
| 116 | 91 | ||
| 92 | + @Builder | ||
| 93 | + init() { | ||
| 117 | if (this.contentDetailData.rmhPlatform == 1) { | 94 | if (this.contentDetailData.rmhPlatform == 1) { |
| 118 | Row() { | 95 | Row() { |
| 119 | Row({ space: 8 }) { | 96 | Row({ space: 8 }) { |
| @@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent { | @@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 154 | .height(14) | 131 | .height(14) |
| 155 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 132 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 156 | .margin(0) | 133 | .margin(0) |
| 134 | + .maxLines(1) | ||
| 157 | } | 135 | } |
| 158 | } | 136 | } |
| 159 | .width('81%') | 137 | .width('81%') |
| @@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent { | @@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent { | ||
| 192 | .width('100%') | 170 | .width('100%') |
| 193 | .height(44) | 171 | .height(44) |
| 194 | .alignRules({ | 172 | .alignRules({ |
| 195 | - top: { anchor: "e_swiper_content", align: VerticalAlign.Top }, | ||
| 196 | - middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center } | 173 | + top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 174 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 197 | }) | 175 | }) |
| 198 | .id('e_attention') | 176 | .id('e_attention') |
| 199 | } | 177 | } |
| 178 | + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | ||
| 179 | + Swiper(this.swiperController) { | ||
| 180 | + ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { | ||
| 181 | + Swiper(this.swiperControllerItem) { | ||
| 182 | + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | ||
| 183 | + } | ||
| 184 | + .width('100%') | ||
| 185 | + .height('100%') | ||
| 186 | + .vertical(true) | ||
| 187 | + .autoPlay(false) | ||
| 188 | + .cachedCount(1) | ||
| 189 | + .indicator(false) | ||
| 190 | + .displayCount(1) | ||
| 191 | + .onAnimationEnd(event => { | ||
| 192 | + router.back() | ||
| 193 | + }) | ||
| 194 | + }) | ||
| 195 | + } | ||
| 196 | + .index(this.swiperIndex) | ||
| 197 | + .width('100%') | ||
| 198 | + .height(px2vp(this.picHeight) + 32) | ||
| 199 | + .vertical(false) | ||
| 200 | + .autoPlay(false) | ||
| 201 | + .cachedCount(3) | ||
| 202 | + .indicator(false) | ||
| 203 | + .displayCount(1) | ||
| 204 | + .loop(false) | ||
| 205 | + .id('e_swiper_content') | ||
| 206 | + .alignRules({ | ||
| 207 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 208 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 209 | + }) | ||
| 210 | + .onChange((index: number) => { | ||
| 211 | + this.swiperIndex = index | ||
| 212 | + }) | ||
| 213 | + | ||
| 200 | Row() { | 214 | Row() { |
| 201 | Scroll(this.scroller) { | 215 | Scroll(this.scroller) { |
| 202 | Row() { | 216 | Row() { |
| @@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent { | @@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent { | ||
| 295 | .border({ width: { top: 0.5 }, color: '#FFFFFF' }) | 309 | .border({ width: { top: 0.5 }, color: '#FFFFFF' }) |
| 296 | .id('e_oper_row') | 310 | .id('e_oper_row') |
| 297 | } | 311 | } |
| 298 | - .width('100%') | ||
| 299 | - .height('100%') | ||
| 300 | - .backgroundColor(Color.Black) | ||
| 301 | - .id('e_picture_container') | ||
| 302 | - // 设置顶部绘制延伸到状态栏 | ||
| 303 | - // 设置底部绘制延伸到导航条 | ||
| 304 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 305 | - } | ||
| 306 | 312 | ||
| 307 | getContentDetailData() { | 313 | getContentDetailData() { |
| 308 | try { | 314 | try { |
| @@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent { | @@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent { | ||
| 318 | } | 324 | } |
| 319 | this.netStatus = undefined | 325 | this.netStatus = undefined |
| 320 | this.contentDetailData = resDTO.data?.[0]; | 326 | this.contentDetailData = resDTO.data?.[0]; |
| 327 | + if (this.contentDetailData.rmhPlatform == 1) { | ||
| 328 | + WindowModel.shared.setWindowSystemBarProperties({ | ||
| 329 | + statusBarContentColor: '#ffffff', | ||
| 330 | + }) | ||
| 331 | + } | ||
| 321 | // this.contentDetailData.photoList = [] | 332 | // this.contentDetailData.photoList = [] |
| 322 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { | 333 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { |
| 323 | // 暂无内容 | 334 | // 暂无内容 |
-
Please register or login to post a comment