import { _decorator, Component, Node } from 'cc'; import GBaseUI from '../../gcommon/GBaseUI'; import { UIButton } from '../../gcommon/UIButton'; import { shop_type_btn } from '../shop_type_btn'; const { ccclass, property } = _decorator; @ccclass('email_view') export class email_view extends GBaseUI { @property(Node) btn_close:Node = null @property(Node) btn_select_xitong:Node = null @property(Node) btn_select_haoyou:Node = null @property(Node) node_select_xitong:Node = null @property(Node) node_select_haoyou:Node = null private curSelect:number = 0; start() { UIButton.BindClick(this.btn_close,()=>{ this.closeUI() },this) // this.initSelectView() } initSelectView(){ UIButton.BindClick(this.btn_select_xitong,()=>{ if(this.curSelect===0){ }else{ this.curSelect = 0; this.updateSelectStatus() } },this) UIButton.BindClick(this.btn_select_haoyou,()=>{ if(this.curSelect===1){ }else{ this.curSelect = 1; this.updateSelectStatus() } },this) this.updateSelectStatus() } updateSelectStatus(){ this.btn_select_xitong.getComponent(shop_type_btn).unSelect() this.btn_select_haoyou.getComponent(shop_type_btn).unSelect() switch (this.curSelect) { case 0: { this.btn_select_xitong.getComponent(shop_type_btn).onSelect() } break; case 1: { this.btn_select_haoyou.getComponent(shop_type_btn).onSelect() } break; } this.updateView() } updateView(){ this.node_select_xitong.active = false; this.node_select_haoyou.active = false; switch (this.curSelect) { case 0: { this.node_select_xitong.active = true; } break; case 1: { this.node_select_haoyou.active = true; } break; } } update(deltaTime: number) { } }