<!--pages/bind/index.wxml-->
<view class="sg-container sg-white-bg">
  <view class="sg-pad">
    <view class="sg-pick-box">
      <view class="sg-pick-item sg-pad-tb-sm sg-flex sg-align-center sg-bottom-border sg-space-between">
        <view class="sg-pick-name">真实姓名</view>
        <input type="text" value="{{name}}" placeholder="请输入真实姓名" data-name="name" bindchange="onInputChange" class="sg-gray-color" style="text-align: right"/>
      </view>
      <!-- <view class="sg-pick-item sg-pad-tb-sm sg-flex sg-align-center sg-bottom-border sg-space-between">
        <view class="sg-pick-name">手机号</view>
        <view wx:if="{{phone}}">{{phone}}</view>
        <van-button type="primary" open-type="getPhoneNumber" bind:getphonenumber="updatePhoneNumber" size="small" wx:else>授权获取手机号</van-button>
      </view> -->
      <view class="sg-pick-item sg-pad-tb-sm sg-flex sg-align-center sg-bottom-border sg-space-between">
        <view class="sg-pick-name">所属项目</view>
        <picker bindchange="bindPickerChange" value="{{projectIndex}}" range="{{projects}}" range-key="name"
          data-name="projectIndex">
          <view class="picker sg-gray-color">
            {{projectIndex >= 0 ? projects[projectIndex].name : '请选择添加项目'}}
          </view>
        </picker>
      </view>
      <view class="sg-pick-item sg-pad-tb-sm sg-flex sg-align-center sg-space-between">
        <view class="sg-pick-name">申请角色</view>
        <picker bindchange="bindPickerChange" value="{{roleIndex}}" range="{{roles}}" range-key="name"
          data-name="roleIndex">
          <view class="picker sg-gray-color">
            {{roleIndex >= 0 ? roles[roleIndex].name : '请选择角色'}}
          </view>
        </picker>
      </view>
      <view class="sg-pick-item sg-pad-tb-sm sg-bottom-border">
        <view class="sg-pick-name">备注</view>
        <textarea value="{{remark}}" placeholder="请填写10个字以上的备注描述以便管理员能快速通过授权" data-name="remark" bindinput="onInputChange" class="sg-gray-color sg-pad-tb-sm" maxlength="200"/>
        <view class="sg-text-right sg-gray-color sg-pad-tb-sm">{{remark.length}}/200</view>
      </view>
    </view>
    <view class="sg-margin-tb">
      <van-button type="info" block  bindtap="getUserInfo">提交</van-button>
    </view>
  </view>
</view>