fix: 移动端首页加载更多不自动消失

This commit is contained in:
fit2cloud-chenyw 2022-01-04 17:01:31 +08:00
parent 7ae8b80bf1
commit e21319acd8
2 changed files with 29 additions and 6 deletions

View File

@ -1,8 +1,8 @@
<template>
<view class="page">
<swiper indicator-dots="true">
<view class="page de-main">
<!-- <swiper indicator-dots="true">
<swiper-item v-for="(img, key) in imgUrls" :key="key"><image :src="img" /></swiper-item>
</swiper>
</swiper> -->
<view class=" ">
<view class="uni-title">
@ -100,4 +100,7 @@ swiper,
.page-section-title {
margin-top: 50rpx;
}
.de-main {
padding-top: 60rpx;
}
</style>

View File

@ -14,11 +14,28 @@
<view v-for="(newsitem,index2) in tab.data" :key="newsitem.id">
<media-item :options="newsitem" @close="close(index1,index2)" @click="goDetail(newsitem)"></media-item>
</view>
<view class="loading-more" v-if="tab.isLoading || tab.data.length > 12">
<view class="loading-more" v-if="tab.isLoading">
<text class="loading-more-text">{{tab.loadingText}}</text>
</view>
</scroll-view>
<!-- #endif -->
<!-- <uni-list>
<uni-list-item
v-for="(node, i) in tab.data"
:key="i"
clickable
@click="goDetail(node)"
:title="node.title"
thumb="../../../static/yibiaobans.png"
thumb-size="base"
:rightText="node.rightText"
/>
</uni-list> -->
</swiper-item>
</swiper>
</view>
@ -112,6 +129,7 @@
}
}
activeTab.isLoading = false
uni.stopPullDownRefresh()
})
@ -170,10 +188,12 @@
}
})
},
loadMore(e) {
loadMore(index) {
let activeTab = this.newsList[index]
activeTab.isLoading = true
setTimeout(() => {
this.getList(this.tabIndex);
}, 500)
}, 1000)
},
ontabtap(e) {
let index = e.target.dataset.current || e.currentTarget.dataset.current;