diff --git a/src/components/digicipher/digicipher.ts b/src/components/digicipher/digicipher.ts index 2dcab7d..615fe92 100644 --- a/src/components/digicipher/digicipher.ts +++ b/src/components/digicipher/digicipher.ts @@ -115,6 +115,7 @@ export class StarLockNumber extends LitElement { this.changeText = '保存成功' break case 'passcode-verify-success': + this.errors = 0 this.guess = '' this.clicks = 0 for (let i = 0; i < 6; i++) { @@ -122,6 +123,22 @@ export class StarLockNumber extends LitElement { } break case 'passcode-verify-error': + this.errors += 1 + console.log(this.errors) + //当密码失败三次后 + if (this.errors == 3) { + console.log('进入已锁定页面') + this.dispatchEvent( + new CustomEvent('star-digicipher-passcode-error-third', { + detail: { + value: true, + }, + bubbles: true, + composed: true, + }) + ) + this.errors = 0 + } // 抖动反馈 for (let i = 0; i < 10; i++) { this.buttons[i].style.setProperty('animation', 'errtips .5s') @@ -164,6 +181,7 @@ export class StarLockNumber extends LitElement { this.clicks += 1 this.guess += (e.target as HTMLElement).dataset.num } else if (this.clicks == 5) { + // console.log('guess', this.guess) this.changeBgColor('#F4F4F4', this.clicks, 1) if (this.mode == 'create') { if (!this.confirm) { @@ -194,8 +212,6 @@ export class StarLockNumber extends LitElement { } touchEnd(e: TouchEvent) { if ((e.target as Element).tagName === 'BUTTON') { - console.log('this.guess', this.guess) - this.removeNumberBgColor() } } @@ -221,6 +237,7 @@ export class StarLockNumber extends LitElement { //发送密码 dispatchPasswd() { this.passwd = this.guess + // console.log('passwd', this.passwd) this.guess = '' this.clicks = 0 this.dispatchEvent( @@ -236,6 +253,7 @@ export class StarLockNumber extends LitElement { //更改密码 changePasswd() { this.savewd = this.guess + // console.log('更改密码', this.savewd) this.clicks = 0 for (let i = 0; i < 6; i++) { this.changeBgColor('#F4F4F4', i, 0.4) @@ -257,6 +275,7 @@ export class StarLockNumber extends LitElement { this.guess = '' this.clicks = 0 this.changeText = '新建密码' + // console.log('确认密码', this.passwd) this.dispatchEvent( new CustomEvent('star-digicipher-passcode-create', { detail: {