<!--pages/user/index.wxml-->
<view class="sg-container">
  <view class="sg-white-bg">
    <view class="sg-flex sg-align-center sg-space-between sg-pad sg-bottom-border" bindtap="chooseImage">
      <view class="sg-gray-color">更换头像</view>
      <image class="sg-avatar" src="{{ avatar }}" mode="widthFix"></image>
    </view>
    <view class="sg-flex sg-align-center sg-space-between sg-pad sg-bottom-border">
      <view class="sg-gray-color">姓名</view>
      <input class="sg-input sg-text-right" value="{{name}}" bindinput="updateInput" data-name="name"></input>
    </view>
    <view class="sg-flex sg-align-center sg-space-between sg-pad sg-bottom-border">
      <view class="sg-gray-color">手机号码</view>
      <input class="sg-input sg-text-right" value="{{userInfo.phone}}" bindinput="updateInput" data-name="phone" wx:if="{{userInfo.phone}}" disabled="{{true}}"></input>
      <van-button type="info" open-type="getPhoneNumber" bind:getphonenumber="updatePhoneNumber" size="small" wx:else="{{!userInfo.phone}}">点击授权获取</van-button>
    </view>
  </view>
  <view class="sg-fix-bottom sg-pad sg-text-center sg-white-bg" bindtap="save">保存</view>
</view>