index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // pages/promoter-order/index.js
  2. const app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. parameter: {
  9. 'navbar': '1',
  10. 'return': '1',
  11. 'title': '推广人订单',
  12. 'color':true,
  13. 'class':'0'
  14. },
  15. page: 0,
  16. limit: 8,
  17. status: false,
  18. recordList: [],
  19. recordCount: 0,
  20. },
  21. /**
  22. * 生命周期函数--监听页面加载
  23. */
  24. onLoad: function (options) {
  25. },
  26. /**
  27. * 生命周期函数--监听页面初次渲染完成
  28. */
  29. onReady: function () {
  30. },
  31. /**
  32. * 生命周期函数--监听页面显示
  33. */
  34. onShow: function () {
  35. this.getRecordOrderList();
  36. },
  37. getRecordOrderList: function () {
  38. var that = this;
  39. var page = that.data.page;
  40. var limit = that.data.limit;
  41. var status = that.data.status;
  42. var recordList = that.data.recordList;
  43. var recordListNew = [];
  44. if (status == true) return;
  45. app.baseGet(app.U({ c: 'user_api', a: 'get_record_order_list', q: { page: page, limit: limit } }), function (res) {
  46. var len = res.data.list ? res.data.list.length : 0;
  47. var recordListData = res.data.list;
  48. recordListNew = recordList.concat(recordListData);
  49. that.setData({ recordCount: res.data.count || 0, status: limit > len, page: limit + page, recordList: recordListNew });
  50. });
  51. },
  52. /**
  53. * 生命周期函数--监听页面隐藏
  54. */
  55. onHide: function () {
  56. },
  57. /**
  58. * 生命周期函数--监听页面卸载
  59. */
  60. onUnload: function () {
  61. },
  62. /**
  63. * 页面相关事件处理函数--监听用户下拉动作
  64. */
  65. onPullDownRefresh: function () {
  66. },
  67. /**
  68. * 页面上拉触底事件的处理函数
  69. */
  70. onReachBottom: function () {
  71. },
  72. /**
  73. * 用户点击右上角分享
  74. */
  75. onShareAppMessage: function () {
  76. }
  77. })