email_view.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import { _decorator, Component, Node } from 'cc';
  2. import GBaseUI from '../../gcommon/GBaseUI';
  3. import { UIButton } from '../../gcommon/UIButton';
  4. import { shop_type_btn } from '../shop_type_btn';
  5. const { ccclass, property } = _decorator;
  6. @ccclass('email_view')
  7. export class email_view extends GBaseUI {
  8. @property(Node) btn_close:Node = null
  9. @property(Node) btn_select_xitong:Node = null
  10. @property(Node) btn_select_haoyou:Node = null
  11. @property(Node) node_select_xitong:Node = null
  12. @property(Node) node_select_haoyou:Node = null
  13. private curSelect:number = 0;
  14. start() {
  15. UIButton.BindClick(this.btn_close,()=>{
  16. this.closeUI()
  17. },this)
  18. // this.initSelectView()
  19. }
  20. initSelectView(){
  21. UIButton.BindClick(this.btn_select_xitong,()=>{
  22. if(this.curSelect===0){
  23. }else{
  24. this.curSelect = 0;
  25. this.updateSelectStatus()
  26. }
  27. },this)
  28. UIButton.BindClick(this.btn_select_haoyou,()=>{
  29. if(this.curSelect===1){
  30. }else{
  31. this.curSelect = 1;
  32. this.updateSelectStatus()
  33. }
  34. },this)
  35. this.updateSelectStatus()
  36. }
  37. updateSelectStatus(){
  38. this.btn_select_xitong.getComponent(shop_type_btn).unSelect()
  39. this.btn_select_haoyou.getComponent(shop_type_btn).unSelect()
  40. switch (this.curSelect) {
  41. case 0:
  42. {
  43. this.btn_select_xitong.getComponent(shop_type_btn).onSelect()
  44. }
  45. break;
  46. case 1:
  47. {
  48. this.btn_select_haoyou.getComponent(shop_type_btn).onSelect()
  49. }
  50. break;
  51. }
  52. this.updateView()
  53. }
  54. updateView(){
  55. this.node_select_xitong.active = false;
  56. this.node_select_haoyou.active = false;
  57. switch (this.curSelect) {
  58. case 0:
  59. {
  60. this.node_select_xitong.active = true;
  61. }
  62. break;
  63. case 1:
  64. {
  65. this.node_select_haoyou.active = true;
  66. }
  67. break;
  68. }
  69. }
  70. update(deltaTime: number) {
  71. }
  72. }