| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- const SceneCtrlBase = require('SceneCtrlBase');
- const JMLoadProgressBar = require('JMLoadProgressBar');
- const JMNetImage = require('JMNetImage');
- const LoginPanel = require('../view/login/LoginPanel');
- const RegisterPanel = require('../view/login/RegisterPanel');
- const TagType = {
- LOGIN: 0,
- REGISTER: 1
- };
- cc.Class({
- extends: SceneCtrlBase,
- editor: {
- menu: 'Ctrl/LoginCtrl'
- },
- properties: {
- loginPanel: {
- default: undefined,
- type: LoginPanel,
- },
- registerPanel: {
- default: undefined,
- type: RegisterPanel,
- },
- },
- onLoad () {
- this._super();
- this._tagType = TagType.LOGIN;
- // 进行授权、登录、注册等操作
- this.initAuth();
- this.initUI();
- },
- initAuth () {
-
- },
- initUI () {
- this.showpanel(TagType.LOGIN);
- this.loginPanel.reloadData(()=> {
- this.showpanel(TagType.REGISTER);
- });
- this.registerPanel.reloadData(()=> {
- this.showpanel(TagType.LOGIN);
- });
- },
- showpanel (tagType) {
- this._tagType = tagType;
- this.loginPanel.node.active = tagType == TagType.LOGIN;
- this.registerPanel.node.active = tagType == TagType.REGISTER;
- }
- });
|