account_details.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. var app = getApp()
  2. const util = require('../../utils/utils.js')
  3. Page({
  4. data: {
  5. accountList: [],
  6. links: '',//下一页地址
  7. pages: 1,//当前页地址
  8. },
  9. onLoad: function (options) {
  10. var that = this;
  11. that.getList()
  12. },
  13. //获取订单列表
  14. getList: function () {
  15. let that = this
  16. let data = {
  17. page: that.data.pages
  18. }
  19. app.request("/user/wallerLogList", data, "GET").then(res => {
  20. if (res.status == 200) {
  21. let arr = res.data.data
  22. var accountList = that.data.accountList.concat(arr);
  23. if (arr.length == 0) {
  24. my.showToast({
  25. content: '暂无更多~',
  26. icon: 'none'
  27. })
  28. }else{
  29. that.setData({
  30. accountList,
  31. links: res.data.meta.pagination.links
  32. })
  33. }
  34. my.hideLoading({
  35. complete: (res) => { },
  36. })
  37. }
  38. }).catch(err => {
  39. console.log(err)
  40. })
  41. },
  42. onReady: function () {
  43. },
  44. onShow: function () {
  45. },
  46. onHide: function () {
  47. },
  48. onUnload: function () {
  49. },
  50. onPullDownRefresh: function () {
  51. },
  52. onReachBottom: function () {
  53. if (this.data.links == null) {
  54. my.showToast({
  55. content: '暂无更多',
  56. icon: 'none'
  57. })
  58. return
  59. } else {
  60. let page = this.data.pages++
  61. page++
  62. this.setData({
  63. pages: page
  64. })
  65. this.getList()
  66. }
  67. },
  68. onShareAppMessage: function () {
  69. }
  70. })