From b42f7f566b87823f84d7445b10ce9553baa73adf Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 2 Jul 2023 21:57:22 +0800 Subject: [PATCH] add unlock page for desktop --- src/components/common/PinCodeInput.vue | 3 +- src/desktop-main.js | 4 + src/locales/en.js | 2 + src/locales/zh_Hans.js | 2 + src/styles/desktop/global.scss | 10 ++ src/views/desktop/UnlockPage.vue | 227 ++++++++++++++++++++++++- 6 files changed, 244 insertions(+), 4 deletions(-) diff --git a/src/components/common/PinCodeInput.vue b/src/components/common/PinCodeInput.vue index 85aec9d9..35fb9320 100644 --- a/src/components/common/PinCodeInput.vue +++ b/src/components/common/PinCodeInput.vue @@ -244,9 +244,10 @@ export default { --ebk-pin-code-focued-color: #c67e48; --ebk-pin-code-border-radius: 8px; --ebk-pin-code-input-height: 46px; + --ebk-pin-code-input-gap: 8px; --ebk-pin-code-transition-duration: 200ms; display: grid; - gap: 8px; + gap: var(--ebk-pin-code-input-gap); } .pin-code-input { diff --git a/src/desktop-main.js b/src/desktop-main.js index 781a0b04..73e5a213 100644 --- a/src/desktop-main.js +++ b/src/desktop-main.js @@ -54,6 +54,8 @@ import { i18nFunctions } from '@/lib/i18n.js'; +import PinCodeInput from '@/components/common/PinCodeInput.vue'; + import AmountInput from '@/components/desktop/AmountInput.vue'; import ConfirmDialog from '@/components/desktop/ConfirmDialog.vue'; import SnackBar from '@/components/desktop/SnackBar.vue'; @@ -327,6 +329,8 @@ app.use(router); app.component('PerfectScrollbar', PerfectScrollbar); app.component('VueDatePicker', VueDatePicker); +app.component('PinCodeInput', PinCodeInput); + app.component('AmountInput', AmountInput); app.component('ConfirmDialog', ConfirmDialog); app.component('SnackBar', SnackBar); diff --git a/src/locales/en.js b/src/locales/en.js index 3f17bc88..ca55597a 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -768,6 +768,8 @@ export default { 'Welcome to ezBookkeeping': 'Welcome to ezBookkeeping', 'Please log in with your ezBookkeeping account': 'Please log in with your ezBookkeeping account', 'Unlock Application': 'Unlock Application', + 'Please input your PIN code or use Webauth to unlock application': 'Please input your PIN code or use Webauth to unlock application', + 'Can\'t Unlock?': 'Can\'t Unlock?', 'Re-login': 'Re-login', 'Username': 'Username', 'Your username': 'Your username', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 6251116a..001d32be 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -768,6 +768,8 @@ export default { 'Welcome to ezBookkeeping': '欢迎使用 ezBookkeeping', 'Please log in with your ezBookkeeping account': '请使用您的 ezBookkeeping 账号登录', 'Unlock Application': '解锁应用', + 'Please input your PIN code or use Webauth to unlock application': '请输入您的 PIN 码,或使用 Webauth 解锁应用', + 'Can\'t Unlock?': '无法登录?', 'Re-login': '重新登录', 'Username': '用户名', 'Your username': '你的用户名', diff --git a/src/styles/desktop/global.scss b/src/styles/desktop/global.scss index a17684e8..64a416e3 100644 --- a/src/styles/desktop/global.scss +++ b/src/styles/desktop/global.scss @@ -12,6 +12,16 @@ } /** custom class **/ +.pin-codes-input { + --ebk-pin-code-input-height: 56px; + --ebk-pin-code-input-gap: 20px; + --ebk-pin-code-transition-duration: 0ms; +} + +.pin-code-input input { + font-size: 1.25rem; +} + .auth-logo { position: absolute; z-index: 1; diff --git a/src/views/desktop/UnlockPage.vue b/src/views/desktop/UnlockPage.vue index 21fb2dfa..1f8027c4 100644 --- a/src/views/desktop/UnlockPage.vue +++ b/src/views/desktop/UnlockPage.vue @@ -1,13 +1,234 @@