settlementList.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. var page = 1;
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. settlementList: [{
  8. id: "1",
  9. disSettleNo: "111111111111",
  10. settleNum: "111",
  11. totalAmount: "2222",
  12. payNo: "4444",
  13. createTime: "2018-12-16"
  14. }],
  15. loadText: "没有更多记录了~",
  16. LoadingComplete: !1,
  17. scrollTop: 0,
  18. containerHeight: 0,
  19. chooseDate: "",
  20. chooseDateTime: "",
  21. data: "",
  22. settle: "",
  23. communnityId: ""
  24. },
  25. /**
  26. * 生命周期函数--监听页面加载
  27. */
  28. onLoad: function(options) {
  29. var sysInfo = wx.getSystemInfoSync();
  30. this.setData({
  31. containerHeight: sysInfo.windowHeight
  32. });
  33. },
  34. /**
  35. * 生命周期函数--监听页面初次渲染完成
  36. */
  37. onReady: function() {
  38. },
  39. /**
  40. * 生命周期函数--监听页面显示
  41. */
  42. onShow: function() {
  43. page = 1, wx.showLoading({
  44. title: "加载中...",
  45. mask: true
  46. });
  47. var dayTime = new Date(),
  48. year = dayTime.getFullYear(),
  49. mon = dayTime.getMonth() + 1,
  50. dateTime = Date.parse(dayTime);
  51. this.setData({
  52. chooseDate: year + "年" + mon + "月",
  53. chooseDateTime: dateTime
  54. }), this.data.settlementList = [], this.getData();
  55. },
  56. /**
  57. * 获取数据
  58. */
  59. getData: function() {
  60. console.log(111)
  61. wx.hideLoading();
  62. },
  63. /**
  64. * 获取列表
  65. */
  66. getSettlementList: function() {
  67. console.log(222)
  68. },
  69. /**
  70. * 获取更多
  71. */
  72. getMoreList: function() {
  73. wx.showLoading({
  74. title: "加载中...",
  75. mask: true
  76. }), this.data.LoadingComplete ? (page += 1, this.getSettlementList()) : wx.hideLoading();
  77. },
  78. /**
  79. * 日期监控
  80. */
  81. bindDateChange: function(t) {
  82. page = 1, console.log("picker发送选择改变,携带值为", t.detail.value), this.setData({
  83. date: t.detail.value
  84. });
  85. var e = this.data.date.split("-"),
  86. a = Date.parse(this.data.date);
  87. this.setData({
  88. chooseDate: e[0] + "年" + e[1] + "月",
  89. chooseDateTime: a
  90. }), this.getData();
  91. },
  92. /**
  93. * 生命周期函数--监听页面隐藏
  94. */
  95. onHide: function() {
  96. },
  97. /**
  98. * 生命周期函数--监听页面卸载
  99. */
  100. onUnload: function() {
  101. },
  102. /**
  103. * 页面相关事件处理函数--监听用户下拉动作
  104. */
  105. onPullDownRefresh: function() {
  106. },
  107. /**
  108. * 页面上拉触底事件的处理函数
  109. */
  110. onReachBottom: function() {
  111. },
  112. /**
  113. * 用户点击右上角分享
  114. */
  115. onShareAppMessage: function() {
  116. }
  117. })