【优化】文章列表,公告列表调整默认分页数量为20,防止出现因为手机屏幕高度,导致onReachBottom无法实现触底的效果,导致无法触发下一页分页的问题。

This commit is contained in:
jianweie code
2023-09-02 15:57:13 +08:00
parent c5cd46314c
commit add7c51848
2 changed files with 9 additions and 6 deletions

View File

@@ -11,7 +11,9 @@
</view> </view>
</u-navbar> </u-navbar>
<u-tabs :list="articleType" sticky :current="current" @change="change" lineWidth="30"></u-tabs> <u-sticky customNavHeight="88" bgColor="#f1f1f1">
<u-tabs :list="articleType" sticky :current="current" @change="change" lineWidth="30"></u-tabs>
</u-sticky>
<view class="coreshop-bg-white coreshop-margin-10"> <view class="coreshop-bg-white coreshop-margin-10">
<view class="coreshop-flex coreshop-solid-bottom coreshop-justify-between coreshop-flex-nowrap coreshop-padding-top-10 coreshop-padding-bottom-10 coreshop-padding-left-10 coreshop-padding-right-10" v-for="item in list" :key="item.id" @click="goArticleDetail(item.id)"> <view class="coreshop-flex coreshop-solid-bottom coreshop-justify-between coreshop-flex-nowrap coreshop-padding-top-10 coreshop-padding-bottom-10 coreshop-padding-left-10 coreshop-padding-right-10" v-for="item in list" :key="item.id" @click="goArticleDetail(item.id)">
@@ -33,14 +35,14 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
cid: 0, // 文章分类id cid: 0, // 文章分类id
page: 1, page: 1,
limit: 10, limit: 20,
list: [], list: [],
status: 'loadmore', status: 'loadmore',
iconType: 'flower', iconType: 'flower',
@@ -64,6 +66,7 @@
} }
}, },
onReachBottom() { onReachBottom() {
console.log("到达底部");
if (this.status === 'loadmore') { if (this.status === 'loadmore') {
this.articleList(); this.articleList();
} }
@@ -105,7 +108,7 @@
this.cid = item.id; this.cid = item.id;
this.list = []; this.list = [];
this.page = 1; this.page = 1;
this.limit = 10; this.limit = 20;
this.loadStatus = 'more'; this.loadStatus = 'more';
this.articleList(); this.articleList();
} }

View File

@@ -42,7 +42,7 @@
data() { data() {
return { return {
page: 1, page: 1,
limit: 10, limit: 20,
list: [], list: [],
status: 'loadmore', status: 'loadmore',
iconType: 'flower', iconType: 'flower',