微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

finance.js 2.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. this.setData({
  62. scrollHeight:wx.getSystemInfoSync().windowHeight
  63. })
  64. this.getList()
  65. },
  66. bindPickerChange:function(e){
  67. this.setData({index:e.detail.value});
  68. },
  69. switchTab:function(e){
  70. this.setData({
  71. active:e.currentTarget.dataset.gid
  72. })
  73. },
  74. back:function(){
  75. wx.navigateBack({
  76. delta: 1
  77. })
  78. },
  79. /**
  80. * 生命周期函数--监听页面初次渲染完成
  81. */
  82. onReady: function () {
  83. },
  84. /**
  85. * 生命周期函数--监听页面显示
  86. */
  87. onShow: function () {
  88. },
  89. /**
  90. * 生命周期函数--监听页面隐藏
  91. */
  92. onHide: function () {
  93. },
  94. /**
  95. * 生命周期函数--监听页面卸载
  96. */
  97. onUnload: function () {
  98. },
  99. /**
  100. * 页面相关事件处理函数--监听用户下拉动作
  101. */
  102. onPullDownRefresh: function () {
  103. },
  104. /**
  105. * 页面上拉触底事件的处理函数
  106. */
  107. onReachBottom: function () {
  108. },
  109. /**
  110. * 用户点击右上角分享
  111. */
  112. onShareAppMessage: function () {
  113. }
  114. })