http请求修改

This commit is contained in:
姚亚男
2021-10-19 18:04:22 +08:00
parent 06b5ac09db
commit 15a27091a8
17 changed files with 78 additions and 43 deletions
+10 -1
View File
@@ -13,17 +13,26 @@ Page({
},
loadData(){
wx.showToast({
title: '加载中...',
icon: 'loading'
})
let params = {
pageNo: this.data.pageNo,
pageSize: this.data.pageSize
}
UserApi.dataList(params).then(res=>{
if(res.success && res.result.records && res.result.records.length){
console.log(res.result.records)
this.setData({
list: [...this.data.list, ...res.result.records]
})
}
}).catch(err=>{
wx.showToast({
title: '加载失败',
icon: 'none',
duration: 2000
})
})
},
// 预览