LayaBox引擎as开发微信小游戏,拉授权,createUserInfoButton

__JS__('wx').login({

                timeout:10000,

                success:function success(res:Object):void{

                    // Model.WX_LOGIN_CODE = res.code;

                    trace("-------------登录成功--------------" + res.code);

 

                    var btn:* = __JS__('wx').createUserInfoButton(

                        {

                            type: 'text',

                            text: '点击进入游戏',

                            style:

                            {

                                left: 100,

                                bottom: 200,

                                width: 140,

                                height: 40,

                                lineHeight: 40,

                                backgroundColor: '#ff0000',

                                color: '#ffffff',

                                textAlign: 'center',

                                fontSize: 16,

                                borderRadius: 4

                            }

                        }

                    );

                    trace(btn);

                    btn.onTap(function aaa(res):void

                    {

                        trace("1111");

                        trace(res);

                    })

                },

                fail:function fail():void{

                    trace("-------------登录失败--------------");

                },

                complete:function complete():void{

                    trace("-------------complete--------------");

                }

            });

你可能感兴趣的:(layabox)