<!--index.wxml-->
<view class="container">
  <view class="userinfo">
    <van-button round type="primary"  wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo">
      微信一键登录
    </van-button>
    <!-- <van-button round type="primary"  open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
      获取用户手机号
    </van-button> -->
    <block wx:else>
      <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
      <text class="userinfo-nickname">{{userInfo.nickName}}</text>
    </block>
  </view>
</view>
<!--微信手机号登录弹窗-->
<view class="modal-mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
  <view class="modal-dialog" wx:if="{{showModal}}">
  <view class="modal-content">
    <view><icon class="icon-box-img" type="info" size="80"></icon></view>
    <view>绑定手机号</view>
    <view>请先绑定手机号再进行此操作</view>  
    <button open-type='getPhoneNumber' bindgetphonenumber="getPhoneNumber">
      <image src='../images/showWx.png' class='iconWx'></image>微信用户一键绑定
    </button>
  </view>
</view>
<view wx:if='{{isShowUserInfoLayer}}'>
  <view class='mask_layer' />
  <view class='modal_box'>
    <view class="title">请授权获取您的用户信息</view>
    <view class='content'>
      <text class='modalMsg'>"智慧油驿站"需要获取你的用户昵称等信息</text>
    </view>
    <view class='btn1'>
      <view bindtap='bindCancelUserInfo' class='cancel'>取消</view>
      <view bindtap='bindConfirmUserInfo' class='Sure'>确定</view>
    </view>
  </view>
</view>