forked from xwartz/wechat-app-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-user-info.wxml
executable file
·28 lines (25 loc) · 1.04 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
<import src="../common/header.wxml" />
<import src="../common/footer.wxml" />
<view class="container">
<template is="header" data="{{title: 'getUserInfo'}}"/>
<view class="page-body">
<view class="page-body-wrapper">
<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}}">
<wx-image class="userinfo-avatar" src="{{userInfo.avatarUrl}}"></wx-image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
<view class="page-body-buttons">
<button class="page-body-button" type="primary" bindtap="getUserInfo">获取用户信息</button>
<button class="page-body-button" bindtap="clear">清空</button>
</view>
</view>
</view>
<template is="footer" />
</view>