// module g2.account_dep {
//     // 注册面板界面
//     export class AccountRegView extends ui.account.AccountRegViewUI {
//         // 获取校验码按钮
//         private m_getValidCodeBtn:g.ui.SecDownButton = new g.ui.SecDownButton("ui/btn_005_small.png", "获取校验码");
//         private m_otherLogBtnsView:OtherLoginBtnsView;
//         // 构造函数
//         constructor(){
//             super();
//             // 初始化获取校验码按钮
//             this.m_getValidCodeBtn.labelSize = 24;
//             this.m_getValidCodeBtn.labelBold = true;
//             this.m_getValidCodeBtn.labelColors = "#cabdad,#cabdad,#cabdad";
//             this.m_getValidCodeBtn.sizeGrid = "5,5,5,5";
//             this.m_getValidCodeBtn.labelStroke = 1;
//             this.m_getValidCodeBtn.size(this.m_getValidCodeBtnPH.width, this.m_getValidCodeBtnPH.height);
//             this.m_getValidCodeBtnPH.addChild(this.m_getValidCodeBtn);
//             // 绑定事件
//             this.on(Laya.Event.DISPLAY, this, this.onEnter);
//             this.on(Laya.Event.UNDISPLAY, this, this.onExit);
//             this.m_getValidCodeBtn.on(Laya.Event.CLICK, this, this.onGetValidCodeBtnClick);
//             this.m_regBtn.on(Laya.Event.CLICK, this, this.onRegBtnClick);
//             // this.m_guestBtn.on(Laya.Event.CLICK, this, this.onGuestBtnClick);
//             this.ui_agreementCheck.on(Laya.Event.CLICK, this, this.onAgreementCheckClick);
//             this.ui_privacy.on(Laya.Event.CLICK, this, this.onPrivacyClick);
//             this.ui_agreement.on(Laya.Event.CLICK, this, this.onAgreementClick);
//             //第三方登录按纽
//             this.m_otherLogBtnsView = new OtherLoginBtnsView(Handler.create(
//                 this,():boolean => {
//                     return this.ui_agreementCheck1.visible;
//                 },null,false));
//             this.m_otherLogBtnsView.anchorX = 0.5;
//             this.m_otherLogBtnsView.x = this.ui_otherLogView.width / 2.0;
//             this.ui_otherLogView.addChild(this.m_otherLogBtnsView);
//         }
//         /**
//          * onEnter
//          */
//         private onEnter(){
//             let accountMgr:G2AccountMgr = G2AccountMgr.inst();
//             let nextAvaliableTime:number = accountMgr.getValidCodeNextAvaliableTime(Const.ACCOUNT_VALID_CODE_USAGE_REG_MOBILE);
//             // 调用wait
//             this.m_getValidCodeBtn.wait(nextAvaliableTime);
//             //this.refreshGuestBtn();
//         }
//         // onExit
//         private onExit(){
//         }
//         /**
//          * 判定guest是否可用
//          */
//         private isGuestAvaliable():boolean {
//             let ERROR:Function = (_msg:string) => {
//                 Log.error(`AccountRegMgr.isGuestAvaliable():${_msg}`);
//             }
//             // 如果本地缓存有游客,返回true
//             let localStorageMgr:g2.localstorage.LocalStorageMgr = g2.localstorage.LocalStorageMgr.inst();
//             if(localStorageMgr.hasGuestAccount()){
//                 return true;
//             }
//             // 获取platform
//             let platform:string = "_";
//             let deviceInfo:g.device.GDeviceInfo = g.device.GDevice.getDeviceInfo();
//             if(null == deviceInfo) {
//                 ERROR("null deviceInfo.");
//             }else{
//                 platform = deviceInfo.platform;
//             }
//             // 服务器判定
//             let ret:boolean = true;
//             let accountMgr:g2.account.G2AccountMgr = g2.account.G2AccountMgr.inst();
//             let accountServerInfo:g2.account.InfoAccountServer = accountMgr.getAccountServerInfo();
//             if(null == accountServerInfo){
//                 ERROR("null accountServerInfo");
//             }else{
//                 ret = !accountServerInfo.isGuestClose(platform);
//             }
//             return ret;
//         }
//         // 决定是否隐藏游客登录按钮
//         // 2020.09.10: 仅玩家本地有游客账号时,才显示游客按钮
//         private refreshGuestBtn(){
//             // let guestAvaliable:boolean = this.isGuestAvaliable();
//             // if(guestAvaliable) {
//             //     this.m_guestBtn.visible = true;
//             //     this.m_regBtn.x = 420;
//             // }else{
//             //     this.m_guestBtn.visible = false;
//             //     this.m_regBtn.x = 274;
//             // }
//         }
//         // 获取校验码按钮点击
//         private onGetValidCodeBtnClick(){
//             // 工具函数
//             let LOG_ERROR:Function = (_msg:string) => {
//                 Log.error(`AccountRegView.onGetValidCodeBtnClick():${_msg}`);
//             }
//             // 收集参数
//             let mobile:string = this.m_mobileInput.text;
//             // 校验数据
//             if(!g.common.Common.checkMobile(mobile)){
//                 G2ViewMgr.inst().tip("无效的手机格式.");
//                 return;
//             }
//             // 调用接口
//             let accountMgr:G2AccountMgr = G2AccountMgr.inst();
//             accountMgr.sendValidCode(mobile, Const.ACCOUNT_VALID_CODE_USAGE_REG_MOBILE,
//                 ()=>{
//                     // 提示消息
//                     G2ViewMgr.inst().tip("校验码已发往手机,请查收.");
//                     // ------------------------------------------------------------
//                     // 按钮读秒
//                     // ------------------------------------------------------------
//                     // 获取minIssueTime,计算到期时间
//                     let accountServerInfo:g2.account.InfoAccountServer = accountMgr.getAccountServerInfo();
//                     if(null == accountServerInfo){
//                         LOG_ERROR("null accountServerInfo.")
//                         return;
//                     }
//                     let minIssueTime:number = accountServerInfo.regMobileVCMinIssueTime;
//                     let nextAvaliableTime:number = this.m_getValidCodeBtn.caculateEndTimestamp(minIssueTime);
//                     // 按usage将到期时间写入到cache中
//                     accountMgr.setValidCodeNextAvaliableTime(Const.ACCOUNT_VALID_CODE_USAGE_REG_MOBILE, nextAvaliableTime);
//                     // 调用按钮的wait 函数
//                     this.m_getValidCodeBtn.wait(nextAvaliableTime);
//                 })
//         }
//         // 注册按钮点击
//         private onRegBtnClick(){
//             // 检查用户协议是否勾选
//             if(!this.ui_agreementCheck1.visible) {
//                 G2ViewMgr.inst().tip("请仔细阅读游戏用户协议、隐私保护协议，并确认勾选框处于勾选状态.");
//                 return;
//             }
//             // ------------------------------------------------------------
//             // 收集/校验参数
//             // ------------------------------------------------------------
//             let mobile:string = this.m_mobileInput.text;
//             let valideCode:string = this.m_validCodeInput.text;
//             let password:string = this.m_passwordInput.text;
//             if(!g.common.Common.checkMobile(mobile)){
//                 G2ViewMgr.inst().tip("手机号码格式不正确.");
//                 return;
//             }
//             if(valideCode == null || valideCode.length != 6){
//                 G2ViewMgr.inst().tip("校验码输入不正确");
//                 return;
//             }
//             let passwordErrorCode:number = g2.common.Common.checkPassword(password);
//             if(GErrors.OK != passwordErrorCode){
//                 G2ViewMgr.inst().tipError(passwordErrorCode);
//                 return;
//             }
//             // ------------------------------------------------------------
//             // 提交代码
//             // ------------------------------------------------------------
//             let accountMgr:g2.account.G2AccountMgr = g2.account.G2AccountMgr.inst();
//             accountMgr.regMobileAccount(mobile,valideCode,password);
//         }
//         // 游客按钮点击
//         private onGuestBtnClick(){
//             // 检查用户协议是否勾选
//             if(!this.ui_agreementCheck1.visible) {
//                 G2ViewMgr.inst().tip("请仔细阅读游戏用户协议、隐私保护协议，并确认勾选框处于勾选状态.");
//                 return;
//             }
//             // 调用接口
//             let accountMgr:g2.account.G2AccountMgr = g2.account.G2AccountMgr.inst();
//             accountMgr.guest();
//         }
//         // 点击协议勾选框
//         private onAgreementCheckClick(){
//             this.ui_agreementCheck1.visible = !this.ui_agreementCheck1.visible;
//         }
//         // 隐私保护链接点击
//         private onPrivacyClick(){
//             // 显示协议内容
//             let htmlDialog:g2.view.common.HtmlDialog = new g2.view.common.HtmlDialog();
//             htmlDialog.set("隐私保护协议", Privacy.PRIVACY_PROTOCOL);
//             G2ViewMgr.inst().showDialog(htmlDialog, true,null,false);
//         }
//         // 用户协议链接点击
//         private onAgreementClick(){
//             // 显示协议内容
//             let htmlDialog:g2.view.common.HtmlDialog = new g2.view.common.HtmlDialog();
//             htmlDialog.set("游戏用户协议", Privacy.USER_PROTOCOL);
//             G2ViewMgr.inst().showDialog(htmlDialog, true,null,false);
//         }
//     }
// }
//# sourceMappingURL=AccountRegView.js.map