微信的登录授权按钮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("授权失败") } }) } }) |

请更新一下微信版本试试
微信7.0.10 小米MAX3 真机预览不能创建UserInfoButton