123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- 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('activity_view')
- export class activity_view extends GBaseUI {
- @property(Node) btn_close:Node = null
- @property(Node) btn_select_huodong:Node = null
- @property(Node) btn_select_gonggao:Node = null
- @property(Node) node_select_huodong:Node = null
- @property(Node) node_select_gonggao:Node = null
- private curSelect:number = 0;
- start() {
- UIButton.BindClick(this.btn_close,()=>{
- this.closeUI()
- },this)
- // this.initSelectView()
- }
- initSelectView(){
- UIButton.BindClick(this.btn_select_huodong,()=>{
- if(this.curSelect===0){
- }else{
- this.curSelect = 0;
- this.updateSelectStatus()
- }
- },this)
- UIButton.BindClick(this.btn_select_gonggao,()=>{
- if(this.curSelect===1){
- }else{
- this.curSelect = 1;
- this.updateSelectStatus()
- }
- },this)
-
- this.updateSelectStatus()
- }
- updateSelectStatus(){
- this.btn_select_huodong.getComponent(shop_type_btn).unSelect()
- this.btn_select_gonggao.getComponent(shop_type_btn).unSelect()
- switch (this.curSelect) {
- case 0:
- {
- this.btn_select_huodong.getComponent(shop_type_btn).onSelect()
- }
- break;
- case 1:
- {
- this.btn_select_gonggao.getComponent(shop_type_btn).onSelect()
- }
- break;
- }
- this.updateView()
- }
- updateView(){
- this.node_select_huodong.active = false;
- this.node_select_gonggao.active = false;
- switch (this.curSelect) {
- case 0:
- {
- this.node_select_huodong.active = true;
- }
- break;
- case 1:
- {
- this.node_select_gonggao.active = true;
- }
- break;
-
- }
- }
- update(deltaTime: number) {
-
- }
- }
|