支付密码优化
This commit is contained in:
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user