收藏
回答

stopPullDownRefresh IOS真机预览强制返回顶部,开发者工具却不会?

使用wx.stopPullDownRefresh停止上拉刷新后IOS真机预览会强制返回顶部,但开发者工具不会。

我在执行上拉刷新函数时要滚动到指定位置,不调用wx.stopPullDownRefresh就无法停止刷新,调用又会强制返回顶部,使得我的滚动处理失效,这是什么BUG??

我尝试将滚动函数放置到wx.stopPullDownRefresh的success和complete函数中仍然无效!

async onPullDownRefresh() {
        let current_index = parseInt(this.current_chapters[1].chapter_id.split('_')[1]);
        if(current_index === 1) {
            wx.showToast({
                title'已到达小说顶部',
                icon'none',
            });
        } else {
            wx.showLoading({ title'加载中'masktrue, });
            let get_url = this.title_list[current_index-2].chapter_link;
            let get_index = current_index - 2;
              let get_chapter = await getchapter(get_index, get_url);  //获取数据
              this.current_chapters.unshift(get_chapter);
              this.current_chapters.pop();
              this.$nextTick(async () => {
                 let content_height = await get_height('content');
                let chapter_id = 'chapter_' + (current_index-1);
                let chapter_height = await get_height(chapter_id);
                let scroll_top = content_height - this.screen_height;
                if(chapter_height > this.screen_height) {
                    scroll_top = content_height - chapter_height - 40;
                }
                wx.pageScrollTo({
                    scrollTop: scroll_top,  //滚动到指定距离
                    duration0,
                    success() => {
                        wx.hideLoading();
                    }
                });
                wx.stopPullDownRefresh();  //调用停止刷新函数,但会强制返回顶部,使得我上面的滚动失效
            })
        }
    },
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签