1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import { _decorator, Node, tween, Tween } from 'cc';
- import { Framework } from '../../framework/Framework';
- import { BaseView } from '../../framework/layer/BaseView';
- import { FrameworkConf } from '../../framework/config/FrameworkConf';
- const { ccclass, property } = _decorator;
- @ccclass('MaskUI')
- export class MaskUI extends BaseView {
- protected onLoad() {
- Framework.event.addEvent(FrameworkConf.Event.NET_HANDSHAKE_ERROR, this.onHandshakeError.bind(this),this);
- }
- protected onDestroy() {
- }
-
- onOpen(data) {
- this.node.active = false
- this.Node.relogin.active = false
- }
-
- onClose() {
-
- }
-
- onShow() {
- super.onShow();
- }
-
- onHide() {
- super.onHide();
- }
- onHandshakeError(code) {
- this.Node.bg.active = false
- this.Node.relogin.active = true
- this.unscheduleAllCallbacks()
- if(code == 4){
- this.Label.retext.string = "your account is logined on another devise"
-
- }
- else{
- this.Label.retext.string = "server closed"
- }
-
- }
-
- onClick() {
- window.parent.postMessage(FrameworkConf.WebEvent.CLOSE, "*");
- }
- }
|