get-user-info.wxml 1.0 KB

12345678910111213141516171819202122232425262728
  1. <import src="../../../common/head.wxml" />
  2. <import src="../../../common/foot.wxml" />
  3. <view class="container">
  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 type="primary" open-type="getUserInfo" bindgetuserinfo="getUserInfo">获取用户信息</button>
  20. <button bindtap="clear">清空</button>
  21. </view>
  22. </view>
  23. </view>
  24. <template is="foot" />
  25. </view>