// module g2.account_dep {
//     // 游客绑定手机号对话框
//     export class BindMobileDialog extends ui.account.BindMobileDialogUI {
//         // 获取校验码按钮
//         private m_getValidCodeBtn:g.ui.SecDownButton = new g.ui.SecDownButton("ui/btn_005_small.png", "获取校验码");
//         // 构造函数
//         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_closeBtn.on(Laya.Event.CLICK, this, this.onCloseBtnClick);
//             this.m_bindBtn.on(Laya.Event.CLICK, this, this.onBindBtnClick);
//             this.ui_closeBtn.on(Laya.Event.CLICK, this, this.onCloseBtnClick);
//         }
//         private onEnter(){
//             // ------------------------------------------------------------
//             // 恢复验证码按钮读秒
//             // ------------------------------------------------------------
//             // 获取验证码的validCodeAvaliableTime
//             let accountMgr:G2AccountMgr = G2AccountMgr.inst();
//             let nextAvaliableTime:number = accountMgr.getValidCodeNextAvaliableTime(Const.ACCOUNT_VALID_CODE_USAGE_BIND_MOBILE);
//             // 调用wait
//             this.m_getValidCodeBtn.wait(nextAvaliableTime);
//         }
//         private onExit(){
//         }
//         private onGetValidCodeBtnClick(){
//             // 工具函数
//             let LOG_ERROR:Function = (_msg:string) => {
//                 Log.error(`BindMobileDialog.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_BIND_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_BIND_MOBILE, nextAvaliableTime);
//                     // 调用按钮的wait 函数
//                     this.m_getValidCodeBtn.wait(nextAvaliableTime);
//                 })
//         }
//         // 关闭按钮点击
//         private onCloseBtnClick(){
//             this.close();
//         }
//         // 绑定按钮点击
//         private onBindBtnClick(){
//             // 定义工具函数
//             let LOG_ERROR:Function = (_msg:string) => {
//                 Log.error(`BindMobileDialog.onBindBtnClick():${_msg}`);
//             }
//             // 收集参数,进行检查
//             let mobile:string = this.m_mobileInput.text;
//             let validCode:string = this.m_validCodeInput.text;
//             let password:string = this.m_passwordInput.text;
//             if(!g.common.Common.checkMobile(mobile)){
//                 G2ViewMgr.inst().tip("手机格式输入不正确");
//                 return;
//             }
//             if(null == validCode || validCode.length != 6){
//                 G2ViewMgr.inst().tip("校验码格式不正确");
//                 return;
//             }
//             let passwordErrorCode:number = g2.common.Common.checkPassword(password);
//             if(GErrors.OK != passwordErrorCode){
//                 G2ViewMgr.inst().tipError(passwordErrorCode);
//                 return;
//             }
//             // 获取当前登录账号的deviceID
//             let accountMgr:g2.account.G2AccountMgr = g2.account.G2AccountMgr.inst();
//             let loginAccount:g2.account.InfoAccount = accountMgr.getAccountInfo();
//             if(null == loginAccount){
//                 LOG_ERROR("null loginAccount");
//                 return;
//             }
//             // 调用account函数
//             accountMgr.bindMobile(
//                 loginAccount.id,
//                 mobile,
//                 validCode,
//                 password,
//                 ()=> {
//                     G2ViewMgr.inst().tip("绑定手机号成功");
//                     this.close();
//                 });
//         }
//     }
// }
//# sourceMappingURL=BindMobileDialog.js.map