修复我的足迹分页bug
parent
240a27a61a
commit
3e30f5e18f
|
@ -200,7 +200,7 @@ export default {
|
||||||
this.tabCurrentIndex++;
|
this.tabCurrentIndex++;
|
||||||
|
|
||||||
// 当前距离重新为最上面
|
// 当前距离重新为最上面
|
||||||
this.scrollTop = 0;
|
this.$set(this,'scrollTop',0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$emit("funcValue", this.tabbars);
|
this.$emit("funcValue", this.tabbars);
|
||||||
|
|
|
@ -1,19 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="myTracks">
|
<view class="myTracks">
|
||||||
<u-navbar title="我的足迹">
|
<u-navbar title="我的足迹">
|
||||||
|
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view v-for="(item, index) in trackList" :key="index">
|
<view v-for="(item, index) in trackList" :key="index">
|
||||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
||||||
<view class="myTracks-items">
|
<view class="myTracks-items">
|
||||||
|
|
||||||
<u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id" @click="delTracks"
|
<u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
|
||||||
@open="open" :options="options">
|
@click="delTracks" @open="open" :options="options">
|
||||||
<view class="myTracks-item">
|
<view class="myTracks-item">
|
||||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
||||||
<image :src="item.thumbnail"></image>
|
<image :src="item.thumbnail"></image>
|
||||||
|
@ -34,9 +31,9 @@
|
||||||
<view class="myTracks-divider"></view>
|
<view class="myTracks-divider"></view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -49,7 +46,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loadStatus: "more", //底部下拉加载状态
|
|
||||||
whetherEmpty: false, //是否数据为空
|
whetherEmpty: false, //是否数据为空
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
|
@ -57,14 +54,12 @@
|
||||||
order: "desc",
|
order: "desc",
|
||||||
sort: "updateTime",
|
sort: "updateTime",
|
||||||
},
|
},
|
||||||
options: [
|
options: [{
|
||||||
{
|
text: '删除',
|
||||||
text: '删除',
|
style: {
|
||||||
style: {
|
backgroundColor: '#dd524d'
|
||||||
backgroundColor: '#dd524d'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
}],
|
||||||
trackList: [], //足迹列表
|
trackList: [], //足迹列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -73,12 +68,11 @@
|
||||||
* 滑到底部加载下一页数据
|
* 滑到底部加载下一页数据
|
||||||
*/
|
*/
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.loadStatus != "noMore") {
|
this.params.pageNumber++;
|
||||||
this.params.pageNumber++;
|
this.getList();
|
||||||
this.getList();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onShow() {
|
||||||
|
this.trackList = [];
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
@ -130,12 +124,8 @@
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
if (data.total == 0) {
|
if (data.total == 0) {
|
||||||
this.whetherEmpty = true;
|
this.whetherEmpty = true;
|
||||||
} else if (data.total < 10) {
|
|
||||||
this.loadStatus = "noMore";
|
|
||||||
this.trackList.push(...data);
|
|
||||||
} else {
|
} else {
|
||||||
this.trackList.push(...data);
|
this.trackList.push(...data);
|
||||||
if (data.length < 10) this.loadStatus = "noMore";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue