diff --git a/src/app/routes/financial-management/components/platform-account/withdraw-deposit/withdraw-deposit.component.ts b/src/app/routes/financial-management/components/platform-account/withdraw-deposit/withdraw-deposit.component.ts index ca2cb877..f27df88a 100644 --- a/src/app/routes/financial-management/components/platform-account/withdraw-deposit/withdraw-deposit.component.ts +++ b/src/app/routes/financial-management/components/platform-account/withdraw-deposit/withdraw-deposit.component.ts @@ -240,11 +240,21 @@ export class CwcAccountManagementWithdrawDepositComponent implements OnInit { this.sf.setValue('/payPsd', val); if (val || val !== '') { const last = val.substr(val.length - 1); - const password = this.sf.getValue('/payPassword'); + const password = this.sf.getValue('/payPassword') || ''; const start = this.psd?.nativeElement.selectionStart; + const index = val.lastIndexOf('•'); if (last !== '•') { - this.sf.setValue('/payPassword', start !== 1 ? (password + last) : last); + if (password.length !== 0) { + // 新增 或 替换 + const pre = password.substr(0, index + 1); + const detail = val.substr(index + 1, val.length); + this.sf.setValue('/payPassword', pre + detail); + } else { + // 新增 + this.sf.setValue('/payPassword', val); + } } else { + // 删除 this.sf.setValue('/payPassword', password.substr(0, val.length)); } const payPswVal = this.sf.getValue('/payPsd');