From 3c8dbb12ccb56feee7f1f7382870696fd9f32eca Mon Sep 17 00:00:00 2001 From: jingzhili Date: Fri, 14 Jun 2024 10:22:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E4=B8=8A=E6=8B=89?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jingzhili --- README.md | 3 +- entry/src/main/ets/pages/gridTestPage.ets | 4 +- entry/src/main/ets/pages/testPullCallback.ets | 52 +++++++------------ .../PullToRefreshConfigurator.ets | 10 ++++ .../components/PullToRefresh/RefreshGrid.ets | 50 +++++++++++++----- .../components/PullToRefresh/RefreshList.ets | 51 +++++++++++++----- .../PullToRefresh/RefreshScroll.ets | 51 +++++++++++++----- .../PullToRefresh/RefreshWaterFlow.ets | 51 +++++++++++++----- 8 files changed, 180 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 4d3a4b8..5367bd2 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ interface DataChangeListener { | setRefreshBackgroundImage | ResourceColor | 下拉刷新动画部分的背景 | 'rgba(0,0,0,0)' | | setRefreshTextColor | ResourceColor | 下拉加载完毕后提示文本的字体颜色 | '#999999' | | setRefreshTextSize | number 或 string 或 Resource | 下拉加载完毕后提示文本的字体大小 | 18 | -| setRefreshAnimDuration | number | 下拉动画执行一次的时间(自定义动画的回调函数才会触发) | 1000 | +| setRefreshAnimDuration | number | 下拉动画执行一次的时间(自定义动画的回调函数才会触发) | 600 | | setRefreshOpacity | number | 下拉刷新背景图的透明度 | 0.5 | | setLoadImageHeight | number | 上拉动画中图片的高度 | 64 | | setLoadBackgroundColor | ResourceColor | 上拉加载动画部分的背景 | '' | @@ -147,6 +147,7 @@ interface DataChangeListener { | setLoadTextLoading | string | 上拉加载更多中时的文本 | '正在玩命加载中...' | | setFullScreen | boolean | list組件全屏参数 | false | | setListInitialIndex | number | list组件设置当前List初次加载时视口起始位置显示的item的索引值 | 0 | +| setLoadAnimDuration | number | 上拉动画执行一次的时间(自定义上拉动画的回调函数才会触发) | 600 | ## 约束与限制 在下述版本验证通过: diff --git a/entry/src/main/ets/pages/gridTestPage.ets b/entry/src/main/ets/pages/gridTestPage.ets index a04f26e..430cda4 100644 --- a/entry/src/main/ets/pages/gridTestPage.ets +++ b/entry/src/main/ets/pages/gridTestPage.ets @@ -35,7 +35,7 @@ struct Index { private timer: null | number = null; @State layoutOptions: GridLayoutOptions = { regularSize: [1, 1], - irregularIndexes: [0, 6, this.data.length * this.data.length], //索引为0和6的GridItem占用一行 + irregularIndexes: [this.data.length * this.data.length], //this.data.length * this.data.length为必须项 }; build() { @@ -69,7 +69,7 @@ struct Index { // 模拟网络请求操作,请求网络1秒后得到数据,通知组件,变更列表数据 setTimeout(() => { resolve(''); - for (let index = 0; index < 10; index++) { + for (let index = 0; index < 2; index++) { this.data.push("增加的条目" + this.data.length); } }, 1000); diff --git a/entry/src/main/ets/pages/testPullCallback.ets b/entry/src/main/ets/pages/testPullCallback.ets index f38544c..4947d6b 100644 --- a/entry/src/main/ets/pages/testPullCallback.ets +++ b/entry/src/main/ets/pages/testPullCallback.ets @@ -24,7 +24,6 @@ class MyListModifier implements AttributeModifier { } } -const backgroundHeight = 200; const topImageSize = 15; @Entry @@ -44,8 +43,9 @@ struct Index { @State loadingMarginLeft: number = -15; @State loadingText: string = ""; @State space: number = 0.25; - @State imgOpacity: number = 1; - @State topPadding: number = 0; + @State imgOpacity: number = 0; + @State imgOpacity1: number = 0; + @State imgOpacity2: number = 0; private refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator(); build() { @@ -94,19 +94,20 @@ struct Index { if (value !== undefined && width !== undefined && height !== undefined) { this.stop = false; if (value < 0.5) { - this.topPadding = 0.2 * (backgroundHeight * value - 80) + 16; this.loadingText = ''; this.setScale(0.5); + this.setOpacity(0); + value === 0 ? this.imgOpacity1 = 0 : this.imgOpacity1 = 1; this.loadingMarginLeft = -15; } else if (value < 0.75) { - this.topPadding = backgroundHeight * value - 80; this.loadingText = '下拉刷新'; let scaleValue = 0.5 + (value - 0.5) * 2; this.setScale(scaleValue); + this.setOpacity(1); this.loadingMarginLeft = -15 + 70 * (value - 0.5) * 2; } else { - this.topPadding = backgroundHeight * value - 80; this.setScale(1); + this.setOpacity(1); this.loadingMarginLeft = 20; if ( this.refreshConfigurator.getRefreshHeight()< height ) { this.loadingText = '松开刷新'; @@ -117,29 +118,9 @@ struct Index { //可选项,刷新中回调 onAnimRefreshing: (value, width, height) => { if (value !== undefined && width !== undefined && height !== undefined) { - this.topPadding = height / 2; if (!this.stop) { - if (value < this.space) { - this.start[0] = true; - this.start[1] = true; - this.start[1] = true; - } else { - this.start[0] = true; - this.start[1] = true; - this.start[2] = true; - } - type scaleValue = number | undefined; - let value1: scaleValue = (this.start[0] && this.getValue(value)) as scaleValue; - value += 1 - let value2: scaleValue = (this.start[1] && this.getValue((value - 0.25) % 1)) as scaleValue; - let value3: scaleValue = (this.start[2] && this.getValue((value - 0.5) % 1)) as scaleValue; - this.scaleOp1 = { x: value1, y: value1 }; - if (!this.stop) { - this.scaleOp2 = { x: value2, y: value2 }; - } - if (!this.stop) { - this.scaleOp3 = { x: value3, y: value3 }; - } + this.setScale(1); + this.setOpacity(1) this.loadingText = '加载中!'; } } @@ -151,7 +132,9 @@ struct Index { let marginReductionFactor = value / height; //根据当前高度和原始高度计算减少因子 this.loadingMarginLeft = 15 * (marginReductionFactor - 1); this.setScale(1); - this.imgOpacity = 1; + if (this.loadingMarginLeft <= -15) { + this.setOpacity(0); + } } } }) @@ -164,8 +147,10 @@ struct Index { this.scaleOp3 = { x: value, y: value }; } - private getValue(value: number): number { - return 1 + Math.abs(Math.abs(value * 2 - 1) - 1) / 2.0; + private setOpacity(value: number) { + this.imgOpacity = value; + this.imgOpacity1 = value; + this.imgOpacity2 = value; } @Builder @@ -188,8 +173,9 @@ struct Index { left: this.loadingMarginLeft }) .scale(this.scaleOp2) - .opacity(this.imgOpacity) + .opacity(this.imgOpacity1) } + .zIndex(1) Column() { Image($r("app.media.icon_loading_right")) @@ -199,7 +185,7 @@ struct Index { left: this.loadingMarginLeft }) .scale(this.scaleOp3) - .opacity(this.imgOpacity) + .opacity(this.imgOpacity2) } } .alignItems(VerticalAlign.Top) diff --git a/library/src/main/ets/components/PullToRefresh/PullToRefreshConfigurator.ets b/library/src/main/ets/components/PullToRefresh/PullToRefreshConfigurator.ets index 3483533..ef06beb 100644 --- a/library/src/main/ets/components/PullToRefresh/PullToRefreshConfigurator.ets +++ b/library/src/main/ets/components/PullToRefresh/PullToRefreshConfigurator.ets @@ -27,6 +27,7 @@ export class PullToRefreshConfigurator { private refreshTextSize?: number | string | Resource = 16; // 下拉刷新提示文本的字体大小 private refreshAnimDuration?: number = 600; // 下拉动画执行一次的时间 private loadImageHeight?: number = 64; // 上拉加载动画高度 + private loadAnimDuration?: number = 600; // 上拉动画执行一次的时间 private loadBackgroundColor?: ResourceColor = 'rgba(0,0,0,0)'; // 上拉动画区域背景色 private loadTextColor?: ResourceColor = '#999999'; // 上拉文本的字体颜色 private loadTextSize?: number | string | Resource = 18; // 上拉文本的字体大小 @@ -166,6 +167,15 @@ export class PullToRefreshConfigurator { return this.loadImageHeight !== undefined ? this.loadImageHeight : 0; } + setLoadAnimDuration(loadAnimDuration: number) { + this.loadAnimDuration = loadAnimDuration; + return this; + } + + getLoadAnimDuration() { + return this.loadAnimDuration; + } + setLoadBackgroundColor(loadBackgroundColor: ResourceColor) { this.loadBackgroundColor = loadBackgroundColor; return this; diff --git a/library/src/main/ets/components/PullToRefresh/RefreshGrid.ets b/library/src/main/ets/components/PullToRefresh/RefreshGrid.ets index 809e5fe..e1411e3 100644 --- a/library/src/main/ets/components/PullToRefresh/RefreshGrid.ets +++ b/library/src/main/ets/components/PullToRefresh/RefreshGrid.ets @@ -74,6 +74,9 @@ export struct RefreshGrid { private mWidthNumber?: number = 0; // 开启自定义上拉动画 private loadAnimDurationValue?: number = 0; + private loadVisible?: Boolean = false; + private onLoadAnimDuration?: number = 0; + onAnimLoading?: (value?: number, width?: number, height?: number) => void; aboutToAppear() { if (!this.refreshConfigurator) { @@ -116,21 +119,36 @@ export struct RefreshGrid { } } } - //自定义上拉动画 - if (this.loadAnimDurationValue !== undefined) { - if (this.loadAnimDurationValue >= 1) { - this.loadAnimDurationValue -= 1; - } else { - this.loadAnimDurationValue += 0.01; - } - // 保留2位小数 - this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; - // 如果没有自定义加载中动画,就执行内置加载中动画 - if (!this.customLoad) { + //上拉动画 + if (this.onLoadMore !== undefined && this.isTriggerPullUpLoading && this.loadVisible) { + //内置上拉动画 + if (this.loadAnimDurationValue !== undefined && !this.customLoad) { + if (this.loadAnimDurationValue >= 1) { + this.loadAnimDurationValue -= 1; + } else { + this.loadAnimDurationValue += 0.01; + } + // 保留2位小数 + this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; this.angle = this.loadAnimDurationValue * 360; } + //自定义上拉动画 + if (this.onLoadAnimDuration !== undefined && this.customLoad && this.onAnimLoading) { + let loadAnimDuration = this.refreshConfigurator?.getLoadAnimDuration(); + let loadHeightValue = this.refreshConfigurator?.getLoadImageHeight() as number; + if (this.onLoadAnimDuration >= 1) { + this.onLoadAnimDuration -= 1; + } else { + if (loadAnimDuration !== undefined && loadAnimDuration !== 0) { + this.onLoadAnimDuration += 10 / loadAnimDuration; + } + } + // 保留3位小数 + this.onLoadAnimDuration = Math.round(this.onLoadAnimDuration * 1000) / 1000; + this.onAnimLoading(this.onLoadAnimDuration, this.mWidthNumber, loadHeightValue); + } } - }, 8) + }, 7) } aboutToDisappear() { @@ -141,7 +159,10 @@ export struct RefreshGrid { refreshBuilder() { Stack({ alignContent: Alignment.Center }) { if (this.customRefresh !== undefined && this.customRefresh !== null) { - this.customRefresh(); + Row(){ + this.customRefresh(); + } + .visibility((this.refreshOffset > 0 && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } else { Row() { Progress({ @@ -167,7 +188,7 @@ export struct RefreshGrid { } } .width('100%') - .visibility(this.refreshConfigurator?.getHasRefresh() ? Visibility.Visible : Visibility.None) + .visibility((this.refreshConfigurator?.getHasRefresh() && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } build() { @@ -210,6 +231,7 @@ export struct RefreshGrid { .backgroundColor(this.refreshConfigurator?.getLoadBackgroundColor()) .visibility(this.isTriggerPullUpLoading ? Visibility.Visible : Visibility.None) .onVisibleAreaChange([0.2], (isVisible: boolean, currentRatio: number) => { + this.loadVisible = isVisible; if (isVisible && this.onLoadMore !== undefined) { isVisible && this.onLoading(); } diff --git a/library/src/main/ets/components/PullToRefresh/RefreshList.ets b/library/src/main/ets/components/PullToRefresh/RefreshList.ets index 2d1bb3b..fdd73b7 100644 --- a/library/src/main/ets/components/PullToRefresh/RefreshList.ets +++ b/library/src/main/ets/components/PullToRefresh/RefreshList.ets @@ -72,7 +72,10 @@ export struct RefreshList { private mWidthNumber?: number = 0; // 开启自定义上拉动画 private loadAnimDurationValue?: number = 0; + private loadVisible?: Boolean = false; + private onLoadAnimDuration?: number = 0; @State fullScreenScrollIndex: number = 0; + onAnimLoading?: (value?: number, width?: number, height?: number) => void; aboutToAppear() { if (!this.refreshConfigurator) { @@ -115,21 +118,37 @@ export struct RefreshList { } } } - //自定义上拉动画 - if (this.loadAnimDurationValue !== undefined) { - if (this.loadAnimDurationValue >= 1) { - this.loadAnimDurationValue -= 1; - } else { - this.loadAnimDurationValue += 0.01; - } - // 保留2位小数 - this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; - // 如果没有自定义加载中动画,就执行内置加载中动画 - if (!this.customLoad) { + //上拉动画 + if (this.onLoadMore !== undefined && this.isTriggerPullUpLoading && this.loadVisible) { + //内置上拉动画 + if (this.loadAnimDurationValue !== undefined && !this.customLoad) { + if (this.loadAnimDurationValue >= 1) { + this.loadAnimDurationValue -= 1; + } else { + this.loadAnimDurationValue += 0.01; + } + // 保留2位小数 + this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; + // 如果没有自定义加载中动画,就执行内置加载中动画 this.angle = this.loadAnimDurationValue * 360; } + //自定义上拉动画 + if (this.onLoadAnimDuration !== undefined && this.customLoad && this.onAnimLoading) { + let loadAnimDuration = this.refreshConfigurator?.getLoadAnimDuration(); + let loadHeightValue = this.refreshConfigurator?.getLoadImageHeight() as number; + if (this.onLoadAnimDuration >= 1) { + this.onLoadAnimDuration -= 1; + } else { + if (loadAnimDuration !== undefined && loadAnimDuration !== 0) { + this.onLoadAnimDuration += 10 / loadAnimDuration; + } + } + // 保留3位小数 + this.onLoadAnimDuration = Math.round(this.onLoadAnimDuration * 1000) / 1000; + this.onAnimLoading(this.onLoadAnimDuration, this.mWidthNumber, loadHeightValue); + } } - }, 8) + }, 7) } aboutToDisappear() { @@ -140,7 +159,10 @@ export struct RefreshList { refreshBuilder() { Stack() { if (this.customRefresh !== undefined && this.customRefresh !== null) { - this.customRefresh(); + Row(){ + this.customRefresh(); + } + .visibility((this.refreshOffset > 0 && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } else { Row() { Progress({ @@ -167,7 +189,7 @@ export struct RefreshList { } .width('100%') .align(Alignment.Center) - .visibility(this.refreshConfigurator?.getHasRefresh() ? Visibility.Visible : Visibility.None) + .visibility((this.refreshConfigurator?.getHasRefresh() && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } build() { @@ -214,6 +236,7 @@ export struct RefreshList { .backgroundColor(this.refreshConfigurator?.getLoadBackgroundColor()) .visibility(this.isTriggerPullUpLoading ? Visibility.Visible : Visibility.None) .onVisibleAreaChange([0.2], (isVisible: boolean, currentRatio: number) => { + this.loadVisible = isVisible; if (isVisible && this.onLoadMore !== undefined) { isVisible && this.onLoading(); } diff --git a/library/src/main/ets/components/PullToRefresh/RefreshScroll.ets b/library/src/main/ets/components/PullToRefresh/RefreshScroll.ets index 7607a9d..feafe4d 100644 --- a/library/src/main/ets/components/PullToRefresh/RefreshScroll.ets +++ b/library/src/main/ets/components/PullToRefresh/RefreshScroll.ets @@ -68,6 +68,9 @@ export struct RefreshScroll { private timer?: number; // 开启自定义上拉动画 private loadAnimDurationValue?: number = 0; + private loadVisible?: Boolean = false; + private onLoadAnimDuration?: number = 0; + onAnimLoading?: (value?: number, width?: number, height?: number) => void; aboutToAppear() { if (!this.refreshConfigurator) { @@ -110,21 +113,37 @@ export struct RefreshScroll { } } } - //自定义上拉动画 - if (this.loadAnimDurationValue !== undefined) { - if (this.loadAnimDurationValue >= 1) { - this.loadAnimDurationValue -= 1; - } else { - this.loadAnimDurationValue += 0.01; - } - // 保留2位小数 - this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; - // 如果没有自定义加载中动画,就执行内置加载中动画 - if (!this.customLoad) { + //上拉动画 + if (this.onLoadMore !== undefined && this.isTriggerPullUpLoading && this.loadVisible) { + //内置上拉动画 + if (this.loadAnimDurationValue !== undefined && !this.customLoad) { + if (this.loadAnimDurationValue >= 1) { + this.loadAnimDurationValue -= 1; + } else { + this.loadAnimDurationValue += 0.01; + } + // 保留2位小数 + this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; + // 如果没有自定义加载中动画,就执行内置加载中动画 this.angle = this.loadAnimDurationValue * 360; } + //自定义上拉动画 + if (this.onLoadAnimDuration !== undefined && this.customLoad && this.onAnimLoading) { + let loadAnimDuration = this.refreshConfigurator?.getLoadAnimDuration(); + let loadHeightValue = this.refreshConfigurator?.getLoadImageHeight() as number; + if (this.onLoadAnimDuration >= 1) { + this.onLoadAnimDuration -= 1; + } else { + if (loadAnimDuration !== undefined && loadAnimDuration !== 0) { + this.onLoadAnimDuration += 10 / loadAnimDuration; + } + } + // 保留3位小数 + this.onLoadAnimDuration = Math.round(this.onLoadAnimDuration * 1000) / 1000; + this.onAnimLoading(this.onLoadAnimDuration, this.mWidthNumber, loadHeightValue); + } } - }, 8) + }, 7) } aboutToDisappear() { @@ -135,7 +154,10 @@ export struct RefreshScroll { // 下拉刷新动画部分 Stack({ alignContent: Alignment.Center }) { if (this.customRefresh !== undefined && this.customRefresh !== null) { - this.customRefresh(); + Row(){ + this.customRefresh(); + } + .visibility((this.refreshOffset > 0 && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } else { Row() { Progress({ @@ -161,7 +183,7 @@ export struct RefreshScroll { } } .width('100%') - .visibility(this.refreshConfigurator?.getHasRefresh() ? Visibility.Visible : Visibility.None) + .visibility((this.refreshConfigurator?.getHasRefresh() && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } build() { @@ -203,6 +225,7 @@ export struct RefreshScroll { .height(this.refreshConfigurator?.getLoadImageHeight()) .visibility(this.isTriggerPullUpLoading ? Visibility.Visible : Visibility.None) .onVisibleAreaChange([0], (isVisible: boolean, currentRatio: number) => { + this.loadVisible = isVisible; if (isVisible && this.onLoadMore !== undefined) { isVisible && this.onLoading(); } diff --git a/library/src/main/ets/components/PullToRefresh/RefreshWaterFlow.ets b/library/src/main/ets/components/PullToRefresh/RefreshWaterFlow.ets index c3b23c1..1fd4b66 100644 --- a/library/src/main/ets/components/PullToRefresh/RefreshWaterFlow.ets +++ b/library/src/main/ets/components/PullToRefresh/RefreshWaterFlow.ets @@ -68,6 +68,9 @@ export struct RefreshWaterFlow { private timer?: number; // 开启自定义上拉动画 private loadAnimDurationValue?: number = 0; + private loadVisible?: Boolean = false; + private onLoadAnimDuration?: number = 0; + onAnimLoading?: (value?: number, width?: number, height?: number) => void; aboutToAppear() { if (!this.refreshConfigurator) { @@ -110,21 +113,37 @@ export struct RefreshWaterFlow { } } } - //自定义上拉动画 - if (this.loadAnimDurationValue !== undefined) { - if (this.loadAnimDurationValue >= 1) { - this.loadAnimDurationValue -= 1; - } else { - this.loadAnimDurationValue += 0.01; - } - // 保留2位小数 - this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; - // 如果没有自定义加载中动画,就执行内置加载中动画 - if (!this.customLoad) { + //上拉动画 + if (this.onLoadMore !== undefined && this.isTriggerPullUpLoading && this.loadVisible) { + //内置上拉动画 + if (this.loadAnimDurationValue !== undefined && !this.customLoad) { + if (this.loadAnimDurationValue >= 1) { + this.loadAnimDurationValue -= 1; + } else { + this.loadAnimDurationValue += 0.01; + } + // 保留2位小数 + this.loadAnimDurationValue = Math.round(this.loadAnimDurationValue * 100) / 100; + // 如果没有自定义加载中动画,就执行内置加载中动画 this.angle = this.loadAnimDurationValue * 360; } + //自定义上拉动画 + if (this.onLoadAnimDuration !== undefined && this.customLoad && this.onAnimLoading) { + let loadAnimDuration = this.refreshConfigurator?.getLoadAnimDuration(); + let loadHeightValue = this.refreshConfigurator?.getLoadImageHeight() as number; + if (this.onLoadAnimDuration >= 1) { + this.onLoadAnimDuration -= 1; + } else { + if (loadAnimDuration !== undefined && loadAnimDuration !== 0) { + this.onLoadAnimDuration += 10 / loadAnimDuration; + } + } + // 保留3位小数 + this.onLoadAnimDuration = Math.round(this.onLoadAnimDuration * 1000) / 1000; + this.onAnimLoading(this.onLoadAnimDuration, this.mWidthNumber, loadHeightValue); + } } - }, 8) + }, 7) } aboutToDisappear() { @@ -135,7 +154,10 @@ export struct RefreshWaterFlow { // 下拉刷新动画部分 Stack({ alignContent: Alignment.Center }) { if (this.customRefresh !== undefined && this.customRefresh !== null) { - this.customRefresh(); + Row(){ + this.customRefresh(); + } + .visibility((this.refreshOffset > 0 && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } else { Row() { Progress({ @@ -162,7 +184,7 @@ export struct RefreshWaterFlow { } } .width('100%') - .visibility(this.refreshConfigurator?.getHasRefresh() ? Visibility.Visible : Visibility.None) + .visibility((this.refreshConfigurator?.getHasRefresh() && this.refreshState !== RefreshStatus.Inactive) ? Visibility.Visible : Visibility.None) } @Builder @@ -201,6 +223,7 @@ export struct RefreshWaterFlow { .height(this.refreshConfigurator?.getLoadImageHeight()) .visibility(this.isTriggerPullUpLoading ? Visibility.Visible : Visibility.None) .onVisibleAreaChange([0.8], (isVisible: boolean, currentRatio: number) => { + this.loadVisible = isVisible; if (isVisible && this.onLoadMore !== undefined) { isVisible && this.onLoading(); } -- Gitee