需求
在
输入验证码且校验成功后,弹
代码逻辑
在
showSmsVerifyDialog(bankInfo: BankInfo) { this.smsVerifyDialogController = new CustomDialogController({ builder: SMSVerifyDialog({ bankInfo: bankInfo, onBindSuccess: this.onBindSuccess }), alignment: DialogAlignment.Center, autoCancel: false }) this.smsVerifyDialogController.open() }
在
async verifyVCode() { // 模拟网络请求成功后 this.controller.close() this.onBindSuccess() }
其中
onBindSuccess() { this.showTradePwdDialog() } showTradePwdDialog() { this.tradePwdDialogController = new CustomDialogController({ builder: TradePasswordDialog({ onToSetPwdClick: this.onToSetPwdClick }), alignment: DialogAlignment.Center, autoCancel: false }) this.tradePwdDialogController.open() }
问题
在
page: pages/repay/CashierPage.js Error message: is not callable SourceCode: this.showTradePwdDialog(); ^ Stacktrace: at onBindSuccess (/pages/repay/CashierPage.ets:42:5) at verifyVCode (/ets/dialog/SMSVerifyDialog.ets:139:5) at anonymous (/ets/dialog/SMSVerifyDialog.ets:100:15)
经定位,为
解决方案
在创建
showSmsVerifyDialog(bankInfo: BankInfo) { this.smsVerifyDialogController = new CustomDialogController({ builder: SMSVerifyDialog({ bankInfo: bankInfo, onBindSuccess: this.onBindSuccess.bind(this) }), alignment: DialogAlignment.Center, autoCancel: false }) this.smsVerifyDialogController.open() }
再次运行尝试,解决,搞定~