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
+12 -3
View File
@@ -17,20 +17,29 @@ Page({
})
},
loadData(){
wx.showToast({
title: '加载中...',
icon: 'loading'
})
let params = {
pageNo: this.data.pageNo,
pageSize: this.data.pageSize
}
UserApi.contractList(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
})
})
},
/**
* 生命周期函数--监听页面显示
*/
@@ -46,4 +55,4 @@ Page({
this.data.pageNo++
this.loadData()
}
})
})