152 lines
6.3 KiB
JavaScript
152 lines
6.3 KiB
JavaScript
System.register(["__unresolved_0", "cc", "__unresolved_1"], function (_export, _context) {
|
|
"use strict";
|
|
|
|
var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, Prefab, instantiate, director, dwebAjax, _dec, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _dec2, _dec3, _dec4, _class4, _class5, _descriptor6, _descriptor7, _crd, ccclass, property, ReItem, ReItemList;
|
|
|
|
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
|
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
|
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
|
|
|
|
function _reportPossibleCrUseOfdwebAjax(extras) {
|
|
_reporterNs.report("dwebAjax", "../ajax", _context.meta, extras);
|
|
}
|
|
|
|
return {
|
|
setters: [function (_unresolved_) {
|
|
_reporterNs = _unresolved_;
|
|
}, function (_cc) {
|
|
_cclegacy = _cc.cclegacy;
|
|
__checkObsolete__ = _cc.__checkObsolete__;
|
|
__checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
|
|
_decorator = _cc._decorator;
|
|
Component = _cc.Component;
|
|
Prefab = _cc.Prefab;
|
|
instantiate = _cc.instantiate;
|
|
director = _cc.director;
|
|
}, function (_unresolved_2) {
|
|
dwebAjax = _unresolved_2.default;
|
|
}],
|
|
execute: function () {
|
|
_crd = true;
|
|
|
|
_cclegacy._RF.push({}, "6594d5AOkVPH7rOFoiU+2tJ", "ReItemList", undefined);
|
|
|
|
__checkObsolete__(['_decorator', 'Component', 'Node', 'Prefab', 'instantiate', 'director']);
|
|
|
|
({
|
|
ccclass,
|
|
property
|
|
} = _decorator); // import { ItemTemplate } from "../ItemTemplate";
|
|
|
|
_export("ReItem", ReItem = (_dec = ccclass("ReItem"), _dec(_class = (_class2 = class ReItem {
|
|
constructor() {
|
|
_initializerDefineProperty(this, "bctype", _descriptor, this);
|
|
|
|
_initializerDefineProperty(this, "num", _descriptor2, this);
|
|
|
|
_initializerDefineProperty(this, "type", _descriptor3, this);
|
|
|
|
_initializerDefineProperty(this, "price", _descriptor4, this);
|
|
|
|
_initializerDefineProperty(this, "time", _descriptor5, this);
|
|
}
|
|
|
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "bctype", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return "";
|
|
}
|
|
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "num", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return "";
|
|
}
|
|
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "type", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return "";
|
|
}
|
|
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "price", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return "";
|
|
}
|
|
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "time", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return "";
|
|
}
|
|
})), _class2)) || _class));
|
|
|
|
_export("ReItemList", ReItemList = (_dec2 = ccclass("ReItemList"), _dec3 = property([ReItem]), _dec4 = property(Prefab), _dec2(_class4 = (_class5 = class ReItemList extends Component {
|
|
constructor(...args) {
|
|
super(...args);
|
|
|
|
_initializerDefineProperty(this, "items", _descriptor6, this);
|
|
|
|
_initializerDefineProperty(this, "itemPrefab", _descriptor7, this);
|
|
}
|
|
|
|
async onLoad() {
|
|
let data = {};
|
|
(_crd && dwebAjax === void 0 ? (_reportPossibleCrUseOfdwebAjax({
|
|
error: Error()
|
|
}), dwebAjax) : dwebAjax).sendAjax("/api/v1/recharge", data, "POST", async res => {
|
|
if (res.code == "200" && res.data.items) {
|
|
// this.items = res.data.items;
|
|
for (let i = 0; i < this.items.length; i++) {
|
|
const item = instantiate(this.itemPrefab);
|
|
const data = res.data.items[i];
|
|
console.log(data);
|
|
this.node.addChild(item);
|
|
item.getComponent("ItemTemplate").init(data);
|
|
}
|
|
} else if (res.code == "10001") {
|
|
console.log("登录失效");
|
|
director.loadScene("login");
|
|
} else {
|
|
console.log(res);
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
start() {}
|
|
|
|
update(deltaTime) {}
|
|
|
|
}, (_descriptor6 = _applyDecoratedDescriptor(_class5.prototype, "items", [_dec3], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return [];
|
|
}
|
|
}), _descriptor7 = _applyDecoratedDescriptor(_class5.prototype, "itemPrefab", [_dec4], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
})), _class5)) || _class4));
|
|
|
|
_cclegacy._RF.pop();
|
|
|
|
_crd = false;
|
|
}
|
|
};
|
|
});
|
|
//# sourceMappingURL=4dff20ea6236fb7463e474f656e8dc082ed9fbb7.js.map
|