| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import { AppKernel } from '@scripts/app/AppKernel';
- import { IPayoutGear, PayoutGears, PayoutType } from '@scripts/define/PayDefine';
- import { UIViewID } from '@scripts/define/UIDefine';
- import { UIPopup } from '@scripts/framework/ui/UIPopup';
- import { addBtnClick } from '@scripts/utils/UIHelper';
- import { _decorator, Component, EditBox, Label, Node } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('UIPayoutEditor')
- export class UIPayoutEditor extends UIPopup<PayoutType> {
- readonly viewId: UIViewID = UIViewID.UIPayoutEditor;
- @property(Node)
- btnClose: Node;
- @property(Node)
- btnConfirm: Node;
- @property(Label)
- lblName: Label;
- @property(EditBox)
- inputAccount: EditBox;
- @property(EditBox)
- inputConfirm: EditBox;
- private m_gear: IPayoutGear;
- protected onCreate() {
- addBtnClick(this.btnClose, this.closeSelf, this);
- addBtnClick(this.btnConfirm, this.onBtnConfirmClick, this);
- }
- private async onBtnConfirmClick() {
- const account = this.inputAccount.string;
- const reAccount = this.inputConfirm.string;
- if (!account || account.length === 0) {
- AppKernel.ui.toast("payout.edit.account_empty", true);
- return;
- }
- if (reAccount !== account) {
- AppKernel.ui.toast("payout.edit.account_nosame", true);
- return;
- }
- let params: any = { pixType: 0 };
- params.pixType = this.m_gear.pixType;
- switch (this.m_gear.type) {
- case PayoutType.CashApp:
- params.cashTag = account;
- break;
- case PayoutType.Paypal:
- params.paypal = account;
- break;
- }
- AppKernel.ui.loading(true);
- const withdraw = AppKernel.stores.withdrawStore;
- await withdraw.reqWithdrawSetInfo(params)
- AppKernel.ui.loading(false);
- }
- protected onOpen(type: PayoutType) {
- const gear = PayoutGears.find(gear => gear.type === type);
- if (!gear) return;
- this.m_gear = gear;
- this.lblName.string = gear.name;
- }
- }
|