import { _decorator, Component, Label, Node, Sprite, Vec3 } from "cc"; import li_BaseView from "../../../Main/Common/li_BaseView"; import Utils from "../../../Main/Common/Utils"; import { GButton } from "../../../Main/Common/GButton"; const { ccclass, property } = _decorator; @ccclass("Web3PopPanel") export class Web3PopPanel extends li_BaseView { private _nodeTab: any = {}; private coinIcon: Sprite; private coinText: Label; private selection: Node; private curType: number; onLoadCT(): void { Utils.parseNode(this.node, this._nodeTab); this.selection = this._nodeTab.Selection; this.coinIcon = this._nodeTab.SelectedCoinIcon; this.coinText = this._nodeTab._SelectedCoinText; this.registerListener(); this.selection.setScale(new Vec3(1, 0, 1)); } registerListener() { GButton.BandClick(this._nodeTab.closeBtn, this.onClickClose, this); GButton.BandClick( this._nodeTab.CoinTypeSelectBtn, this.onClickCoinTypeSelectBtn, this ); GButton.BandClick(this._nodeTab.CopyBtn, this.onClickCopy, this); GButton.BandClick( this._nodeTab.CoinType1, () => { this.onClickCoinType(1); }, this ); GButton.BandClick( this._nodeTab.CoinType2, () => { this.onClickCoinType(2); }, this ); GButton.BandClick( this._nodeTab.CoinType3, () => { this.onClickCoinType(3); }, this ); } init() { this.curType = 1; } refresh() { //this.coinIcon } updateSelectNetwork() {} onClickCoinTypeSelectBtn() { this.selection.scale = new Vec3(1, 1, 1); } onClickCoinType(type: number) { this.curType = type; if (type == 1) { } else if (type == 2) { } else if (type == 3) { } else { } this.selection.scale = new Vec3(1, 0, 1); } onClickCopy() { //todo:copy 功能 } onClickClose() { this.close(); } }