123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- const app = getApp();
- const util = require("../../util/util.js")
- Page({
- data: {
- StatusBar: app.globalData.StatusBar,
- CustomBar: app.globalData.CustomBar,
- nd:{
- year:"2021年",
- count:1,
- fee:100
- },
- index: 0,
- year:0,
- month:0,
- picker: {},
- },
- DateChange: function( e ){
- console.log( e)
- },
- gotoLog(e){
- let {month, year} = e.currentTarget.dataset;
- let monthStr = month <10?(year+'-0'+month):(year+'-'+month);
- wx.navigateTo({
- url: `/pages/log/log?month=${monthStr}`,
- })
- },
- loadData(){
- let nd = this.data.nd
- util.http("/wx/incomeInfo", {}, (err, res) =>{
- if( err == 0){
- nd = Object.assign( nd, res )
- this.setData({ nd })
- }
- });
- },
- onShow: function(){
- this.loadData()
- },
- onLoad: function (options) {
- var date = new Date();
- let year=date.getFullYear();
- let month=date.getMonth()+1;
- let picker ={};
- for( let i=1;i<= month;i++){
- picker[year+'-'+month+'01'] = year+'年'+i+'月';
- }
- this.setData({submit:false,picker,year, month})
- this.loadData()
- }
- })
|