index.wxml 667 B

123456789101112131415
  1. <!--index.wxml-->
  2. <view class="container">
  3. <view class="userinfo">
  4. <!-- 点了之后就会调用wx.getUserInfo, 随后调用bindGetUserInfo -->
  5. <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo"> 点击登录 </button>
  6. <!-- <button wx:if="{{true}}" bindtap='login'> 点击登录 </button> -->
  7. <block wx:else>
  8. <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
  9. <text class="userinfo-nickname">{{userInfo.nickName}}</text>
  10. </block>
  11. </view>
  12. <view class="usermotto">
  13. <text class="user-motto">{{motto}}</text>
  14. </view>
  15. </view>