TestChain/assets/comp/wallet/scripts/ui/WalletMainPanel.ts
2022-06-23 11:21:05 +08:00

55 lines
1.1 KiB
TypeScript

import { WALLET_SHOW_ACCOUNT_LIST, WALLET_SHOW_MODAL, WALLET_SHOW_QR } from "../common/WalletEvent";
import ChainTab from "./ChainTab";
import { IQRCfg } from "./comp/QRCodeComp";
import ListNode from "./ListNode";
import WalletBase from "./WallerBase";
const {ccclass, property} = cc._decorator;
@ccclass
export default class WalletMainPanel extends WalletBase {
@property({
type: ChainTab
})
chainTab: ChainTab = null
@property({
type: ListNode
})
listNode: ListNode = null
@property(cc.Node)
modalLayer: cc.Node = null
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
super.start()
this.modalLayer.active = false
}
// update (dt) {}
hideWallet() {
this.node.active = false
}
updateChainList() {
const chains = this.wallet.chainList
if (!chains || chains.length === 0) {
return;
}
for (const chain of chains) {
}
}
onMenuClick() {
this.wallet.uiHandlers.emit(WALLET_SHOW_MODAL, {tag: 'menu'})
}
}