Files
fc/dev/project/library/imports/74/74038733-1c99-4381-b045-f261c1a00b1f.js
T
2026-05-24 10:21:26 +08:00

78 lines
1.8 KiB
JavaScript

"use strict";
cc._RF.push(module, '74038czHJlDgbBF8mHBoAsf', 'cmp.guild.reqlist.wnd');
// Scripts/mod/guild/base/cmps/cmp.guild.reqlist.wnd.js
"use strict";
/******************************************************************
*
* 联盟秘境
*
******************************************************************/
var FxSVC = require("nx.fx.sv.expand");
var BridgeWindow = require("bridge.window");
var GuildController = require("guild_controller");
// 单页数量
var CPP = 15;
cc.Class({
"extends": BridgeWindow,
properties: {
svcList: {
"default": null,
type: FxSVC
},
nodPages: {
"default": null,
type: cc.Node
}
},
// 显示
onEnable: function onEnable() {
this.ctrl = GuildController.getInstance();
this.model = this.ctrl.getModel();
// 初始化
this.curPage = 0;
this.maxPage = 0;
this.setPage(1);
},
onDisable: function onDisable() {
if (nx.bridge.prompt) {
nx.bridge.prompt.delPrompt(4);
}
},
// 设置当前页
setPage: function setPage(_page, _force) {
var _this = this;
// 重复
if (!_force && _page == this.curPage) {
return;
}
this.ctrl.reqApplyJoinList(_page, CPP, function (_ret, _data) {
if (!_ret) {
nx.tbox(_data);
return;
}
_this.curPage = Math.min(_data.page, _data.page_total);
_this.maxPage = _data.page_total;
nx.gui.setString(_this.nodPages, "txt", _this.curPage + "/" + _this.maxPage);
_this.svcList.rebuild(_data.guids);
});
},
// 换页
onTogPage: function onTogPage(_key) {
var inc = _key == "+";
var page = this.curPage + (inc ? 1 : -1);
if (page < 1) {
page = 1;
}
if (page > this.maxPage) {
page = this.maxPage;
}
this.setPage(page);
}
});
cc._RF.pop();