Commit bbf42dd0 authored by geruidan's avatar geruidan

步数调整

parent 8b842f81
<template> <template>
<view> <view>
<u-sticky bgColor="#fff"> <u-sticky bgColor="#fff">
<u-tabs :activeStyle="{color: '#61b077'}" lineColor="#61b077" @click="clickTime" :list="tabsList" <u-tabs :activeStyle="{color: '#61b077'}" lineColor="#61b077" @click="clickTime" :list="tabsList" :scrollable="false">
:scrollable="false">
</u-tabs> </u-tabs>
</u-sticky> </u-sticky>
<view class="record-ul p-l-30 p-r-30"> <view class="record-ul p-l-30 p-r-30">
...@@ -10,6 +9,7 @@ ...@@ -10,6 +9,7 @@
<text>{{item.DateStr}}</text> <text>{{item.DateStr}}</text>
<text> {{item.RunNumTotal}}</text> <text> {{item.RunNumTotal}}</text>
</view> </view>
<!--没有更多信息-->
<view class="noMore"> <view class="noMore">
<u-loadmore v-show="noMore" :marginTop="10" :status="loadStatus" /> <u-loadmore v-show="noMore" :marginTop="10" :status="loadStatus" />
</view> </view>
...@@ -56,17 +56,17 @@ ...@@ -56,17 +56,17 @@
list() { list() {
http("walking.group", this.params).then(res => { http("walking.group", this.params).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.dataList = [...this.dataList, ...res.data.list]; this.dataList = [...this.dataList, ...res.data.list]; //list数据
let totalCount = res.data.total; let totalCount = res.data.total;
this.isEmpty = !this.dataList.length; 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) { if (this.lastPage == this.params.pageNo) {
this.loadStatus = "nomore"; this.loadStatus = "nomore";
this.noMore = true; this.noMore = true;
} else { } else {
this.loadStatus = "loadmore"; this.loadStatus = "loadmore";
} }
if (!res.data.list.length && !this.dataList.length) { if (!res.data.list.length && !this.dataList.length) { //什么都没有则为空
this.isEmpty = true; this.isEmpty = true;
} }
} else { } else {
...@@ -77,10 +77,8 @@ ...@@ -77,10 +77,8 @@
}) })
} }
}, },
// 触底加载更多 // 自带方法:触底加载更多
onReachBottom() { onReachBottom() {
console.log(this.params.pageNo)
console.log(this.lastPage)
if (this.params.pageNo < this.lastPage) { if (this.params.pageNo < this.lastPage) {
this.params.pageNo += 1; this.params.pageNo += 1;
this.list(); this.list();
...@@ -96,7 +94,6 @@ ...@@ -96,7 +94,6 @@
.record-li { .record-li {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
padding: 15px 10px; padding: 15px 10px;
text:last-child { text:last-child {
color: #61b077; 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