Commit b7ac2d11 by LJM

增加分页

parent 14f6116a
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
<view class="btn row rowCenter verCenter" @click="showDrawer(item)">修改</view> <view class="btn row rowCenter verCenter" @click="showDrawer(item)">修改</view>
</view> </view>
</view> </view>
<view class="row rowCenter verCenter" v-if="!hasMoreData && page > 1" style="color: #999;font-size: 16rpx;padding: 10px 0;flex: 0 0 100%;font-weight: normal;">--&nbsp;已经到底了&nbsp;--</view>
</view> </view>
<view class="no-date column rowCenter verCenter" v-else> <view class="no-date column rowCenter verCenter" v-else>
<text class="iconfont icon-a-juxing21"></text> <text class="iconfont icon-a-juxing21"></text>
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
getData() { getData() {
this.request(API.getNoTakeList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { this.request(API.getNoTakeList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.total > 0) { if (res.data.list.length > 0) {
this.hasMoreData = true; this.hasMoreData = true;
this.list = this.list.concat(res.data.list); this.list = this.list.concat(res.data.list);
} else { } else {
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
input_flag: false, input_flag: false,
input_position: false, input_position: false,
page: 1, page: 1,
limit: 1000, limit: 100,
index: 0, index: 0,
list: [], list: [],
info: {}, info: {},
...@@ -252,6 +252,13 @@ ...@@ -252,6 +252,13 @@
} }
}; };
}, },
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
console.log(e); console.log(e);
if (e.index == 0) { if (e.index == 0) {
......
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 sign in to comment