index.wxml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!--index.wxml-->
  2. <view class="container">
  3. <view class="userinfo">
  4. <van-button round type="primary" wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo">
  5. 微信一键登录
  6. </van-button>
  7. <!-- <van-button round type="primary" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
  8. 获取用户手机号
  9. </van-button> -->
  10. <block wx:else>
  11. <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
  12. <text class="userinfo-nickname">{{userInfo.nickName}}</text>
  13. </block>
  14. </view>
  15. </view>
  16. <!--微信手机号登录弹窗-->
  17. <view class="modal-mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
  18. <view class="modal-dialog" wx:if="{{showModal}}">
  19. <view class="modal-content">
  20. <view><icon class="icon-box-img" type="info" size="80"></icon></view>
  21. <view>绑定手机号</view>
  22. <view>请先绑定手机号再进行此操作</view>
  23. <button open-type='getPhoneNumber' bindgetphonenumber="getPhoneNumber">
  24. <image src='../images/showWx.png' class='iconWx'></image>微信用户一键绑定
  25. </button>
  26. </view>
  27. </view>
  28. <view wx:if='{{isShowUserInfoLayer}}'>
  29. <view class='mask_layer' />
  30. <view class='modal_box'>
  31. <view class="title">请授权获取您的用户信息</view>
  32. <view class='content'>
  33. <text class='modalMsg'>"智慧油驿站"需要获取你的用户昵称等信息</text>
  34. </view>
  35. <view class='btn1'>
  36. <view bindtap='bindCancelUserInfo' class='cancel'>取消</view>
  37. <view bindtap='bindConfirmUserInfo' class='Sure'>确定</view>
  38. </view>
  39. </view>
  40. </view>