wallet_details.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var app = getApp()
  2. const util = require('../../utils/utils.js')
  3. Page({
  4. data: {
  5. list:[],
  6. page:1
  7. },
  8. onLoad: function (options) {
  9. var that = this;
  10. app.request("/user/wallerLogList?page=1", '', "GET").then(res => {
  11. console.log(res)
  12. if(res.data.data==''){
  13. wx.showToast({
  14. title: '暂无数据',
  15. icon:'none'
  16. })
  17. }else{
  18. that.setData({ list: res.data.data })
  19. }
  20. }).catch(err => {
  21. console.log(err)
  22. })
  23. },
  24. onReady: function () {
  25. },
  26. onShow: function () {
  27. },
  28. onHide: function () {
  29. },
  30. onUnload: function () {
  31. },
  32. onPullDownRefresh: function () {
  33. },
  34. onReachBottom: function () {
  35. wx.showLoading({
  36. title: '加载中...',
  37. })
  38. var that = this;
  39. var page = that.data.page+1
  40. app.request("/user/wallerLogList?page="+page, '', "GET").then(res => {
  41. console.log(res)
  42. wx.hideLoading()
  43. if(res.data.data==''){
  44. wx.showToast({
  45. title: '暂无更多数据~',
  46. icon:'none'
  47. })
  48. }else{
  49. that.setData({ list: that.data.list.concat(res.data.data), page })
  50. }
  51. }).catch(err => {
  52. console.log(err)
  53. })
  54. },
  55. onShareAppMessage: function () {
  56. }
  57. })