"use strict"; cc._RF.push(module, '36afbODhKtLmbCwZwDljEoe', 'cmp.act.stepup'); // Scripts/mod/acts/stepup/cmp/cmp.act.stepup.js "use strict"; /****************************************************************** * Copyright(C) 2019 - 2020 Nx Studio * * STEP-UP 召唤主界面 * ******************************************************************/ var ActPage = require("act.page.base"); var SummonDefine = require("summon.define"); var STModel = require("act.stepup.mod"); var BridgeItemBinder = require("bridge.binder.item.icon.count"); var Stage = SummonDefine.StepUpStage; cc.Class({ "extends": ActPage, properties: { nodCoin: { "default": null, type: BridgeItemBinder }, nodScore: { "default": null, type: BridgeItemBinder } }, // 初始化 build: function build(_data) { var _this = this; this._super(_data); // 置空 this.setStage(Stage.Empty); // 请求数据 STModel.getInstance().fetchData(function (_ret, _data) { if (!_ret) { nx.tbox(_data); return; } _this.setStage(_data.state); // 耗材绑定 _this.bindCost(); }); }, // 阶段设置 setStage: function setStage(_stage) { var configs = STModel.getInstance().getConfig(); if (!configs) { _stage = Stage.Empty; } // nx.gui.setActive( this, "panel/open", _stage == Stage.Open || _stage == Stage.Complete ); }, // 耗材绑定 bindCost: function bindCost() { // 不展示 var data = STModel.getInstance().getData(); if (data.state != Stage.Open) { nx.gui.setActive(this.nodCoin, "", false); return; } nx.gui.setActive(this.nodCoin, "", true); var cfgs = STModel.getInstance().getConfig(); if (cfgs) { var item = cfgs.steps[0].item_show; this.nodCoin.setID(item[0]); } // 积分 var DATA = game.configs.step_up_recruit_data; if (this.nodScore && DATA) { var score = DATA.data_const.score_id; this.nodScore.setID(score.val); } } }); cc._RF.pop();