1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import { _decorator, Component, Node, Toggle, Label } from 'cc';
- import { ClientEvent } from '../clientEvent';
- import { Constant, privacy_type } from '../constant';
- import { GameMng } from '../GameMng';
- import GBaseUI from '../gcommon/GBaseUI';
- import { UIButton } from '../gcommon/UIButton';
- import { check_view } from './check_view';
- import { page_btn } from './page_btn';
- const { ccclass, property } = _decorator;
- @ccclass('privacy_setting')
- export class privacy_setting extends GBaseUI {
- @property(Node)
- btn_close: Node = null;
- @property(Node)
- btn_on_or_off: Node = null;
- @property(Node)
- btn_yuzhan: Node = null;
- @property(Node)
- btn_liuyan: Node = null;
- @property(Node)
- btn_zhanji: Node = null;
- @property(Node)
- lab_yuzhan: Node = null;
- @property(Node)
- lab_liuyan: Node = null;
- @property(Node)
- lab_zhanji: Node = null;
- @property(Node) check_view:Node = null;
- start() {
- UIButton.BindClick(this.btn_close,()=>{
- if(this.check_view.active === true){
- this.check_view.active = false;
- }else{
- this.closeUI()
- }
- },this)
- UIButton.BindClick(this.btn_on_or_off,()=>{
- this.clickToggle(this.btn_on_or_off)
- },this)
- UIButton.BindClick(this.btn_yuzhan,()=>{
- this.showSelectPrivacyCheck(privacy_type.yue_zhan)
- },this)
- UIButton.BindClick(this.btn_liuyan,()=>{
- this.showSelectPrivacyCheck(privacy_type.liu_yan)
- },this)
- UIButton.BindClick(this.btn_zhanji,()=>{
- this.showSelectPrivacyCheck(privacy_type.zhan_ji)
- },this)
- this.udpateCheckPrivacy()
- ClientEvent.on(Constant.UI_EVENT.UI_MSG_UPDATE_PRIVACY,this.udpateCheckPrivacy,this)
- }
- onDestroy(){
- ClientEvent.off(Constant.UI_EVENT.UI_MSG_UPDATE_PRIVACY,this.udpateCheckPrivacy,this)
- }
- udpateCheckPrivacy(){
- this.lab_zhanji.getComponent(Label).string = Constant.CHECK_PRIVACY[privacy_type.zhan_ji].select_list[GameMng._userData.privacy.zhanji_type]
- this.lab_liuyan.getComponent(Label).string = Constant.CHECK_PRIVACY[privacy_type.liu_yan].select_list[GameMng._userData.privacy.liuyan_type]
- this.lab_yuzhan.getComponent(Label).string = Constant.CHECK_PRIVACY[privacy_type.yue_zhan].select_list[GameMng._userData.privacy.yuezhan_type]
- }
- showSelectPrivacyCheck(type:privacy_type){
- this.check_view.active = true;
- this.check_view.getComponent(check_view).show(type)
- }
- clickToggle(node:Node){
- if(node.getComponent(page_btn).isSelect()){
- node.getComponent(page_btn).status_unselect()
- }else{
- node.getComponent(page_btn).status_select()
- }
- }
- update(deltaTime: number) {
-
- }
- }
|