wxml:<view class=”Box”><image class=”avatar” src=”{{userInfo.avatarUrl}}”></image><text>{{userInfo.nickName}}</text><button size=”mini” type=”primary” plain=”true” loading=”true” open-type=”getUserInfo” bindgetuserinfo=”getUserInfo”>获取用户信息</button></view>open-type=”getUserInfo”:getUserInfo获取用户信息bindgetuserinfo=”getUserInfo”:用户点击该按钮时会返回获取到的用户信息,回调的detail数据与wx.getUserInfo返回的一致wxss:.Box{display: flex;flex-direction: column;justify-content: center;align-items: center;width: 100%;}.avatar{width: 200rpx;height: 200rpx;margin-top: 250rpx;}.Box text{margin-top: 250rpx;}.Box button{margin-top: 250rpx;}js:data: {userInfo: null,},/* 获取用户信息 */getUserInfo(res) { console.log(res); this.setData({userInfo: res.detail.userInfo })}, 小程序
小程序手动获取用户信息
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 小程序手动获取用户信息
相关推荐
Linux之Shell小程序(持续更新中)
数据恢复软件(二):用C++重写恢复B乐都县E企盈小程序MP位图文件的小程序
公众号再次改版高坪区E企盈小程序小程序又多了一个入口
微信小程序加载图片时,湘桥区E企盈小程序先拉长,再恢复正常
转:(很有用)有多个按钮,点击一个变色,点击另吴中区E企盈小程序一个变色,原来的恢复颜色的方法
第12课微信小程序Component构造器自道里区E企盈小程序定义组件:
导航中的南海区E企盈小程序小竖线总结
小程序:after实现德格县E企盈小程序1px纵向分割线
汉沽区E企盈小程序企业微信内测朋友圈和客户群功能:小程序C位出道!
小程序运行加载密山市E企盈小程序机制
小程通城县E企盈小程序序中间有字的分隔线
公众号和小程序可以同名了名称支持同主体复盘锦E企盈小程序用
最新评论
独特万商直播系统,直播系统技术开发公司
万商直播系统开发公司
优秀的团队,万商直播管理系统
不错的小程序案例
优秀的团队,不错的服务!
讲的很好
主播长的帅气
好系统好服务