利用豆瓣api写个小程序(小程序笔记)4 获取用户信息

1 简单的获取用户信息

<open-data type='userAvatarUrl'></open-data>
<open-data type="userNickName"> </open-data>

https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html 其他内容可以到小程序的开发文档上找

2 按钮形式获取

<button open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">获取用户信息</button>
  bindGetUserInfo:function(event){
    console.log(event);
  },

点击按钮 就能获得用户的信息

原文地址:https://www.cnblogs.com/polax/p/11593170.html