| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- // 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 () {
- let Canvas = cc.find("Canvas");
- //结算
- // this.Settlement = UtilsNode.getNode("Settlement",Canvas);
- //分享
- // this.share = UtilsNode.getNode("share",Canvas);
- //排行榜
- this.rankList = UtilsNode.getNode("ranklist",Canvas);
- //新的结算分享
- this.ReportActivity = UtilsNode.getNode("ReportActivity",Canvas);
- this.ReportActivitymanagec = this.ReportActivity.getComponent('ReportActivitymanage');
- // this.Settlement.getComponent("Settlement").setClickListeniner(function () {
- //
- // }.bind(this));
- this.initArrLayou();
- this.switchLayou(0);
- this.initListeniner();
- },
- start () {
- },
- initListeniner(){
- // this.Settlementomponent = this.Settlement.getComponent("Settlement");
- // this.Settlementomponent.setCallbackRestGame(function () {
- // utils.toLoadScene("game")
- // }.bind(this));
- // this.Settlementomponent.setCallbackShare(function () {
- // this.switchLayou(1);
- // }.bind(this));
- // this.Settlementomponent.setCallbackRanklist(function () {
- // this.switchLayou(2);
- // }.bind(this));
- //
- // this.shareComponent = this.share.getComponent("share");
- // this.shareComponent.setCallbackGoshare (function () {
- //
- // var qc = UtilsNode.getNode("qc",this.share);
- // qc.active = true;
- // this.shareComponent.captureScreenshot(function () {
- // // Log.info("去分享 base64",ShareImage.img);
- // qc.active = false;
- // utils.isMobile(function () {
- // manager_android_js.clickShare();
- // }.bind(this))
- // }.bind(this));
- // }.bind(this))
- // this.shareComponent.setCallbackShareback (function () {
- // this.switchLayou(0);
- // }.bind(this))
- this.rankListComponent = this.rankList.getComponent("ranklistManager");
- this.rankListComponent.setbackButtonClickListeniner(function () {
- this.switchLayou(0);
- }.bind(this))
- //todo-----------------------------------------------------------------------------------------------
- //新的
- this.ReportActivitymanagec.setResetgamesListner(function () {
- Log.info('重新开始游戏');
- utils.toLoadScene("game")
- }.bind(this));
- this.ReportActivitymanagec.setToshareListner(function () {
- // Log.info('去分享');
- this.ReportActivitymanagec.optionAndqc(1);
- this.ReportActivitymanagec.captureScreenshot(function () {
- // Log.info("去分享 base64",ShareImage.img);
- this.ReportActivitymanagec.optionAndqc(0);
- utils.isMobile(function () {
- manager_android_js.clickShare();
- }.bind(this))
- }.bind(this))
- }.bind(this));
- this.ReportActivitymanagec.setGotoRanklistListner(function () {
- Log.info('去看排行榜');
- this.switchLayou(1);
- }.bind(this));
- //todo-----------------------------------------------------------------------------------------------
- },
- //初始化 三个 界面的数组
- initArrLayou(){
- this.arrLayou = [];
- this.arrLayou.push(this.ReportActivity);
- // this.arrLayou.push(this.share);
- this.arrLayou.push(this.rankList);
- },
- switchLayou(type){
- for (var i = 0; i < this.arrLayou.length; i++) {
- this.arrLayou[i].active = false;
- }
- this.arrLayou[type].active = true;
- }
- // update (dt) {},
- });
|