12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- var app = getApp()
- Page({
- data: {
- list:[],
- page:1
- },
- onLoad: function (options) {
- var that = this;
- // app.request("/user/wallerLogList?page=1", '', "GET").then(res => {
- // console.log(res)
- // if(res.data.data==''){
- // wx.showToast({
- // title: '暂无数据',
- // icon:'none'
- // })
- // }else{
- // that.setData({ list: res.data.data })
- // }
- // }).catch(err => {
- // console.log(err)
- // })
- wx.request({
- url: 'https://yutang.web.ximengnaikang.com/api/user/wallets',
- method: 'GET',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'Authorization':wx.getStorageSync('token')
- },
- success: function (res) {
- console.log(res.data.data)
- if(res.statusCode==200){
- // that.setData({arr:res.data.data.data,link:res.data.data.next_page_url})
- }
- }
- })
- },
- onReady: function () {
- },
- onShow: function () {
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- onPullDownRefresh: function () {
- },
- onReachBottom: function () {
- wx.showLoading({
- title: '加载中...',
- })
- var that = this;
- var page = that.data.page+1
- app.request("/user/wallerLogList?page="+page, '', "GET").then(res => {
- console.log(res)
- wx.hideLoading()
- if(res.data.data==''){
- wx.showToast({
- title: '暂无更多数据~',
- icon:'none'
- })
- }else{
- that.setData({ list: that.data.list.concat(res.data.data), page })
- }
- }).catch(err => {
- console.log(err)
- })
- },
- onShareAppMessage: function () {
-
- }
- })
|