【小游戏】wx.createUserInfoButton在ios真机上图片不显示
wx.createUserInfoButton当其 type:'image’时,在ios真机上有时候什么都不显示,有时候又会显示;微信app已经都是最新版了,我目前还没用总结出这个bug的规律,希望官方重视一下。
var button = wx.createUserInfoButton({ type: 'image' , text: '微信授权' , image: "resource/assets_game/main/button_wx_getuserinfo.png" , style: { left: left, top: sysInfo.windowHeight - bottom - 62, width: 150, height: 50, lineHeight: 40, backgroundColor: '#ff0000' , color: '#ffffff' , textAlign: 'center' , fontSize: 16, borderRadius: 4 } }); button.onTap((res) => { console.log( "用户授权:" , res); var userInfo = res.userInfo; if (userInfo) { var nickName = userInfo.nickName; var avatarUrl = userInfo.avatarUrl; var gender = userInfo.gender; //性别 0:未知、1:男、2:女 var province = userInfo.province; var city = userInfo.city; var country = userInfo.country; button.destroy(); resolve(userInfo); } }); |