// pages/login/login.js
import WxValidate from '../../utils/wxValidate'
const app = getApp()
var url = app.globalData.url
Page({

  /**
   * 页面的初始数据
   */
  data: {
    src: '/image/fen.jpg',
    src3: '/image/huang.png',
    src4: '/image/zan.png',
    showMore: false,
    frameStyle: { useTop: true, name: '我的', leftArrow: false, useBar: true },
    // 主体高度
    infoHeight: '',
    total: '4',
    listbisai: [
      {
        id: '1', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '0', groupname2: '马尼拉组', fraction1: '0', site: '第一场', groupname1: '哈拉海组', week: '星期五', time: '13：00',
        state: '已结束', date: '01.15', start: '未开始'
      }
    ],
    list: [
      {
        id: '1', name: '张爽', company: '福瑞科技有限公司', gender: '女', src: '/image/tou.png', address: '马利克克海拉队', team: '队员',
      },
    ],
    list3: [
      {
        id: '1', head: '/image/head1.png', group: '哈拉海队', time: '08:30', ball: '足球', grade: 'c', date: '2022.01.15', person: '10',
      },
      {
        id: '2', head: '/image/head1.png', group: '尼奥尔队', time: '08:30', ball: '篮球', date: '2022.01.15', person: '9',
      },
      {
        id: '1', head: '/image/head1.png', group: '哈拉海队', time: '08:30', ball: '足球', grade: 'c', date: '2022.01.15', person: '10',
      },
      {
        id: '1', head: '/image/head1.png', group: '哈拉海队', time: '08:30', ball: '足球', grade: 'c', date: '2022.01.15', person: '10',
      },
    ],
    showModal: false,
    

  },
  tabPath(e) {
    let query = e.detail.detail;
    if (query) wx.redirectTo({ url: `/pages/${query}/index` })
  },
  //展开
  listToggle: function () {
    this.setData({
      showMore: !this.data.showMore
    })
  },
  //修改个人信息
  modify: function () {
    wx.navigateTo({
      url: `/pages/information/index`,
    })
  },
  //上传比分
  upload: function () {
    wx.navigateTo({
      url: `/pages/score/index`,
    })
  },
  //创建团队
  create: function () {
    wx.navigateTo({
      url: `/pages/createTeam/index`,
    })
  },
  ToDetails:function () {
    wx.navigateTo({
      url: `/pages/teamDetails/detail`,
    })
  },
  //已上传图片
  Uploaded: function () {
    wx.navigateTo({
      url: `/pages/photo/index`,
    })
  },
  //修改密码
  change: function () {
    wx.navigateTo({
      url: `/pages/password/index`,
    })
  },
  //审核队员
  examine: function () {
    wx.navigateTo({
      url: `/pages/auditTeam/index`,
    })
  },
//解散申请
apply: function () {
  wx.navigateTo({
    url: `/pages/dissolution/index`,
  })
},
  //解散团队弹窗
  clickme: function () {
    this.setData({
      showModal: true
    })
  },
  preventTouchMove: function () {
  },
  //关闭弹窗
  go: function () {
    this.setData({
      showModal: false
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // 计算高度
    this.searchHeight()
  },
  // 计算高度
  searchHeight: function () {
    let frameStyle = this.data.frameStyle;
    let client = app.globalData.client;
    // 减去状态栏
    let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
    // 是否减去底部菜单
    if (frameStyle.useBar) infoHeight = infoHeight - 50;
    if (infoHeight) this.setData({ infoHeight: infoHeight })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})