Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王士厅
2024-03-27 14:57:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6a7f2aa28e1085351ad36d66bd69c52509b29f8e
6a7f2aa2
1 parent
30252a1a
多图详情页开发
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
25 deletions
sight_harmony/features/wdBean/Index.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailItemComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailPageComponent.ets
sight_harmony/features/wdBean/Index.ets
View file @
6a7f2aa
...
...
@@ -23,7 +23,7 @@ export { Pic } from './src/main/ets/bean/content/Pic'
export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO';
export { InteractDataStatus
DTO
} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractDataStatus
Bean, PhotoListBean
} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam';
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
View file @
6a7f2aa
...
...
@@ -2,11 +2,19 @@
* 多图(图集)详情
* */
// 批量查询内容当前用户点赞、收藏状态
export
interface
InteractDataStatus
DTO
{
export
interface
InteractDataStatus
Bean
{
contentId
:
string
;
contentType
:
number
;
contentRelId
:
string
;
relType
:
number
;
likeStatus
:
number
;
collectStatus
:
number
;
}
// 【图文、图集稿件正文图片】图片信息数组
export
interface
PhotoListBean
{
height
:
number
;
width
:
number
;
picPath
:
string
;
picDesc
:
number
;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailItemComponent.ets
0 → 100644
View file @
6a7f2aa
import { PhotoListBean } from 'wdBean';
@Component
export struct MultiPictureDetailItemComponent {
private newsTitle: string = '';
private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
build() {
Stack() {
Image(this.MultiPictureDetailItem.picPath)
.width('100%')
.aspectRatio(378 / 566)
.objectFit(ImageFit.Fill)
}
.padding({ top: 16, right: 16, bottom: 16, left: 16 })
.margin({ left: 10, right: 10 })
.backgroundColor(Color.White)
.width('100%')
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailPageComponent.ets
View file @
6a7f2aa
import { Logger } from 'wdKit';
import { ContentDetailDTO } from 'wdBean';
import { ContentDetailDTO
, PhotoListBean
} from 'wdBean';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import display from '@ohos.display';
import font from '@ohos.font';
import { OperRowListView } from './view/OperRowListView';
import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
const TAG = 'MultiPictureDetailPageComponent';
...
...
@@ -48,30 +50,48 @@ export struct MultiPictureDetailPageComponent {
build() {
RelativeContainer() {
if (this.contentDetailData && this.contentDetailData.length > 0) {
Swiper(this.swiperController) {
ForEach(this.contentDetailData, (item: ContentDetailDTO, index: number) => {
// ENewspaperItemComponent({ newspaperListItemBean: item })
RelativeContainer() {
if (this.contentDetailData?.[0].photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.contentDetailData[0].photoList, (item: PhotoListBean, index: number) => {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(true)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.displayCount(1)
.margin({ top: 35, left: 10, right: 10 })
.id('e_picture_content')
.alignRules({
top: { anchor: "e_picture_container", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.swiperIndex = index
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(true)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.displayCount(1)
.margin({ top: 35, left: 10, right: 10 })
.id('e_newspaper_content')
.alignRules({
top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.swiperIndex = index
})
}}
}
RelativeContainer() {
OperRowListView()
.alignRules({
top: { anchor: "e_picture_container", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
.width('100%')
.height(100)
.margin({ left: 20 })
.border({ width: 2, color: '#6699FF' })
}
.width('100%')
.height('100%')
.backgroundColor($r('app.color.color_80000000'))
.id('e_picture_container')
}
private async getContentDetailData() {
...
...
Please
register
or
login
to post a comment