const app = require('../../utils/util.js');
const tools = require('../../utils/tools.js');
Page({
  data: {
    Arr: [{
      name: "周勉征",
      zw: "项目组长",
      phone: "13843043033"
    }, {
      name: "刘占辉",
      zw: "项目副组长",
      phone: "18643067799"
    }, {
      name: "常 茳",
      zw: "项目副组长",
      phone: "13364646964"
    }, {
      name: "冯 爽",
      zw: "项目助理",
      phone: "13944098768"
    }, {
      name: "吴琳琳",
      zw: "项目秘书",
      phone: "18604413379"
    }]
  },
  async onLoad() {
    wx.showLoading({
      title: '加载中',
    })
    const sessionKey = await tools.checkSessionAndLogin();
    wx.request({
      url: app.globalData.publicUrl + '/wx/student/getTeamPosition',
      method: "post",
      data: {
        sessionKey
      },
      success: (res) => {
        this.setData({
          secretary:res.data.data.secretary,
          organization:res.data.data.organization,
          propaganda:res.data.data.propaganda,
          projectLeader:res.data.data.projectLeader,
          deputyProjectLeader:res.data.data.deputyProjectLeader,
          projectAssistant:res.data.data.projectAssistant,
          projectSecretary:res.data.data.projectSecretary
        })
        wx.hideLoading()
        console.log(res.data.data.secretary,'书记');
        console.log(res.data.data.organization,'组织委员');
        console.log(res.data.data.propaganda,'宣传委员');
        console.log(res.data.data.projectLeader,'项目组长');
        console.log(res.data.data.deputyProjectLeader,'项目副组长');
        console.log(res.data.data.projectAssistant,'项目助理');
        console.log(res.data.data.projectSecretary,'项目秘书');
      }
    })
  }
})