Files
fc/dev/project/library/imports/40/4007642d-295d-4c79-b3e3-51c9449f9083.js
2026-05-24 10:21:26 +08:00

81 lines
2.2 KiB
JavaScript

"use strict";
cc._RF.push(module, '40076QtKV1MebPjUclEn5CD', 'cmp.act.startravel.order');
// Scripts/mod/acts/startravel/cmp/cmp.act.startravel.order.js
"use strict";
var BridgeWindow = require("bridge.window");
var NxExpand = require("nx.fx.sv.expand");
var Payment = require("payment.mod");
cc.Class({
"extends": BridgeWindow,
properties: {
curList: {
"default": null,
type: NxExpand
},
buyList: {
"default": null,
type: NxExpand
},
buyBtn: {
"default": null,
type: cc.Node
}
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start: function start() {},
onOpenConfigs: function onOpenConfigs(_params) {
if (_params.mod) {
this.mod = _params.mod;
} else {
this.delayClose();
return;
}
this.card_id = _params.period;
this.buy_data = null;
var list = game.configs.holiday_new_war_order_data.data_advance_card_list;
for (var i in list) {
if (list[i].period == this.card_id) {
this.buy_data = list[i];
break;
}
}
if (this.buy_data) {
var charge_data = game.configs.charge_data.data_charge_data[this.buy_data.charge_id];
var price = Payment.getInstance().fmtPrice(charge_data.val);
nx.gui.setString(this.buyBtn, "txt", cc.js.formatStr(nx.text.getKey("orderBuyPrice"), price));
}
this.refreshCurGift();
this.refreshBuyGift();
},
refreshCurGift: function refreshCurGift() {
var curLev = this.mod.getCurLev();
var exp_data = game.configs.holiday_new_war_order_data.data_lev_reward_list[this.mod.getCurPeriod()];
var list = [];
for (var i in exp_data) {
if (exp_data[i].lev > curLev && exp_data[i].lev <= curLev + 5) {
list.push(exp_data[i].reward[0]);
}
}
this.curList.rebuild(list);
},
refreshBuyGift: function refreshBuyGift() {
if (!this.buy_data) return;
var reward_list = this.buy_data.reward_2;
this.buyList.rebuild(reward_list);
},
onPreClosed: function onPreClosed() {
this.curList.rebuild([]);
this.buyList.rebuild([]);
},
onClickBuy: function onClickBuy() {
if (this.buy_data.charge_id) {
//花钱买
Payment.getInstance().reqPayment(this.buy_data.charge_id);
}
}
});
cc._RF.pop();