<view :style="{height:windowHeightList}">
<list class="list" :style="{height:windowHeightList}" :show-scrollbar="false" :loadmoreoffset="50" @loadmore="loadMore" ref="list">
<refresh
:display="refreshing ? 'show' : 'hide'"
@refresh="onrefresh"
@pullingdown="onpullingdown"
@click="reFresh"
>
<view class="loading-more-down">
<image v-if="refreshText=='3'" style="width: 108rpx;height:24rpx;" src="@/static/load-list.gif"></image>
<view v-if="refreshText=='2' || refreshText=='1'" style="width: 108rpx;height:24rpx;">
<image style="width: 108rpx;height:24rpx;" src="@/static/load-list.png"></image>
</view>
</view>
</refresh>
</cell>
<cell v-for="(item,index) in list"
:key="item.resumeId"
:ref="'cell'+index">
<resumeItem :info="item" :url="'/pages/resume/detail/detail?id=' + item.resumeId"/>
</cell>
<cell v-if="list.length > 6">
<view class="loading-more">
<image v-if="!noData" style="width: 108rpx;height:24rpx;" src="@/static/load-list.gif"></image>
<text :class="list.length > 6 && noData?'loading-more-text-accomplish':'loading-more-text'">{{list.length > 6 && noData?'- THE END -':''}}</text>
</view>
</cell>
</list>
</view>
<script>
methods: {
//下拉操作
onpullingdown(e){
//当正在刷新的时候直接返回
if(this.refreshing){
return;
}
if (Math.abs(e.pullingDistance) > 60) {
//当下拉的距离大于fresh组件的高度
this.refreshText = "1";
} else {
this.refreshText = "2";
}
},
//释放加载
onrefresh(){
if(this.loading){
//当正在调用接口获取数据时,此时的下拉不做任何操作
return;
}
this.refreshText="3";
//刷新数据
//模拟接口延迟
this.loading = true;
this.refreshing = true;
this.params.pageNum = 1
this.loadHotList()
},
//触底加载
loadMore(){
if (this.count <= this.list.length) {
this.$store.commit('home/setNoData', true)
return
}
this.loadHotList()
},
//加载列表
async loadHotList() {
const {
data,
count,
success
} = await this.loadApi()//列表数据
if(success){
const curList = data;
this.count = count
if (this.params.pageNum === 1) {
this.list = [];
}
this.params.pageNum += 1
this.list = this.list.concat(curList); // 追加新数据
this.resetLoadmore()
this.getUserRoleNew = false
if(this.list.length){
if(this.count <= this.list.length){
this.$store.commit('home/setNoData', true)
}else{
this.$store.commit('home/setNoData', false)
}
this.noShow = false
this.loading = false;
this.refreshing = false;
this.refreshText="";
this.loadErr = false;
}else{
this.loading = false;
this.refreshing = false;
this.refreshText="";
this.loadErr = false;
}
}
},
// 重置 loadmore
resetLoadmore() {
this.$refs["list"].resetLoadmore();
},
}
</script>
- 发布:2023-09-22 10:29
- 更新:2023-09-28 09:03
- 阅读:267
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 11
手机系统: Android
手机系统版本号: Android 13
手机厂商: vivo
手机机型: y78
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: CLI
CLI版本号: 3.8.12
示例代码:
操作步骤:
nvue下list组件vivo-y78无法上拉下拉操作
nvue下list组件vivo-y78无法上拉下拉操作
预期结果:
nvue下list组件可以进行上拉下拉操作
nvue下list组件可以进行上拉下拉操作
实际结果:
nvue下list组件vivo-y78无法上拉下拉操作
nvue下list组件vivo-y78无法上拉下拉操作
bug描述:
nvue下list组件vivo-y78机型无法上拉下拉操作,大部分机型是正常的