Files
fc/dev/project/library/imports/81/8105b095-d5ed-4479-a777-634829778e7a.js
2026-05-24 10:21:26 +08:00

102 lines
3.0 KiB
JavaScript

"use strict";
cc._RF.push(module, '8105bCV1e1Eead3Y0gpd456', 'cmp.act.starorder.buy');
// Scripts/mod/acts/starorder/ui/cmp.act.starorder.buy.js
"use strict";
/******************************************************************
*
* 星界密令进阶卡
*
******************************************************************/
var BridgeWindow = require("bridge.window");
var StarorderMod = require("act.starorder.mod");
var HeroNewOrderMod = require("act.heroneworder.mod");
var NxExpand = require("nx.fx.sv.expand");
var Payment = require("payment.mod");
cc.Class({
"extends": BridgeWindow,
properties: {
list1: {
"default": null,
type: NxExpand
},
list2: {
"default": null,
type: NxExpand
},
ndBuy: {
"default": null,
type: cc.Node
},
rolePic: {
"default": null,
type: cc.Node
},
skinPic: {
"default": null,
type: cc.Node
},
heroPic: {
"default": null,
type: cc.Node
}
},
// 初始化
onLoad: function onLoad() {},
onOpenConfigs: function onOpenConfigs(_params) {
if (_params && _params.camp_id) {
if (_params.camp_id == 51178) {
//星煇密令
this.mod = HeroNewOrderMod.getInstance();
this.cfg_data = game.configs.holiday_newhero_order_data;
} else if (_params.camp_id == 1012) {
this.mod = StarorderMod.getInstance();
this.cfg_data = game.configs.holiday_star_hero_order_data;
}
this.camp_id = _params.camp_id;
}
this.setMianUI();
},
onPreClosed: function onPreClosed() {
this.list1.rebuild([]);
this.list2.rebuild([]);
if (this.camp_id == 1012) {
this.mod.send31203();
} else if (this.camp_id == 51178) {
this.mod.send31213();
}
},
setMianUI: function setMianUI() {
var period = this.mod.getPeriod();
var card_data = this.cfg_data.data_advance_card_list[period];
if (!card_data) return;
var charge_data = game.configs.charge_data.data_charge_data[card_data.charge_id];
if (!charge_data) return;
this.charge_id = charge_data.id;
this.ndBuy.active = true;
var yprice = Payment.getInstance().fmtPrice(charge_data.val);
nx.gui.setString(this.ndBuy, "txt", yprice);
this.list1.rebuild(card_data.reward_1);
this.list2.rebuild(card_data.reward_2);
var act_data = this.cfg_data.data_skin_act_list[period];
if (act_data) {
//設置皮膚圖像
this.rolePic.active = true;
this.skinPic.active = true;
var role_path = cc.js.formatStr("resDB/acts/orderskin/%s", act_data.skin_pic);
nx.gui.setSpriteFrame(this.rolePic, "", role_path);
var skin_path = cc.js.formatStr("locals/%s/images/brochure/%s", nx.getLocLanguage(), act_data.skin_name_pic);
nx.gui.setSpriteFrame(this.skinPic, "", skin_path);
} else {
this.heroPic.active = true;
}
},
onClickBuy: function onClickBuy() {
if (this.charge_id == null) return;
Payment.getInstance().reqPayment(this.charge_id);
}
});
cc._RF.pop();