<!--pages/info/index.wxml-->
<title-bar title="个人信息"></title-bar>
<scroll-view>
  <view class="bg">
    <view catchtap="fixName" class="item h-div v-center">
      <text class="flex lab">姓名</text>
      <text class="val">{{userInfo.chinaName}}</text>
    </view>
    <view class="item h-div v-center">
      <text class="lab flex">岗位名称</text>
      <text class="val">{{userInfo.postName}}</text>
    </view>
  </view>
  <view class="bg">
    <view class="item h-div v-center">
      <text class="lab flex">微信绑定</text>
      <text catchtap="unbindWX" wx:if="{{userInfo.openid}}" class="val tips">解除绑定</text>
      <text catchtap="bindWX" wx:else class=" val tips">立即绑定</text>
      <a class="weui-cell_access">
        <view class="weui-cell__ft"></view>
      </a>
    </view>
    <view class="item h-div v-center" catchtap="changePwd">
      <text class="lab flex">修改密码</text>
      <a class="weui-cell_access">
        <view class="weui-cell__ft"></view>
      </a>
    </view>
    <view class="item h-div v-center" catchtap="deal">
      <text class="lab flex">用户协议和隐私协议</text>
      <a class="weui-cell_access">
        <view class="weui-cell__ft"></view>
      </a>
    </view>
  </view>
  <view catchtap="exit" class="exit">退出登录</view>
</scroll-view>

<!-- 修改密码 -->
<view class="cu-modal {{showPwdPop?'show':''}}">
  <view class="cu-dialog pop">
    <view class="cu-bar justify-end pop-header">
      <view class="content text-black" style="font-weight: bold;">修改密码</view>
      <view class="action" catchtap="submit" data-type="{{2}}">
        <text class="cuIcon-close text-black"></text>
      </view>
    </view>
    <view class="h-div v-center pwd-bg">
      <image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
      <input value="{{postData.oldPassword}}" placeholder="输入旧密码" bindinput="inputedit" data-item="oldPassword" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
    </view>
    <view class="h-div v-center pwd-bg">
      <image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
      <input value="{{postData.password}}" placeholder="输入新密码" bindinput="inputedit" data-item="password" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
    </view>
    <view class="h-div v-center pwd-bg">
      <image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
      <input value="{{postData.checkPassword}}" placeholder="确认新密码" bindinput="inputedit" data-item="checkPassword" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
    </view>

    <view class="single">密码为6-20位数字、字母或下划线，至少包括其中两种，以字母开头!</view>

    <view catchtap="submit" data-type="{{1}}" class="submit-btn btn-option">确定</view>
  </view>
</view>
<!-- 修改密码 -->
<view class="cu-modal {{showNamePop?'show':''}}">
  <view class="cu-dialog pop">
    <view class="cu-bar justify-end pop-header">
      <view class="content text-black" style="font-weight: bold;">修改名字</view>
      <view class="action" catchtap="submit" data-type="{{3}}">
        <text class="cuIcon-close text-black"></text>
      </view>
    </view>
    <view class="h-div v-center pwd-bg">
      <image class="icon" src="/images/pws-icon.png" mode="aspectFit" />
      <input value="{{postData.name}}" placeholder="输入姓名" bindinput="inputedit" data-item="oldPassword" data-obj="postData" placeholder-style="color:#999999" style="color: #333333;" />
    </view>

    <view catchtap="fixName" data-type="{{3}}" class="submit-btn btn-option">确定</view>
  </view>
</view>