diff --git a/pages/template/long-list/long-list-page.uvue b/pages/template/long-list/long-list-page.uvue index 2a75257656736b8576d76051999d23e65c85d6d8..7bdc4df287c81d92d38ba7fa528f586be804826c 100644 --- a/pages/template/long-list/long-list-page.uvue +++ b/pages/template/long-list/long-list-page.uvue @@ -99,15 +99,12 @@ } }, methods: { - refreshData() { + refreshData(loadComplete : (() => void) | null) { this.dataList.length = 0 this.$currentPage = 1 - this.loadData(() => { - // TODO - uni.stopPullDownRefresh() - }) + this.loadData(loadComplete) }, - loadData(oncomplete : (() => void) | null) { + loadData(loadComplete : (() => void) | null) { if (this.loading || this.isEnded) { return } @@ -139,8 +136,8 @@ }, complete: () => { this.loading = false - if (oncomplete != null) { - oncomplete() + if (loadComplete != null) { + loadComplete() } } }) diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue index 71c52ac97049b309fb09cb6892bde1fde72ecf57..1af15922ddf0faa52d44d366928ca4753ecc8112 100644 --- a/pages/template/long-list/long-list.uvue +++ b/pages/template/long-list/long-list.uvue @@ -98,7 +98,9 @@ this.setSwiperIndex(0, true) }, onPullDownRefresh() { - (this.$refs["longPage"]! as ComponentPublicInstance[])[this.swiperIndex].$callMethod('refreshData') + (this.$refs["longPage"]! as ComponentPublicInstance[])[this.swiperIndex].$callMethod('refreshData', () => { + uni.stopPullDownRefresh() + }) }, methods: { // TODO @@ -210,7 +212,7 @@ initSwiperItemData(index : number) { if (!this.swiperList[index].preload) { this.swiperList[index].preload = true; - (this.$refs["longPage"]! as ComponentPublicInstance[])[index].$callMethod('loadData') + (this.$refs["longPage"]! as ComponentPublicInstance[])[index].$callMethod('loadData', null) } } }