使用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: '加载中', mask: true, });
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, //滚动到指定距离
duration: 0,
success: () => {
wx.hideLoading();
}
});
wx.stopPullDownRefresh(); //调用停止刷新函数,但会强制返回顶部,使得我上面的滚动失效
})
}
},
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)