index.wxml 952 B

1234567891011121314151617181920212223
  1. <!--index.wxml-->
  2. <view class="container">
  3. <view class="userinfo">
  4. <block wx:if="{{canIUseOpenData}}">
  5. <view class="userinfo-avatar" bindtap="bindViewTap">
  6. <open-data type="userAvatarUrl"></open-data>
  7. </view>
  8. <open-data type="userNickName"></open-data>
  9. </block>
  10. <block wx:elif="{{!hasUserInfo}}">
  11. <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
  12. <button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
  13. <view wx:else> 请使用1.4.4及以上版本基础库 </view>
  14. </block>
  15. <block wx:else>
  16. <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
  17. <text class="userinfo-nickname">{{userInfo.nickName}}</text>
  18. </block>
  19. </view>
  20. <view class="usermotto">
  21. <text class="user-motto">{{motto}}</text>
  22. </view>
  23. </view>