Commit bbf42dd0 authored by geruidan's avatar geruidan

步数调整

parent 8b842f81
<template>
<view>
<u-sticky bgColor="#fff">
<u-tabs :activeStyle="{color: '#61b077'}" lineColor="#61b077" @click="clickTime" :list="tabsList"
:scrollable="false">
<u-tabs :activeStyle="{color: '#61b077'}" lineColor="#61b077" @click="clickTime" :list="tabsList" :scrollable="false">
</u-tabs>
</u-sticky>
<view class="record-ul p-l-30 p-r-30">
......@@ -10,6 +9,7 @@
<text>{{item.DateStr}}</text>
<text> {{item.RunNumTotal}}</text>
</view>
<!--没有更多信息-->
<view class="noMore">
<u-loadmore v-show="noMore" :marginTop="10" :status="loadStatus" />
</view>
......@@ -56,17 +56,17 @@
list() {
http("walking.group", this.params).then(res => {
if (res.code == 0) {
this.dataList = [...this.dataList, ...res.data.list];
this.dataList = [...this.dataList, ...res.data.list]; //list数据
let totalCount = res.data.total;
this.isEmpty = !this.dataList.length;
this.lastPage = Math.trunc(totalCount / this.params.pageSize) + 1;
this.lastPage = Math.trunc(totalCount / this.params.pageSize) + 1; //计算最后一页,当最后一页等于当前页,则是最后一页
if (this.lastPage == this.params.pageNo) {
this.loadStatus = "nomore";
this.noMore = true;
} else {
this.loadStatus = "loadmore";
}
if (!res.data.list.length && !this.dataList.length) {
if (!res.data.list.length && !this.dataList.length) { //什么都没有则为空
this.isEmpty = true;
}
} else {
......@@ -77,10 +77,8 @@
})
}
},
// 触底加载更多
onReachBottom() {
console.log(this.params.pageNo)
console.log(this.lastPage)
// 自带方法:触底加载更多
onReachBottom() {
if (this.params.pageNo < this.lastPage) {
this.params.pageNo += 1;
this.list();
......@@ -95,8 +93,7 @@
<style lang="scss" scoped>
.record-li {
border-bottom: 1px solid #ddd;
padding: 15px 10px;
padding: 15px 10px;
text:last-child {
color: #61b077;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment