55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '4dab2gEbpdEMqJDSUV+Mdjl', 'cmp.act.optional.select');
|
||
|
|
// Scripts/mod/acts/optionalparty/cmp/cmp.act.optional.select.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.camp = params.camp;
|
||
|
|
this.plist = params.plist || [];
|
||
|
|
this.mod = params.mod;
|
||
|
|
if (!this.mod) {
|
||
|
|
this.delayClose();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
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);
|
||
|
|
this.select_id = _item.mdata.partner_id;
|
||
|
|
},
|
||
|
|
onClickSure: function onClickSure() {
|
||
|
|
var _this = this;
|
||
|
|
if (this.select_id) {
|
||
|
|
this.mod.reqSetOptionalParty(this.camp, this.select_id, function () {
|
||
|
|
_this.close();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
} // update (dt) {},
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|