微信小程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

138 righe
2.7 KiB

  1. // pages/handle/liist.js
  2. import * as UTIL from '../../utils/util.js';
  3. import * as API from '../../utils/API.js';
  4. const app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. isIPX: app.globalData.isIPX,
  11. pageNums:1,
  12. scrollHeight:"",
  13. financeList:[],
  14. index:0,
  15. array:["收支明细公开"],
  16. userInfoObj:[],
  17. date: UTIL.formatDates(new Date),
  18. data:{}
  19. },
  20. onConfirmReviewTime(e){
  21. let data = e.detail.value;
  22. this.setData({
  23. 'date':data,
  24. 'pageNums':1});
  25. this.getList();
  26. },
  27. paging(){
  28. this.setData({
  29. pageNums:this.data.pageNums+1,
  30. })
  31. this.getList();
  32. },
  33. getList:function(){
  34. let params = {
  35. pageNum:this.data.pageNums,
  36. pageSize:10,
  37. startNY:this.data.date,
  38. all:false
  39. }
  40. UTIL.httpRequest(API.URL_GET_FINANCIALLIST,params,{
  41. success: (res) => {
  42. console.log(res);
  43. if(res.code == 200){
  44. this.setData({'data':res.summary})
  45. if(this.data.pageNums!=1&&this.data.financeList.length<res.total){
  46. let lists = this.data.financeList.concat(res.rows)
  47. this.setData({financeList:lists})
  48. }else if(this.data.pageNums==1){
  49. this.setData({financeList:res.rows})
  50. }
  51. }else{
  52. UTIL.showToastNoneIcon(res.msg);
  53. }
  54. }
  55. })
  56. },
  57. /**
  58. * 生命周期函数--监听页面加载
  59. */
  60. onLoad: function (options) {
  61. var that = this;
  62. let qu = wx.createSelectorQuery()
  63. qu.select("#top_view1").boundingClientRect()
  64. qu.select("#top_view2").boundingClientRect()
  65. qu.exec(res => {
  66. console.log(res);
  67. that.setData({
  68. scrollHeight:wx.getSystemInfoSync().windowHeight-res[0].height-res[0].top-res[1].height-res[1].left*2
  69. })
  70. })
  71. this.getList()
  72. },
  73. bindPickerChange:function(e){
  74. this.setData({index:e.detail.value});
  75. },
  76. switchTab:function(e){
  77. this.setData({
  78. active:e.currentTarget.dataset.gid
  79. })
  80. },
  81. back:function(){
  82. wx.navigateBack({
  83. delta: 1
  84. })
  85. },
  86. /**
  87. * 生命周期函数--监听页面初次渲染完成
  88. */
  89. onReady: function () {
  90. },
  91. /**
  92. * 生命周期函数--监听页面显示
  93. */
  94. onShow: function () {
  95. },
  96. /**
  97. * 生命周期函数--监听页面隐藏
  98. */
  99. onHide: function () {
  100. },
  101. /**
  102. * 生命周期函数--监听页面卸载
  103. */
  104. onUnload: function () {
  105. },
  106. /**
  107. * 页面相关事件处理函数--监听用户下拉动作
  108. */
  109. onPullDownRefresh: function () {
  110. },
  111. /**
  112. * 页面上拉触底事件的处理函数
  113. */
  114. onReachBottom: function () {
  115. },
  116. /**
  117. * 用户点击右上角分享
  118. */
  119. onShareAppMessage: function () {
  120. }
  121. })