web3 更新 语言修复
This commit is contained in:
@@ -12,6 +12,7 @@ import { TipsPanel } from "./TipsPanel";
|
||||
import { SDKManager } from "../../../Main/Channel/SDKManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
import { PersonalPanel } from "./PersonalPanel";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -34,14 +35,16 @@ export class Web3PopPanel extends li_BaseView {
|
||||
private networkType: proto.cs.EnmNetworkType;
|
||||
private goodId: number;
|
||||
|
||||
private base: PurchasePanel;
|
||||
private basePanel: PersonalPanel;
|
||||
private payPanel: PurchasePanel;
|
||||
|
||||
private countdownTimer: any;
|
||||
private remainingSeconds: number = 0;
|
||||
private isCountingDown: boolean = false;
|
||||
private tips: Label;
|
||||
openUIDataCT(data: any): void {
|
||||
this.refreshData(data);
|
||||
this.base.web3PopPanel = this;
|
||||
this.payPanel.web3PopPanel = this;
|
||||
}
|
||||
|
||||
onLoadCT(): void {
|
||||
@@ -54,6 +57,7 @@ export class Web3PopPanel extends li_BaseView {
|
||||
this.address = this._nodeTab.addressText.getComponent(Label);
|
||||
this.expireTimeText = this._nodeTab.expireTimeText.getComponent(Label);
|
||||
this.qrCode = this._nodeTab.qrCode.getComponent(Sprite);
|
||||
this.tips = this._nodeTab.tips.getComponent(Label);
|
||||
this.registerListener();
|
||||
|
||||
this.selection.setScale(new Vec3(1, 0, 1));
|
||||
@@ -83,13 +87,7 @@ export class Web3PopPanel extends li_BaseView {
|
||||
},
|
||||
this
|
||||
);
|
||||
GButton.BandClick(
|
||||
this._nodeTab.ENT_BEP,
|
||||
() => {
|
||||
this.onClickCoinType(proto.cs.EnmNetworkType.ENT_BEP);
|
||||
},
|
||||
this
|
||||
);
|
||||
|
||||
GButton.BandClick(
|
||||
this._nodeTab.ENT_ETH,
|
||||
() => {
|
||||
@@ -97,6 +95,13 @@ export class Web3PopPanel extends li_BaseView {
|
||||
},
|
||||
this
|
||||
);
|
||||
GButton.BandClick(
|
||||
this._nodeTab.ENT_BEP,
|
||||
() => {
|
||||
this.onClickCoinType(proto.cs.EnmNetworkType.ENT_BEP);
|
||||
},
|
||||
this
|
||||
);
|
||||
}
|
||||
|
||||
refreshData(data: any): void {
|
||||
@@ -105,7 +110,8 @@ export class Web3PopPanel extends li_BaseView {
|
||||
this.goodId = data.goodId;
|
||||
this.curType =
|
||||
data.networkType != undefined ? data.networkType : this.curType;
|
||||
this.base = data.base;
|
||||
this.basePanel = data.basePanel;
|
||||
this.payPanel = data.payPanel;
|
||||
}
|
||||
refreshView() {
|
||||
const OrderData = DataManager.I.getDataById<OrderData>(DataId.Order);
|
||||
@@ -127,8 +133,8 @@ export class Web3PopPanel extends li_BaseView {
|
||||
if (expireTime > 0) {
|
||||
this.startCountdown(expireTime);
|
||||
} else {
|
||||
this.expireTimeText.string = "已过期";
|
||||
this.expireTimeText.color = new Color(128, 128, 128, 255);
|
||||
this.expireTimeText.string = LanguageUtils.getText("web3panel.expired");
|
||||
//this.expireTimeText.color = new Color(128, 128, 128, 255);
|
||||
this.disableButtons();
|
||||
}
|
||||
this.amount.string = amount;
|
||||
@@ -137,30 +143,46 @@ export class Web3PopPanel extends li_BaseView {
|
||||
case proto.cs.EnmNetworkType.ENT_TRON:
|
||||
ResManager.I.changeResourceSpriteFrame(
|
||||
this.coinIcon,
|
||||
"ui/web3pop/coinIcon/ENT_TRON"
|
||||
"ui/web3pop/coinIcon/Tron"
|
||||
);
|
||||
this.coinText.string = "Tron(TRC20)";
|
||||
this.tips.string = LanguageUtils.getText("web3panel.tips").replace(
|
||||
"{Network}",
|
||||
"Tron"
|
||||
);
|
||||
this.coinText.string = "ENT_TRON";
|
||||
break;
|
||||
case proto.cs.EnmNetworkType.ENT_TON:
|
||||
ResManager.I.changeResourceSpriteFrame(
|
||||
this.coinIcon,
|
||||
"ui/web3pop/coinIcon/ENT_TON"
|
||||
"ui/web3pop/coinIcon/TON"
|
||||
);
|
||||
this.coinText.string = "TON";
|
||||
this.tips.string = LanguageUtils.getText("web3panel.tips").replace(
|
||||
"{Network}",
|
||||
"TON"
|
||||
);
|
||||
this.coinText.string = "ENT_TON";
|
||||
break;
|
||||
case proto.cs.EnmNetworkType.ENT_ETH:
|
||||
ResManager.I.changeResourceSpriteFrame(
|
||||
this.coinIcon,
|
||||
"ui/web3pop/coinIcon/ENT_ETH"
|
||||
"ui/web3pop/coinIcon/ETH"
|
||||
);
|
||||
this.coinText.string = "ETH";
|
||||
this.tips.string = LanguageUtils.getText("web3panel.tips").replace(
|
||||
"{Network}",
|
||||
"ETH"
|
||||
);
|
||||
this.coinText.string = "ENT_ETH";
|
||||
break;
|
||||
case proto.cs.EnmNetworkType.ENT_BEP:
|
||||
ResManager.I.changeResourceSpriteFrame(
|
||||
this.coinIcon,
|
||||
"ui/web3pop/coinIcon/ENT_BEP"
|
||||
"ui/web3pop/coinIcon/BEP"
|
||||
);
|
||||
this.coinText.string = "BEP";
|
||||
this.tips.string = LanguageUtils.getText("web3panel.tips").replace(
|
||||
"{Network}",
|
||||
"BEP"
|
||||
);
|
||||
this.coinText.string = "ENT_BEP";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -198,7 +220,11 @@ export class Web3PopPanel extends li_BaseView {
|
||||
case proto.cs.EnmNetworkType.ENT_BEP:
|
||||
break;
|
||||
}
|
||||
this.base.startPayment(this.goodId, proto.cs.EnmPayType.EPT_WEB3_USD, type);
|
||||
this.payPanel.startPayment(
|
||||
this.goodId,
|
||||
proto.cs.EnmPayType.EPT_WEB3_USD,
|
||||
type
|
||||
);
|
||||
|
||||
this.selection.scale = new Vec3(1, 0, 1);
|
||||
}
|
||||
@@ -222,7 +248,7 @@ export class Web3PopPanel extends li_BaseView {
|
||||
|
||||
onClickClose() {
|
||||
this.stopCountdown();
|
||||
this.base.web3PopPanel = null;
|
||||
this.payPanel.web3PopPanel = null;
|
||||
this.close();
|
||||
}
|
||||
|
||||
@@ -279,14 +305,15 @@ export class Web3PopPanel extends li_BaseView {
|
||||
if (!this.expireTimeText) return;
|
||||
|
||||
const timeText = this.formatCountdownTime(this.remainingSeconds);
|
||||
this.expireTimeText.string = timeText;
|
||||
this.expireTimeText.string =
|
||||
LanguageUtils.getText("web3panel.expire") + timeText;
|
||||
|
||||
if (this.remainingSeconds <= 30 && this.remainingSeconds > 0) {
|
||||
this.expireTimeText.color = new Color(255, 0, 0, 255);
|
||||
} else if (this.remainingSeconds <= 0) {
|
||||
this.expireTimeText.color = new Color(128, 128, 128, 255);
|
||||
} else {
|
||||
this.expireTimeText.color = new Color(255, 255, 255, 255);
|
||||
this.expireTimeText.color = new Color(255, 135, 247, 255);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,6 +356,8 @@ export class Web3PopPanel extends li_BaseView {
|
||||
private onCountdownExpired(): void {
|
||||
logger.log("Web3支付倒计时已过期");
|
||||
this.disableButtons();
|
||||
TipsPanel.show("支付时间已过期,请重新发起支付");
|
||||
this.expireTimeText.string = LanguageUtils.getText("web3panel.expired");
|
||||
|
||||
//TipsPanel.show("支付时间已过期,请重新发起支付");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user