get-user-info.wxml 1.2 KB

1234567891011121314151617181920212223242526272829
  1. <import src="../../../common/head.wxml" />
  2. <import src="../../../common/foot.wxml" />
  3. <view class="container page" data-weui-theme="{{theme}}">
  4. <template is="head" data="{{title: 'getUserInfo'}}"/>
  5. <view class="page-body">
  6. <view class="page-section">
  7. <view class="page-body-info">
  8. <view class="page-body-title">用户信息</view>
  9. <block wx:if="{{hasUserInfo === false}}">
  10. <text class="page-body-text">未获取</text>
  11. <text class="page-body-text">点击绿色按钮可获取用户头像及昵称</text>
  12. </block>
  13. <block wx:if="{{hasUserInfo === true}}">
  14. <image class="userinfo-avatar" src="{{userInfo.avatarUrl}}"></image>
  15. <text class="userinfo-nickname">{{userInfo.nickName}}</text>
  16. </block>
  17. </view>
  18. <view class="btn-area">
  19. <button wx:if="{{canIUseGetUserProfile}}" type="primary" bindtap="handleGetUserProfile"> 获取用户信息GetUserProfile</button>
  20. <button wx:else type="primary" open-type="getUserInfo" bindgetuserinfo="getUserInfo">获取用户信息getUserInfo</button>
  21. <button bindtap="clear">清空</button>
  22. </view>
  23. </view>
  24. </view>
  25. <template is="foot" />
  26. </view>