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-05-08 14:44:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b2eb5c44df525134754f6f944e95eba20aa3ae4c
b2eb5c44
1 parent
c4462a0f
图集点击添加动画
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailPageComponent.ets
View file @
b2eb5c4
...
...
@@ -47,8 +47,10 @@ export struct MultiPictureDetailPageComponent {
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number;
@State windowHeight: number = AppStorage.get<number>('windowHeight') as number;
@State currentOffset:number = 0
@State duration:number = 0
//watch监听页码回调
onCurrentPageNumUpdated(): void {
...
...
@@ -81,6 +83,7 @@ export struct MultiPictureDetailPageComponent {
}
}
aboutToDisappear() {
}
...
...
@@ -98,6 +101,7 @@ export struct MultiPictureDetailPageComponent {
@Builder
init() {
if (this.contentDetailData.rmhPlatform == 1) {
if(!this.showDownload) {
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()){
...
...
@@ -221,7 +225,11 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('e_attention')
.visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
Swiper(this.swiperController) {
...
...
@@ -241,6 +249,9 @@ export struct MultiPictureDetailPageComponent {
this.currentOffset = Math.abs(extraInfo.currentOffset)
})
.onTouch((event: TouchEvent) => {
if(this.duration === 0) {
this.duration = 500
}
if(event.type === 1) {
// if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
if(this.currentOffset > 160) {
...
...
@@ -285,6 +296,7 @@ export struct MultiPictureDetailPageComponent {
})
}
Column(){
if(!this.showDownload) {
Column(){
Row() {
Scroll(this.scroller) {
...
...
@@ -354,7 +366,11 @@ export struct MultiPictureDetailPageComponent {
operationButtonList: this.operationButtonList,
})
}
.visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
))
}
if(this.showDownload) {
Column(){
Row() {
Flex({
...
...
@@ -391,7 +407,10 @@ export struct MultiPictureDetailPageComponent {
}
.width('100%')
}
.visibility(this.showDownload ? Visibility.Visible : Visibility.None)
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
))
}
}
.zIndex(10)
.id('e_swiper_bottom')
...
...
Please
register
or
login
to post a comment