Showing
4 changed files
with
73 additions
and
25 deletions
| @@ -23,7 +23,7 @@ export { Pic } from './src/main/ets/bean/content/Pic' | @@ -23,7 +23,7 @@ export { Pic } from './src/main/ets/bean/content/Pic' | ||
| 23 | 23 | ||
| 24 | export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO'; | 24 | export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO'; |
| 25 | 25 | ||
| 26 | -export { InteractDataStatusDTO } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO'; | 26 | +export { InteractDataStatusBean, PhotoListBean } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO'; |
| 27 | 27 | ||
| 28 | export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam'; | 28 | export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam'; |
| 29 | 29 |
| @@ -2,11 +2,19 @@ | @@ -2,11 +2,19 @@ | ||
| 2 | * 多图(图集)详情 | 2 | * 多图(图集)详情 |
| 3 | * */ | 3 | * */ |
| 4 | // 批量查询内容当前用户点赞、收藏状态 | 4 | // 批量查询内容当前用户点赞、收藏状态 |
| 5 | -export interface InteractDataStatusDTO { | 5 | +export interface InteractDataStatusBean { |
| 6 | contentId: string; | 6 | contentId: string; |
| 7 | contentType: number; | 7 | contentType: number; |
| 8 | contentRelId: string; | 8 | contentRelId: string; |
| 9 | relType: number; | 9 | relType: number; |
| 10 | likeStatus: number; | 10 | likeStatus: number; |
| 11 | collectStatus: number; | 11 | collectStatus: number; |
| 12 | +} | ||
| 13 | + | ||
| 14 | +// 【图文、图集稿件正文图片】图片信息数组 | ||
| 15 | +export interface PhotoListBean { | ||
| 16 | + height: number; | ||
| 17 | + width: number; | ||
| 18 | + picPath: string; | ||
| 19 | + picDesc: number; | ||
| 12 | } | 20 | } |
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailItemComponent.ets
0 → 100644
| 1 | +import { PhotoListBean } from 'wdBean'; | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct MultiPictureDetailItemComponent { | ||
| 5 | + private newsTitle: string = ''; | ||
| 6 | + private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean | ||
| 7 | + | ||
| 8 | + build() { | ||
| 9 | + Stack() { | ||
| 10 | + Image(this.MultiPictureDetailItem.picPath) | ||
| 11 | + .width('100%') | ||
| 12 | + .aspectRatio(378 / 566) | ||
| 13 | + .objectFit(ImageFit.Fill) | ||
| 14 | + } | ||
| 15 | + .padding({ top: 16, right: 16, bottom: 16, left: 16 }) | ||
| 16 | + .margin({ left: 10, right: 10 }) | ||
| 17 | + .backgroundColor(Color.White) | ||
| 18 | + .width('100%') | ||
| 19 | + } | ||
| 20 | +} |
| 1 | import { Logger } from 'wdKit'; | 1 | import { Logger } from 'wdKit'; |
| 2 | -import { ContentDetailDTO } from 'wdBean'; | 2 | +import { ContentDetailDTO, PhotoListBean } from 'wdBean'; |
| 3 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 3 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 4 | import display from '@ohos.display'; | 4 | import display from '@ohos.display'; |
| 5 | import font from '@ohos.font'; | 5 | import font from '@ohos.font'; |
| 6 | +import { OperRowListView } from './view/OperRowListView'; | ||
| 7 | +import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; | ||
| 6 | 8 | ||
| 7 | const TAG = 'MultiPictureDetailPageComponent'; | 9 | const TAG = 'MultiPictureDetailPageComponent'; |
| 8 | 10 | ||
| @@ -48,30 +50,48 @@ export struct MultiPictureDetailPageComponent { | @@ -48,30 +50,48 @@ export struct MultiPictureDetailPageComponent { | ||
| 48 | 50 | ||
| 49 | build() { | 51 | build() { |
| 50 | RelativeContainer() { | 52 | RelativeContainer() { |
| 51 | - if (this.contentDetailData && this.contentDetailData.length > 0) { | ||
| 52 | - Swiper(this.swiperController) { | ||
| 53 | - ForEach(this.contentDetailData, (item: ContentDetailDTO, index: number) => { | ||
| 54 | - // ENewspaperItemComponent({ newspaperListItemBean: item }) | 53 | + RelativeContainer() { |
| 54 | + if (this.contentDetailData?.[0].photoList?.length > 0) { | ||
| 55 | + Swiper(this.swiperController) { | ||
| 56 | + ForEach(this.contentDetailData[0].photoList, (item: PhotoListBean, index: number) => { | ||
| 57 | + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | ||
| 58 | + }) | ||
| 59 | + } | ||
| 60 | + .index(this.swiperIndex) | ||
| 61 | + .width('100%') | ||
| 62 | + .height(px2vp(this.picHeight) + 32) | ||
| 63 | + .vertical(true) | ||
| 64 | + .autoPlay(false) | ||
| 65 | + .cachedCount(3) | ||
| 66 | + .indicator(false) | ||
| 67 | + .displayCount(1) | ||
| 68 | + .margin({ top: 35, left: 10, right: 10 }) | ||
| 69 | + .id('e_picture_content') | ||
| 70 | + .alignRules({ | ||
| 71 | + top: { anchor: "e_picture_container", align: VerticalAlign.Bottom }, | ||
| 72 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 73 | + }) | ||
| 74 | + .onChange((index: number) => { | ||
| 75 | + this.swiperIndex = index | ||
| 55 | }) | 76 | }) |
| 56 | } | 77 | } |
| 57 | - .index(this.swiperIndex) | ||
| 58 | - .width('100%') | ||
| 59 | - .height(px2vp(this.picHeight) + 32) | ||
| 60 | - .vertical(true) | ||
| 61 | - .autoPlay(false) | ||
| 62 | - .cachedCount(3) | ||
| 63 | - .indicator(false) | ||
| 64 | - .displayCount(1) | ||
| 65 | - .margin({ top: 35, left: 10, right: 10 }) | ||
| 66 | - .id('e_newspaper_content') | ||
| 67 | - .alignRules({ | ||
| 68 | - top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 69 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 70 | - }) | ||
| 71 | - .onChange((index: number) => { | ||
| 72 | - this.swiperIndex = index | ||
| 73 | - }) | ||
| 74 | - }} | 78 | + } |
| 79 | + RelativeContainer() { | ||
| 80 | + OperRowListView() | ||
| 81 | + .alignRules({ | ||
| 82 | + top: { anchor: "e_picture_container", align: VerticalAlign.Bottom }, | ||
| 83 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 84 | + }) | ||
| 85 | + } | ||
| 86 | + .width('100%') | ||
| 87 | + .height(100) | ||
| 88 | + .margin({ left: 20 }) | ||
| 89 | + .border({ width: 2, color: '#6699FF' }) | ||
| 90 | + } | ||
| 91 | + .width('100%') | ||
| 92 | + .height('100%') | ||
| 93 | + .backgroundColor($r('app.color.color_80000000')) | ||
| 94 | + .id('e_picture_container') | ||
| 75 | } | 95 | } |
| 76 | 96 | ||
| 77 | private async getContentDetailData() { | 97 | private async getContentDetailData() { |
-
Please register or login to post a comment