fix bugs of physicalRecieve & login-code-input & odometer-digit

This commit is contained in:
2026-07-20 16:57:03 +03:30
parent cedd1ae586
commit a60f1fbc68
15 changed files with 545 additions and 73 deletions
@@ -11,6 +11,7 @@ import router from '@/router'
import {isTWA} from "@/utils/config";
import {useUserStore} from "@/store/userStore";
import {useSettingsStore} from "@/store/settingsStore";
import { persianToEnglishDigits } from '@/utils/persianDigits'
const emit = defineEmits<{
register: [val: boolean]
@@ -41,6 +42,17 @@ const {
proceedWithInstall,
} = useLoginPageContext().loginForm
function onWebOtpAssistInput(event: Event) {
const raw = (event.target as HTMLInputElement | null)?.value ?? ''
const code = persianToEnglishDigits(raw).replace(/\D/g, '').slice(0, 4)
if (code.length === 4) {
userFormState.token = code
handleOnComplete(code)
} else {
handleOnChange(code)
}
}
function goToEducate() {
router.push({ name: 'educate' })
}
@@ -123,6 +135,7 @@ function goToAboutUs() {
]"
class="error-token"
name="token"
style="position: relative"
>
<OtpInput
ref="refOtpInput"
@@ -134,10 +147,21 @@ function goToAboutUs() {
input-classes="otp-input"
separator=""
style="direction: ltr"
value=""
:value="userFormState.token || ''"
@on-change="handleOnChange"
@on-complete="handleOnComplete"
/>
<input
class="web-otp-assist"
type="text"
inputmode="numeric"
autocomplete="one-time-code"
maxlength="4"
tabindex="-1"
aria-hidden="true"
:value="userFormState.token || ''"
@input="onWebOtpAssistInput"
/>
</AFormItem>
<div class="dauth-phone-edit">