cashRecord.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // pages/cashRecord/cashRecord.js
  2. const app = getApp()
  3. var net = require('../../utils/net.js')
  4. var url = require('../../utils/url.js')
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. total:'',
  11. list: [],
  12. isAll: false,
  13. isLoading: false
  14. },
  15. getList: function (id) {
  16. net.connect({
  17. url: url.host + url.withdraw_list,
  18. data: { lastWithdrawId: id },
  19. success: res => {
  20. if (id == '0') {
  21. wx.hideLoading()
  22. }
  23. var isAll = false
  24. if (res.data.data.length == 0) {
  25. isAll = true
  26. }
  27. this.setData({
  28. isAll: isAll,
  29. isLoading: false,
  30. list: this.data.list.concat(res.data.data)
  31. })
  32. },
  33. })
  34. },
  35. /**
  36. * 生命周期函数--监听页面加载
  37. */
  38. onLoad: function (options) {
  39. var total = '已经累计提现 ¥' + ((Number(options.applyFee) + Number(options.finishFee)) / 100)
  40. this.setData({
  41. total: total
  42. })
  43. wx.showLoading({
  44. title: '',
  45. })
  46. this.getList('0')
  47. },
  48. /**
  49. * 生命周期函数--监听页面初次渲染完成
  50. */
  51. onReady: function () {
  52. },
  53. /**
  54. * 生命周期函数--监听页面显示
  55. */
  56. onShow: function () {
  57. },
  58. /**
  59. * 生命周期函数--监听页面隐藏
  60. */
  61. onHide: function () {
  62. },
  63. /**
  64. * 生命周期函数--监听页面卸载
  65. */
  66. onUnload: function () {
  67. },
  68. /**
  69. * 页面相关事件处理函数--监听用户下拉动作
  70. */
  71. onPullDownRefresh: function () {
  72. },
  73. /**
  74. * 页面上拉触底事件的处理函数
  75. */
  76. onReachBottom: function () {
  77. if (this.data.isAll || this.data.isLoading) {
  78. return
  79. }
  80. this.setData({
  81. isLoading: 'ture'
  82. })
  83. var count = this.data.list.length
  84. this.getList(this.data.list[count - 1]['withdrawId'])
  85. },
  86. /**
  87. * 用户点击右上角分享
  88. */
  89. // onShareAppMessage: function () {
  90. // }
  91. })