72 lines
1.8 KiB
JavaScript
72 lines
1.8 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'a80ed4KBlJFOaPA8QRp7iT4', 'cmp.act.upstar.hero');
|
|
// Scripts/mod/acts/upstar/cmp/cmp.act.upstar.hero.js
|
|
|
|
"use strict";
|
|
|
|
var BridgeWindow = require("bridge.window");
|
|
var FxSVC = require("nx.fx.sv.expand");
|
|
cc.Class({
|
|
"extends": BridgeWindow,
|
|
properties: {
|
|
list: {
|
|
"default": null,
|
|
type: FxSVC
|
|
}
|
|
},
|
|
// LIFE-CYCLE CALLBACKS:
|
|
onLoad: function onLoad() {},
|
|
start: function start() {},
|
|
// 重载:关闭前
|
|
onPreClosed: function onPreClosed() {
|
|
this.list.rebuild([]);
|
|
},
|
|
onOpenConfigs: function onOpenConfigs(params) {
|
|
this.plist = params.plist || [];
|
|
this.actsType = params.acts_type; //用来切换升星有礼和限时招募升星活动
|
|
this.mod = params.mod;
|
|
if (!this.mod) {
|
|
this.delayClose();
|
|
return;
|
|
}
|
|
this.list.svcKey = this.actsType;
|
|
this.list.rebuild(this.plist);
|
|
},
|
|
onFoucusSelectHero: function onFoucusSelectHero(_item) {
|
|
// 空
|
|
if (nx.dt.objEmpty(_item) || nx.dt.objEmpty(_item.mdata)) {
|
|
return;
|
|
}
|
|
|
|
// 聚焦
|
|
this.list.cleanFocus();
|
|
this.list.addFocus(_item.index);
|
|
if (_item.key == 351) {
|
|
//升星有礼
|
|
this.select_id = _item.mdata.partner_id;
|
|
} else if (_item.key == 475) {
|
|
this.select_id = _item.mdata.partner_baseid;
|
|
}
|
|
},
|
|
onClickSure: function onClickSure() {
|
|
var _this = this;
|
|
if (this.select_id) {
|
|
if (this.actsType == 351) {
|
|
//升星有礼
|
|
if (this.mod.send29202) {
|
|
this.mod.send29202(this.select_id, function () {
|
|
_this.close();
|
|
});
|
|
}
|
|
} else if (this.actsType == 475) {
|
|
if (this.mod.send29222) {
|
|
this.mod.send29222(this.select_id, function () {
|
|
_this.close();
|
|
});
|
|
}
|
|
}
|
|
}
|
|
} // update (dt) {},
|
|
});
|
|
|
|
cc._RF.pop(); |