const app = getApp();
const util = require("../../util/util.js")
Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    ColorList: app.globalData.ColorList, 
    list:[],   
  },
  onLoad: function ( opt ) { 
    let month = opt.month||'2021-03';
    console.log( "month", month)
    this.loadData( month )
  },
  loadData( month ){
    util.http("/wx/incomeList", {month},  (err, res)=> {
      console.log("res", err, res)
      if( err != 0 ) return;
      let list = res.map(item=>{
        item.finish_at = item.finish_at.substr(0,19)
        return item
      })
      this.setData({list})
    });
  }
});
