Commit f9d145ea by 姜雷

Merge branch 'test'

parents 8e0a4aad 9db8d416
......@@ -101,10 +101,15 @@ Component({
});
},
refreshList() {
wx.showLoading({
title: '加载中',
mask: true,
});
this.fetchList({
pageNum: 1,
})
.then(res => {
wx.hideLoading();
const { list } = res.data;
this.setData({
pageNum: 1,
......@@ -112,14 +117,20 @@ Component({
});
})
.catch(err => {
wx.hideLoading();
console.log(err);
});
},
getMoreListItem() {
wx.showLoading({
title: '加载中',
mask: true,
});
this.fetchList({
pageNum: this.data.pageNum + 1,
})
.then(res => {
wx.hideLoading();
const { list } = res.data;
if (list && list.length) {
this.setData!({
......@@ -129,6 +140,7 @@ Component({
}
})
.catch(err => {
wx.hideLoading();
console.log(err);
});
},
......
......@@ -109,6 +109,7 @@ Component({
refreshList() {
wx.showLoading({
title: '加载中',
mask: true,
});
this.fetchList()
.then(res => {
......@@ -118,6 +119,10 @@ Component({
this.setData({
['dataList.' + this.data.status]: res.data,
});
} else {
this.setData({
['dataList.' + this.data.status]: [],
});
}
})
.catch(err => {
......@@ -128,6 +133,7 @@ Component({
getMoreListItem() {
wx.showLoading({
title: '加载中',
mask: true,
});
let nextPage = this.data.pagination[this.data.status].pageNum + 1;
this.fetchList({
......
......@@ -98,6 +98,7 @@ Component({
refreshList() {
wx.showLoading({
title: '加载中',
mask: true,
});
this.fetchList({})
.then(res => {
......@@ -108,6 +109,10 @@ Component({
this.setData({
dataList: list,
});
} else {
this.setData({
dataList: [],
});
}
})
.catch(err => {
......@@ -118,6 +123,7 @@ Component({
getMoreListItem() {
wx.showLoading({
title: '加载中',
mask: true,
});
let nextPage = this.data.pageNum + 1;
this.fetchList({
......
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