-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Copy pathget-user-info.wxml
29 lines (26 loc) · 1.18 KB
/
get-user-info.wxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<import src="/common/head.wxml" />
<import src="/common/foot.wxml" />
<view class="container page" data-weui-theme="{{theme}}">
<template is="head" data="{{title: 'getUserInfo'}}"/>
<view class="page-body">
<view class="page-section">
<view class="page-body-info">
<view class="page-body-title">用户信息</view>
<block wx:if="{{hasUserInfo === false}}">
<text class="page-body-text">未获取</text>
<text class="page-body-text">点击绿色按钮可获取用户头像及昵称</text>
</block>
<block wx:if="{{hasUserInfo === true}}">
<image class="userinfo-avatar" src="{{userInfo.avatarUrl}}"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
<view class="btn-area">
<button wx:if="{{canIUseGetUserProfile}}" type="primary" bindtap="handleGetUserProfile"> 获取用户信息GetUserProfile</button>
<button wx:else type="primary" open-type="getUserInfo" bindgetuserinfo="getUserInfo">获取用户信息getUserInfo</button>
<button bindtap="clear">清空</button>
</view>
</view>
</view>
<template is="foot" />
</view>