190 lines
8.1 KiB
JavaScript
190 lines
8.1 KiB
JavaScript
System.register(["__unresolved_0", "cc", "__unresolved_1", "bignumber.js", "__unresolved_2"], function (_export, _context) {
|
|
"use strict";
|
|
|
|
var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, EditBox, Label, rachageModel, BigNumber, TBG, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _crd, ccclass, property, ETH_CONTRACT, rechargeNum;
|
|
|
|
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 _reportPossibleCrUseOfBigNumber(extras) {
|
|
_reporterNs.report("BigNumber", "bignumber.js", _context.meta, extras);
|
|
}
|
|
|
|
function _reportPossibleCrUseOfTBG(extras) {
|
|
_reporterNs.report("TBG", "./tgb", _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;
|
|
EditBox = _cc.EditBox;
|
|
Label = _cc.Label;
|
|
}, function (_unresolved_2) {
|
|
rachageModel = _unresolved_2.rachageModel;
|
|
}, function (_bignumberJs) {
|
|
BigNumber = _bignumberJs.default;
|
|
}, function (_unresolved_3) {
|
|
TBG = _unresolved_3.default;
|
|
}],
|
|
execute: function () {
|
|
_crd = true;
|
|
|
|
_cclegacy._RF.push({}, "46eadJwItZJGYB5TfwbBK+G", "RechageNum", undefined);
|
|
|
|
__checkObsolete__(['_decorator', 'Component', 'Node', 'EditBox', 'Label', 'loader']);
|
|
|
|
({
|
|
ccclass,
|
|
property
|
|
} = _decorator);
|
|
ETH_CONTRACT = "0x3865194cD048f7b14b465a96907fB6546B888216";
|
|
|
|
_export("rechargeNum", rechargeNum = (_dec = ccclass("rechargeNum"), _dec2 = property(Label), _dec3 = property(Label), _dec4 = property(Label), _dec5 = property(_crd && rachageModel === void 0 ? (_reportPossibleCrUseOfrachageModel({
|
|
error: Error()
|
|
}), rachageModel) : rachageModel), _dec6 = property(EditBox), _dec7 = property(Label), _dec8 = property(Label), _dec(_class = (_class2 = class rechargeNum extends Component {
|
|
constructor(...args) {
|
|
super(...args);
|
|
this.data = {};
|
|
|
|
_initializerDefineProperty(this, "Name", _descriptor, this);
|
|
|
|
_initializerDefineProperty(this, "EthPrice", _descriptor2, this);
|
|
|
|
_initializerDefineProperty(this, "UsdtPrice", _descriptor3, this);
|
|
|
|
_initializerDefineProperty(this, "RachageModel", _descriptor4, this);
|
|
|
|
_initializerDefineProperty(this, "RechageNum", _descriptor5, this);
|
|
|
|
_initializerDefineProperty(this, "privateddress", _descriptor6, this);
|
|
|
|
_initializerDefineProperty(this, "Eth", _descriptor7, this);
|
|
|
|
this.public_address = null;
|
|
this.private_address = null;
|
|
this.rechagenum = null;
|
|
}
|
|
|
|
init(data) {
|
|
this.node.getChildByName("name").getComponent(Label).string = data.name;
|
|
this.node.getChildByName("usdtPrice").getComponent(Label).string = data.usdt_price;
|
|
this.node.getChildByName("ethPrice").getComponent(Label).string = data.eth_price;
|
|
this.node.getChildByName("privateddress").getComponent(Label).string = data.private_address;
|
|
localStorage.setItem("address", data.public_address);
|
|
}
|
|
|
|
start() {// this.private_address = this.node.getChildByName("privateddress");
|
|
// this.rechagenum = this.node.getChildByName("RechageNum");
|
|
}
|
|
|
|
initData() {
|
|
let to_address = this.public_address.getComponent(Label).string;
|
|
let number = this.rechagenum.getComponent(EditBox).string;
|
|
let data = {
|
|
to_address: to_address,
|
|
number: number
|
|
};
|
|
console.log(data);
|
|
return data;
|
|
}
|
|
|
|
async text() {
|
|
const tbg = new (_crd && TBG === void 0 ? (_reportPossibleCrUseOfTBG({
|
|
error: Error()
|
|
}), TBG) : TBG)({});
|
|
const account = await tbg.login();
|
|
const data = {};
|
|
console.log(this.Eth.string);
|
|
let address = localStorage.getItem("address");
|
|
console.log(address);
|
|
let num = new (_crd && BigNumber === void 0 ? (_reportPossibleCrUseOfBigNumber({
|
|
error: Error()
|
|
}), BigNumber) : BigNumber)(Number(this.RechageNum.string));
|
|
let eth = new (_crd && BigNumber === void 0 ? (_reportPossibleCrUseOfBigNumber({
|
|
error: Error()
|
|
}), BigNumber) : BigNumber)(Number(this.Eth.string));
|
|
const ReNum = new (_crd && BigNumber === void 0 ? (_reportPossibleCrUseOfBigNumber({
|
|
error: Error()
|
|
}), BigNumber) : BigNumber)(10 ** 18).times(num).times(num); // const number = new BigNumber(ReNum);
|
|
|
|
console.log(ReNum);
|
|
const res = await tbg.sendTransaction({
|
|
from: account,
|
|
to: address,
|
|
value: ReNum
|
|
});
|
|
}
|
|
|
|
update(deltaTime) {}
|
|
|
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "Name", [_dec2], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "EthPrice", [_dec3], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "UsdtPrice", [_dec4], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "RachageModel", [_dec5], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "RechageNum", [_dec6], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "privateddress", [_dec7], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "Eth", [_dec8], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function () {
|
|
return null;
|
|
}
|
|
})), _class2)) || _class));
|
|
|
|
_cclegacy._RF.pop();
|
|
|
|
_crd = false;
|
|
}
|
|
};
|
|
});
|
|
//# sourceMappingURL=65182ac8105a1b97e9e9feb5debee7f7f6c7d98c.js.map
|