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-06-14 11:13:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ffe2024705089cf73a4c33349755356dcd612acd
ffe20247
1 parent
53bcea14
图集滑动优化
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
38 deletions
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
View file @
ffe2024
...
...
@@ -114,7 +114,32 @@ export struct MultiPictureDetailPageComponent {
build() {
RelativeContainer() {
this.init()
if (this.contentDetailData.rmhPlatform == 1) {
this.rmh()
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
this.imgSwiper()
}
if (this.netStatus !== undefined) {
this.noNet()
}
if (this.isOffLine) {
this.offLine()
}
Column() {
if (!this.showDownload) {
this.NShowDownload()
}
if (this.showDownload) {
this.YShowDownload()
}
}
.zIndex(10)
.id('e_swiper_bottom')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
...
...
@@ -131,8 +156,7 @@ export struct MultiPictureDetailPageComponent {
}
@Builder
init() {
if (this.contentDetailData.rmhPlatform == 1) {
rmh() {
if (!this.showDownload) {
Row() {
Row({ space: 8 }) {
...
...
@@ -275,9 +299,10 @@ export struct MultiPictureDetailPageComponent {
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
@Builder
imgSwiper() {
Swiper(this.swiperController) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
Swiper(this.swiperControllerItem) {
...
...
@@ -290,6 +315,7 @@ export struct MultiPictureDetailPageComponent {
.cachedCount(1)
.indicator(false)
.displayCount(1)
.loop(false)
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
this.currentOffset = Math.abs(extraInfo.currentOffset)
...
...
@@ -315,7 +341,7 @@ export struct MultiPictureDetailPageComponent {
.indicator(false)
.displayCount(1)
.loop(false)
.effectMode(EdgeEffect.None
)
.effectMode(EdgeEffect.Spring
)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
...
...
@@ -329,33 +355,9 @@ export struct MultiPictureDetailPageComponent {
this.showDownload = !this.showDownload
})
}
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: 1, emptyButton: true, retry: () => {
this.getContentDetailData()
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
if (this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetailData
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
}
Column() {
if (!this.showDownload) {
@Builder
NShowDownload() {
Column() {
Row() {
Scroll(this.scroller) {
...
...
@@ -421,7 +423,9 @@ export struct MultiPictureDetailPageComponent {
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.height(px2vp(this.titleHeight))
.constraintSize({
maxHeight: px2vp(this.titleHeight)
})
.align(Alignment.Bottom)
}
...
...
@@ -442,7 +446,9 @@ export struct MultiPictureDetailPageComponent {
TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
))
}
if (this.showDownload) {
@Builder
YShowDownload() {
Column() {
Row() {
Flex({
...
...
@@ -488,13 +494,34 @@ export struct MultiPictureDetailPageComponent {
TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
))
}
@Builder
noNet() {
EmptyComponent({
emptyType: 1, emptyButton: true, retry: () => {
this.getContentDetailData()
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
.zIndex(10)
.id('e_swiper_bottom')
@Builder
offLine() {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetailData
}
})
.id('e_empty_content')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom
},
center: { anchor: "__container__", align: VerticalAlign.Center
},
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
}
getContentDetailData() {
...
...
Please
register
or
login
to post a comment