l***@163.com
l***@163.com
  • 发布:2024-08-08 16:35
  • 更新:2024-08-08 16:35
  • 阅读:202

uni-app ios端列表也长时间停留后;再次进入不能触发下载刷新加载

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 12.2.1

HBuilderX类型: 正式

HBuilderX版本号: 4.24

手机系统: iOS

手机系统版本号: iOS 17

手机厂商: 苹果

手机机型: iPhone15pro

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

App下载地址或H5⽹址: https://apps.apple.com/cn/app/hello-uni-app/id1417078253

示例代码:

<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view style="font-size: 12px; color: #666;">注:PC 不支持下拉刷新</view>
<view class="text" v-for="(num,index) in data" :key="index">list - {{num}}</view>
<view class="uni-loadmore" v-if="showLoadMore">{{loadMoreText}}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '下拉刷新 + 加载更多',
data: [],
loadMoreText: "加载中...",
showLoadMore: false,
max: 0
}
},
onLoad() {
this.initData();
},
onUnload() {
this.max = 0,
this.data = [],
this.loadMoreText = "加载更多",
this.showLoadMore = false;
},
onReachBottom() {
console.log("onReachBottom");
if (this.max > 40) {
this.loadMoreText = "没有更多数据了!"
return;
}
this.showLoadMore = true;
setTimeout(() => {
this.setListData();
}, 300);
},
onPullDownRefresh() {
console.log('onPullDownRefresh');
this.initData();
},
methods: {
initData(){
setTimeout(() => {
this.max = 0;
this.data = [];
let data = [];
this.max += 20;
for (var i = this.max - 19; i < this.max + 1; i++) {
data.push(i)
}
this.data = this.data.concat(data);
uni.stopPullDownRefresh();
}, 300);
},
setListData() {
let data = [];
this.max += 10;
for (var i = this.max - 9; i < this.max + 1; i++) {
data.push(i)
}
this.data = this.data.concat(data);
}
}
}
</script>

<style>
.text {
margin: 16rpx 0;
width:100%;
background-color: #fff;
height: 120rpx;
line-height: 120rpx;
text-align: center;
color: #555;
border-radius: 8rpx;
}
</style>

操作步骤:

点击hello uni-app 实例 --》接口 --》 界面 --》下拉刷新--》点击进入该功能;下拉刷新;然后滑动加载一些数据;(例如有30+条数据,此时不要关闭 hello uni-app;切换到别的APP中,过3个小时左右;时间稍微长一些;具体临界时间暂时未测试到)再次进入显示该列表页面,但是下拉时候无法触发下拉刷新;

预期结果:

预期结果:停留在列表页面;过几个小时后再次进入该页面;下拉可以触发刷新功能;期待修复框架中存在的列表下拉不能刷新的bug

实际结果:

停留在列表页面中;等待几个小时候;再次进入该页面后;页面列表不能刷新

bug描述:

【软件】hello uni-app
1、复现步骤:

点击 接口--》下拉刷新--》点击进入该功能;下拉刷新;然后滑动加载一些数据;(例如有30+条数据,此时不要关闭 hello uni-app;切换到别的APP中,过3个小时左右;时间稍微长一些;具体临界时间暂时未测试到)再次进入显示该列表页面,但是下拉时候无法触发下拉刷新;

2024-08-08 16:35 负责人:无 分享
已邀请:

要回复问题请先登录注册