300 lines
12 KiB
JavaScript
300 lines
12 KiB
JavaScript
System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7"], function (_export, _context) {
|
|
"use strict";
|
|
|
|
var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, director, Prefab, rachageModel, rechargeNum, dwebAjax, TBG, tanchuan, WithdrawalView, WhView, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _crd, ccclass, property, ETH_CONTRACT, NewComponent;
|
|
|
|
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 _reportPossibleCrUseOfrachageModel(extras) {
|
|
_reporterNs.report("rachageModel", "./rachageModel", _context.meta, extras);
|
|
}
|
|
|
|
function _reportPossibleCrUseOfrechargeNum(extras) {
|
|
_reporterNs.report("rechargeNum", "./RechageNum", _context.meta, extras);
|
|
}
|
|
|
|
function _reportPossibleCrUseOfdwebAjax(extras) {
|
|
_reporterNs.report("dwebAjax", "./ajax", _context.meta, extras);
|
|
}
|
|
|
|
function _reportPossibleCrUseOfTBG(extras) {
|
|
_reporterNs.report("TBG", "./tgb/tbg", _context.meta, extras);
|
|
}
|
|
|
|
function _reportPossibleCrUseOftanchuan(extras) {
|
|
_reporterNs.report("tanchuan", "./TanChuang", _context.meta, extras);
|
|
}
|
|
|
|
function _reportPossibleCrUseOfWithdrawalView(extras) {
|
|
_reporterNs.report("WithdrawalView", "./Withdrawal/WithdrawalView", _context.meta, extras);
|
|
}
|
|
|
|
function _reportPossibleCrUseOfWhView(extras) {
|
|
_reporterNs.report("WhView", "./Withdrawal/WhView", _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;
|
|
director = _cc.director;
|
|
Prefab = _cc.Prefab;
|
|
}, function (_unresolved_2) {
|
|
rachageModel = _unresolved_2.rachageModel;
|
|
}, function (_unresolved_3) {
|
|
rechargeNum = _unresolved_3.rechargeNum;
|
|
}, function (_unresolved_4) {
|
|
dwebAjax = _unresolved_4.default;
|
|
}, function (_unresolved_5) {
|
|
TBG = _unresolved_5.default;
|
|
}, function (_unresolved_6) {
|
|
tanchuan = _unresolved_6.tanchuan;
|
|
}, function (_unresolved_7) {
|
|
WithdrawalView = _unresolved_7.WithdrawalView;
|
|
}, function (_unresolved_8) {
|
|
WhView = _unresolved_8.WhView;
|
|
}],
|
|
execute: function () {
|
|
_crd = true;
|
|
|
|
_cclegacy._RF.push({}, "f1ef2cIlPRMf7DqznSUmC33", "NewComponent", undefined);
|
|
|
|
__checkObsolete__(['_decorator', 'Component', 'Node', 'director', 'Prefab', 'NodeEventType']);
|
|
|
|
({
|
|
ccclass,
|
|
property
|
|
} = _decorator);
|
|
ETH_CONTRACT = "0xaC893B498E2005Af4cb8b03D710F187EC23a8f5f";
|
|
|
|
_export("NewComponent", NewComponent = (_dec = ccclass("NewComponent"), _dec2 = property(Prefab), _dec3 = property(_crd && rachageModel === void 0 ? (_reportPossibleCrUseOfrachageModel({
|
|
error: Error()
|
|
}), rachageModel) : rachageModel), _dec4 = property(_crd && rechargeNum === void 0 ? (_reportPossibleCrUseOfrechargeNum({
|
|
error: Error()
|
|
}), rechargeNum) : rechargeNum), _dec5 = property(_crd && tanchuan === void 0 ? (_reportPossibleCrUseOftanchuan({
|
|
error: Error()
|
|
}), tanchuan) : tanchuan), _dec6 = property(_crd && WithdrawalView === void 0 ? (_reportPossibleCrUseOfWithdrawalView({
|
|
error: Error()
|
|
}), WithdrawalView) : WithdrawalView), _dec7 = property(_crd && WhView === void 0 ? (_reportPossibleCrUseOfWhView({
|
|
error: Error()
|
|
}), WhView) : WhView), _dec(_class = (_class2 = class NewComponent extends Component {
|
|
constructor(...args) {
|
|
super(...args);
|
|
this.username = null;
|
|
|
|
_initializerDefineProperty(this, "itemPrefab", _descriptor, this);
|
|
|
|
_initializerDefineProperty(this, "model", _descriptor2, this);
|
|
|
|
_initializerDefineProperty(this, "bctype", _descriptor3, this);
|
|
|
|
_initializerDefineProperty(this, "rechargenum", _descriptor4, this);
|
|
|
|
_initializerDefineProperty(this, "Tanchuan", _descriptor5, this);
|
|
|
|
_initializerDefineProperty(this, "WithdrawalView", _descriptor6, this);
|
|
|
|
_initializerDefineProperty(this, "WhView", _descriptor7, this);
|
|
}
|
|
|
|
start() {
|
|
const tbg = new (_crd && TBG === void 0 ? (_reportPossibleCrUseOfTBG({
|
|
error: Error()
|
|
}), TBG) : TBG)({});
|
|
tbg.on("accountChange", () => {
|
|
console.log("用户切换");
|
|
director.loadScene("login");
|
|
}); //计时器
|
|
// this.schedule(function() {
|
|
// this.doSomething();
|
|
// }, 5);
|
|
} //获取充值比例
|
|
|
|
|
|
async takeWhData() {
|
|
let data = {};
|
|
(_crd && dwebAjax === void 0 ? (_reportPossibleCrUseOfdwebAjax({
|
|
error: Error()
|
|
}), dwebAjax) : dwebAjax).sendAjax("/api/v1/withdrawal/get", data, "POST", async res => {
|
|
if (res.code == "200") {
|
|
console.log("提现记录为", res.data);
|
|
} else if (res.code == "10001") {
|
|
console.log("登录失效");
|
|
director.loadScene("login");
|
|
} else {
|
|
console.log(res);
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
OpWhView() {
|
|
this.WhView.node.active = true;
|
|
}
|
|
|
|
onload() {}
|
|
|
|
async createNft() {
|
|
const tbg = new (_crd && TBG === void 0 ? (_reportPossibleCrUseOfTBG({
|
|
error: Error()
|
|
}), TBG) : TBG)({});
|
|
const account = await tbg.login();
|
|
const res2 = await tbg.createNft({
|
|
contract: ETH_CONTRACT,
|
|
from: account,
|
|
assetId: "1"
|
|
});
|
|
console.log(res2);
|
|
} //充值
|
|
|
|
|
|
recharge() {
|
|
this.model.node.active = true;
|
|
}
|
|
|
|
rechargeNum() {
|
|
if (this.rechargenum.node.active = true) {
|
|
this.rechargenum.node.active = false;
|
|
} else {
|
|
this.rechargenum.node.active = true;
|
|
}
|
|
}
|
|
|
|
setTanChuang() {
|
|
if (this.Tanchuan.node.active = true) {
|
|
this.Tanchuan.node.active = false;
|
|
} else {
|
|
this.Tanchuan.node.active = true;
|
|
}
|
|
} //获取充值记录
|
|
|
|
|
|
async getRechargeNew() {
|
|
let data = {};
|
|
this.WithdrawalView.node.active = true;
|
|
await (_crd && dwebAjax === void 0 ? (_reportPossibleCrUseOfdwebAjax({
|
|
error: Error()
|
|
}), dwebAjax) : dwebAjax).sendAjax("/api/v1/recharge", data, "POST", async res => {
|
|
if (res.code == "200") {
|
|
console.log("充值记录为", res.data);
|
|
} else if (res.code == "10001") {
|
|
console.log("登录失效");
|
|
director.loadScene("login");
|
|
} else {
|
|
console.log(res);
|
|
return;
|
|
}
|
|
});
|
|
} //登录
|
|
|
|
|
|
async login() {
|
|
const tbg = new (_crd && TBG === void 0 ? (_reportPossibleCrUseOfTBG({
|
|
error: Error()
|
|
}), TBG) : TBG)({});
|
|
let data = {};
|
|
let hash = null;
|
|
await (_crd && dwebAjax === void 0 ? (_reportPossibleCrUseOfdwebAjax({
|
|
error: Error()
|
|
}), dwebAjax) : dwebAjax).sendAjax("/api/v1/get/sign", data, "GET", async res => {
|
|
if (res.code == "200") {
|
|
console.log(res);
|
|
hash = res.data;
|
|
data["hash"] = hash;
|
|
const account = await tbg.login();
|
|
const res2 = await tbg.sign({
|
|
hash
|
|
}); // let SignData = TBG.sign;
|
|
|
|
console.log(res2);
|
|
data["sign"] = res2.sign;
|
|
await (_crd && dwebAjax === void 0 ? (_reportPossibleCrUseOfdwebAjax({
|
|
error: Error()
|
|
}), dwebAjax) : dwebAjax).sendAjax("/api/v1/user/login", data, "POST", res => {
|
|
if (res.code == "200") {
|
|
director.loadScene("main");
|
|
let token = res.data.token;
|
|
let adder = res.data.adder;
|
|
localStorage.setItem("token", token);
|
|
localStorage.setItem("adder", adder);
|
|
} else {
|
|
console.log(res);
|
|
return;
|
|
}
|
|
});
|
|
} else {
|
|
console.log(res);
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
update(deltaTime) {}
|
|
|
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "itemPrefab", [_dec2], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "model", [_dec3], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "bctype", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "rechargenum", [_dec4], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "Tanchuan", [_dec5], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "WithdrawalView", [_dec6], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "WhView", [_dec7], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
})), _class2)) || _class));
|
|
|
|
_cclegacy._RF.pop();
|
|
|
|
_crd = false;
|
|
}
|
|
};
|
|
});
|
|
//# sourceMappingURL=52ee1bb2a04d1fa1274277659104cc832ffdbcd9.js.map
|