cc.Class({ editor: { menu: 'Login/LoginPanel' }, extends: cc.Component, properties: { gotoLogin: { default: undefined, type: cc.Button, }, gotoRegister: { default: undefined, type: cc.Button, }, getCode: { default: undefined, type: cc.Button, }, phoneEditor: { default: undefined, type: cc.EditBox, }, codeEditor: { default: undefined, type: cc.EditBox, }, passwordEditor: { default: undefined, type: cc.EditBox, }, }, onLoad () { }, reloadData (cb) { this._cb = cb; }, gotoLoginOnClicked () { var phoneNum = this.phoneEditor.string; if (phoneNum.length == 0 && !G.FuncUtils.isMobile(phoneNum)) { G.AppUtils.getSceneCtrl().addToast("手机号码格式不正确"); return; } var password = this.passwordEditor.string; if (password.length == 0) { G.AppUtils.getSceneCtrl().addToast("密码不能不填"); return; } if (password.length > 16) { G.AppUtils.getSceneCtrl().addToast("密码过长"); return; } G.LoginMgr.requestLoginByPhone(phoneNum, password); }, gotoRegisterOnClicked () { if (this._cb) { this._cb(); } }, getCodeOnClicked () { } });