<!--pages/contest/contest.wxml-->
<wxs src="../../../utils/util.wxs" module="format" />
<view>
  <image mode="widthFix" src="../../../imgs/contest/bg.png" class="bg"></image>
  <image src="../../../imgs/contest/ranking/home.png" class="home" style="top:{{statusBar}}px" bindtap="goHome"></image>
  <view class="page-title" style="padding-top:{{statusBar}}px">个人信息</view>
  <view class="form">
    <view class="form-item">
      <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
      <view class="content">
        <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">姓名</view>
        <input bindinput="changeInput" id="actualName" value="{{form.actualName}}" placeholder="请输入中文" placeholder-class="phcolor"></input>
      </view>
    </view>
    
    <view class="{{jgList[0]?'hidden':'warning'}}" wx:if="{{!jgList[0]}}">
      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
      <view class="warning-text">请填写姓名</view>
    </view>

    <view class="form-item">
      <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
      <view class="content">
        <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">性别</view>
        <view class="select">
          <picker bindchange="bindPicker" value="{{value}}" data-list="sexList" range="{{sexList}}" range-key="label" id="sex">
            <view class="picker {{form.sex?'':'phcolor'}}">
              {{form.sex?sexList[form.sex-1].label:'请选择'}}
            </view>
          </picker>
          <image class="arrow" src="../../../imgs/contest/arrow.png" mode="widthFix"></image>
        </view>
      </view>
    </view>

    <view class="{{jgList[1]?'hidden':'warning'}}" wx:if="{{!jgList[1]}}">
      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
      <view class="warning-text">请选择性别</view>
    </view>

    <view class="form-item">
      <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
      <view class="content">
        <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">生日</view>
        <!-- <input bindinput="changeInput" id="age" value="{{form.age}}" maxlength="{{2}}" placeholder="请输入" placeholder-class="phcolor"></input> -->
        <view class="select">
          <!-- <picker bindchange="bindPicker" value="{{value}}" data-list="ageList" range="{{ageList}}" range-key="label" id="age">
            <view class="picker {{form.age?'':'phcolor'}}">
              {{form.age?ageList[form.age-1].label:'请选择'}}
            </view>
          </picker> -->
          <picker mode="date" start='1940-01-01' end='{{endDate}}' value="{{form.birthday}}" id="birthday" bindchange="bindPickerData">
            <view class="picker {{form.birthday||'phcolor'}}">
              {{form.birthday||'请选择'}}
            </view>
          </picker>
          <image class="arrow" src="../../../imgs/contest/arrow.png" mode="widthFix"></image>
        </view>
      </view>
    </view>

    <view class="{{jgList[2]?'hidden':'warning'}}" wx:if="{{!jgList[2]}}">
      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
      <view class="warning-text">请选择生日</view>
    </view>

    <view class="form-item">
      <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
      <view class="content">
        <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">区域</view>
        <view class="select">
          <picker bindchange="bindPickerChange" value="{{value}}" range="{{areaList}}" range-key="areaName" id="area">
            <view class="picker {{form.area?'':'phcolor'}}">
              {{form.area?form.areaName:'请选择'}}
            </view>
          </picker>
          <image class="arrow" src="../../../imgs/contest/arrow.png" mode="widthFix"></image>
        </view>
      </view>
    </view>

    <view class="{{jgList[3]?'hidden':'warning'}}" wx:if="{{!jgList[3]}}">
      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
      <view class="warning-text">请选择区域</view>
    </view>

    <view class="form-item">
      <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
      <view class="content">
        <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">学校</view>
        <!-- <input bindinput="changeInput" id="school" placeholder="请输入" placeholder-class="phcolor"></input> -->
        <view class="select">
          <picker bindchange="bindPickerSchool" value="{{value}}" range="{{schoolList}}" range-key="schoolName" id="school">
            <view class="picker {{form.school?'':'phcolor'}}">
              {{form.school?form.schoolName:'请选择'}}
            </view>
          </picker>
          <image class="arrow" src="../../../imgs/contest/arrow.png" mode="widthFix"></image>
        </view>
      </view>
    </view>

    <view class="form-item" wx:if="{{format.isIncludes(form.schoolName,'其他')}}">
      <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
      <view class="content">
        <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">其他</view>
        <input bindinput="changeInput" id="other" placeholder="请输入学校名称" placeholder-class="phcolor"></input>
      </view>
    </view>

    <view class="{{jgList[4]?'hidden':'warning'}}" wx:if="{{!jgList[4]}}">
      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
      <view class="warning-text">请选择学校</view>
    </view>

    <view class="form-item">
      <image class="form-item-bg" mode="widthFix" src="../../../imgs/contest/list-bg.png"></image>
      <view class="content">
        <view class="form-item-label" style="border-right: 4rpx solid #D8D8D8">年级</view>
        <!-- <input bindinput="changeInput" id="grade" placeholder="请输入" placeholder-class="phcolor"></input> -->
        <view class="select">
          <picker bindchange="bindPicker" value="{{value}}" data-list="gradeList" range="{{gradeList}}" range-key="label" id="grade">
            <view class="picker {{form.grade||'phcolor'}}">
              {{form.grade||'请选择'}}
            </view>
          </picker>
          <image class="arrow" src="../../../imgs/contest/arrow.png" mode="widthFix"></image>
        </view>
      </view>
    </view>

    <view class="{{jgList[5]?'hidden':'warning'}}" wx:if="{{!jgList[5]}}">
      <image mode="widthFix" src="../../../imgs/contest/warning.png" class="warning-icon"></image>
      <view class="warning-text">请选择年级</view>
    </view>

  </view>
  <view class="button" bindtap="submit">
    <!-- <image class="button-bg" mode="widthFix" src="../../../imgs/contest/button-bg.png"></image> -->
    <view class="button-text">Start Now !</view>
  </view>
</view>
