| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // Learn cc.Class:
- // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
- // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
- // Learn Attribute:
- // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
- // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
- // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
- cc.Class({
- extends: cc.Component,
- properties: {
- // foo: {
- // // ATTRIBUTES:
- // default: null, // The default value will be used only when the component attaching
- // // to a node for the first time
- // type: cc.SpriteFrame, // optional, default is typeof default
- // serializable: true, // optional, default is true
- // },
- // bar: {
- // get () {
- // return this._bar;
- // },
- // set (value) {
- // this._bar = value;
- // }
- // },
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- utils.isMobile(function () {
- Manager.Multimain = this;
- Manager.sceneType = 2;
- }.bind(this));
- //分享
- let sharelayout = this.sharelayout = UtilsPrefabs.getNode("sharelayout", this.node);
- //结算
- let Settlementlayout = this.Settlementlayout = UtilsPrefabs.getNode("Settlementlayout", this.node);
- //排行榜
- let ranklist = this.ranklist = UtilsPrefabs.getNode("ranklist", this.node);
- sharelayout.active = false;
- Settlementlayout.active = false;
- ranklist.active = false;
- this.layoutarr = [];
- this.layoutarr.push(sharelayout);
- this.layoutarr.push(Settlementlayout);
- this.layoutarr.push(ranklist);
- this.setShow(0);
- this.initListeniner();
- this._init();
- },
- _init : function(){
- // utils.redytoLoadScene("main");
- // console.log("用户信息是"+UserInfo);
- // console.log("用户信息是",UserInfo);
- },
- initListeniner : function(){
- this.sharelayout.getComponent("sharelayoutManager").setShareButtonClickListeniner(function () {
- // this.setShow(1);
- }.bind(this));
- this.sharelayout.getComponent("sharelayoutManager").setShareButtonClickcloseListeniner(function () {
- this.setShow(1);
- utils.isMobile(function () {
- Manager.sceneType = 3;
- }.bind(this));
- }.bind(this));
- this.Settlementlayout.getComponent("SettlementlayoutManager").setmoreButtonClickListeniner(function () {
- this.setShow(2);
- utils.isMobile(function () {
- Manager.sceneType = 4;
- }.bind(this));
- }.bind(this));
- this.ranklist.getComponent("ranklistManager").setbackButtonClickListeniner(function () {
- this.setShow(1);
- utils.isMobile(function () {
- Manager.sceneType = 3;
- }.bind(this));
- }.bind(this));
- },
- setShow : function (number) {
- for (var i = 0; i < this.layoutarr.length; i++) {
- this.layoutarr[i].active = false;
- }
- this.layoutarr[number].active = true;
- }
- // update (dt) {},
- });
|