"use strict";
cc._RF.push(module, '05e9f1EiV9DqKP0earTWhpP', 'lanuch');
// lanuch.js

"use strict";

cc.Class({
    extends: cc.Component,

    properties: {
        display: cc.Node,
        userName: cc.Label,
        userIcon: cc.Sprite
    },

    start: function start() {
        this._isShow = true;
        this._show = cc.moveTo(0.5, 0, 110);
        this._hide = cc.moveTo(0.5, 0, 1000);

        wx.getUserInfo({
            success: function success(res) {
                console.log('success: ', res.rawData);
                var userInfo = res.userInfo;
                var nickName = userInfo.nickName;
                var avatarUrl = userInfo.avatarUrl;
                wx.postMessage({
                    nickName: nickName,
                    avatarUrl: avatarUrl
                });
            },
            fail: function fail(res) {
                console.log(res);
            }
        });
    },
    onClick: function onClick() {
        this._isShow = !this._isShow;
        if (this._isShow) {
            this.display.runAction(this._show);
        } else {
            this.display.runAction(this._hide);
        }
    },

    testClick: function testClick() {
        console.log("test click");
    }
});

cc._RF.pop();