list.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. var util = require('../../../../utils/util.js');
  2. var api = require('../../../../config/api.js');
  3. var app = getApp();
  4. Page({
  5. data: {
  6. list:[],
  7. page: 1,
  8. limit: 10,
  9. totalPages: 1,
  10. statusType:'全部',
  11. type:'99',
  12. columns:['全部','审核中','已提现','提现失败'],
  13. statusList:['99','0','3','5'],
  14. showPicker:false,
  15. },
  16. getList() {
  17. let that = this;
  18. util.request(api.RefereeCashoutList, {
  19. page: that.data.page,
  20. limit: that.data.limit,
  21. status:that.data.type
  22. }).then(function(res) {
  23. if (res.errno === 0) {
  24. that.setData({
  25. list: that.data.list.concat(res.data.list),
  26. totalPages: res.data.pages
  27. });
  28. }
  29. });
  30. },
  31. /**
  32. * 生命周期函数--监听页面加载
  33. */
  34. onLoad: function (options) {
  35. this.getList();
  36. },
  37. /**
  38. * 生命周期函数--监听页面初次渲染完成
  39. */
  40. onReady: function () {
  41. },
  42. /**
  43. * 生命周期函数--监听页面显示
  44. */
  45. onShow: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面隐藏
  49. */
  50. onHide: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面卸载
  54. */
  55. onUnload: function () {
  56. },
  57. /**
  58. * 页面相关事件处理函数--监听用户下拉动作
  59. */
  60. onPullDownRefresh: function () {
  61. },
  62. /**
  63. * 页面上拉触底事件的处理函数
  64. */
  65. onReachBottom: function () {
  66. if (this.data.totalPages > this.data.page) {
  67. this.setData({
  68. page: this.data.page + 1
  69. });
  70. this.getList();
  71. } else {
  72. wx.showToast({
  73. title: '没有更多记录了',
  74. icon: 'none',
  75. duration: 2000
  76. });
  77. return false;
  78. }
  79. },
  80. showPicker(){
  81. this.setData({
  82. showPicker:true
  83. });
  84. },
  85. onCancel: function () {
  86. this.setData({
  87. showPicker: false,
  88. });
  89. },
  90. onConfirm: function (event) {
  91. this.setData({
  92. type: this.data.statusList[event.detail.index],
  93. statusType:event.detail.value,
  94. showPicker: false,
  95. });
  96. this.setData({
  97. page:1,
  98. list:[]
  99. });
  100. this.getList();
  101. },
  102. /**
  103. * 用户点击右上角分享
  104. */
  105. onShareAppMessage: function () {
  106. }
  107. })