微信7.0.10 小米MAX3 真机预览不能创建UserInfoButton
微信小游戏部分安卓机型的授权按钮createUserInfoButton不显示微信的登录授权按钮createUserInfoButton()在部分安卓机型不显示,并且在微信版本更新到最新版之后仍无法显示,IOS目前并没有出现这个问题,开发者工具预览也没出现。望官方解决一下~ [代码]//微信的登录授权接口 /*[代码][代码] [代码][代码]wx.login({[代码][代码] [代码][代码]success: (res) => {[代码][代码] [代码][代码]if[代码] [代码](res.code) {[代码][代码] [代码][代码]var[代码] [代码]code = res.code;[代码][代码] [代码][代码]this[代码][代码].visible = [代码][代码]true[代码][代码];[代码][代码] [代码][代码]console.log([代码][代码]"登录成功"[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]button = wx.createUserInfoButton([代码][代码] [代码][代码]{[代码][代码] [代码][代码]type: [代码][代码]'text'[代码][代码],[代码][代码] [代码][代码]text: [代码][代码]'开始游戏'[代码][代码],[代码][代码] [代码][代码]style:[代码][代码] [代码][代码]{[代码][代码] [代码][代码]left: wx.getSystemInfoSync().windowWidth / 2 - 70,[代码][代码] [代码][代码]top: wx.getSystemInfoSync().windowHeight / 2 + 90,[代码][代码] [代码][代码]width: 140,[代码][代码] [代码][代码]height: 40,[代码][代码] [代码][代码]lineHeight: 40,[代码][代码] [代码][代码]backgroundColor: [代码][代码]'#5151A2'[代码][代码],[代码][代码] [代码][代码]color: [代码][代码]'#E6E6F2'[代码][代码],[代码][代码] [代码][代码]textAlign: [代码][代码]'center'[代码][代码],[代码][代码] [代码][代码]fontSize: 18,[代码][代码] [代码][代码]borderRadius: 4[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]button.onTap((res) => {[代码][代码] [代码][代码]if[代码][代码]([代码][代码]this[代码][代码].soundRun==[代码][代码]true[代码][代码]){[代码][代码] [代码][代码]laya.media.SoundManager.playSound([代码][代码]"res/sound/di.mp3"[代码][代码],1);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](res.errMsg == [代码][代码]"getUserInfo:ok"[代码][代码]) {[代码][代码] [代码][代码]//获取到用户信息[代码][代码] [代码][代码]this[代码][代码].startClick();[代码][代码] [代码][代码]button.destroy();[代码][代码] [代码][代码]}[代码][代码] [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]console.log([代码][代码]"授权失败"[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码]
2020-01-18