const app = require('../../utils/util.js');
Page({
  data: {
    logs: [],
    active: 0,
    collectInfosList: [{
        name: '张三',
        time: "2020-08-07T11:47:47.400Z"
      },
      {
        name: '李四',
        time: "2020-08-07T11:47:47.400Z"
      },
    ],
    list: {},
    visitInfosList: [{
        name: '张三111',
        visitTime: "2020-02-16T11:22:07.697Z"
      },
      {
        name: '李四22',
        visitTime: "2020-02-16T11:22:07.697Z"
      },
    ]
  },
  paiXing() {
    wx.request({
      url: app.globalData.publicUrl + '/applet/userValue',
      method: "GET",
      header: {
        appletsId: wx.getStorageSync('openId')
      },
      success: (res) => {
        console.log(res, "000");
        this.setData({
          list: res.data.data,
          number: res.data.data.userTotalValue.toString(),
        })
        console.log(this.data.number,"knakna");
        
      }
    })
  },
  onShow() {
    console.log(wx.getStorageSync('user'), "打印");
    if (wx.getStorageSync('user') == '') {
      wx.redirectTo({
        url: '/pages/login/login',
      })
    } else {

    }
  },
  onLoad() {
    this.paiXing();
  }
})