This commit is contained in:
2026-07-02 00:34:07 +03:30
parent e097f6b2bb
commit a41dd6ef9e
12 changed files with 93 additions and 26 deletions
@@ -19,7 +19,8 @@
<a-form-item :rules="[requireNationalCode()]" label="شماره ملی" name="n_code">
<BasicInput
v-model:value="userFormState.n_code"
type="number"
type="text"
inputmode="numeric"
:disabled="userFormState.is_legal == 1 || userFormState.is_legal == 2"
/>
</a-form-item>
@@ -16,6 +16,7 @@ import { getUserAvatarUrl } from '@/utils/file'
import { useConfigStore } from '@/store/configStore'
import { getConfigApp, isBoursecuProject, getBoursecuActionIconSrc } from '@/utils/config'
import { getReferralShareText, getReferralShareTitle, shareReferralText } from '@/utils/referralShare'
import { normalizeAuthFormFields } from '@/utils/persianDigits'
export interface UserMenuAction {
id: string
@@ -207,6 +208,7 @@ export function useUserPage() {
formRef.value?.validateFields().then(async () => {
try {
loading.value = true
normalizeAuthFormFields(userFormState.value)
await updateMe(userFormState.value)
await userStore.getMyInfo()
localAvatarUrl.value = getUserAvatarUrl(userStore.userInfo)
@@ -224,6 +226,7 @@ export function useUserPage() {
formPassRef.value?.validateFields().then(async () => {
try {
loading.value = true
normalizeAuthFormFields(userPassForm.value)
await updatePass(userPassForm.value)
await userStore.getMyInfo()
editPassVisible.value = false
+11 -1
View File
@@ -103,7 +103,12 @@
<a-form-item v-if="!isSMS" :rules="[required('کلمه عبور')]" class="home_appear_fade_in_down" label="کلمه عبور"
name="password">
<!-- <BasicInput v-model:value="userFormState.password" size="large" place-holder="کلمه عبور"/>-->
<AInputPassword v-model:value="userFormState.password" place-holder="کلمه عبور" size="large"/>
<BasicInput
v-model:value="userFormState.password"
is-password
place-holder="کلمه عبور"
size="large"
/>
</a-form-item>
<div v-else-if="!stepTwoVerify" :class="variant === 'desktop' ? 'h-0' : 'h-[90px]'" />
<div v-else>
@@ -387,6 +392,7 @@ import {
isTWA
} from "@/utils/config";
import BasicActionSheet from "@/components/BasicPacks/BasicActionSheet.vue";
import { normalizeAuthFormFields } from '@/utils/persianDigits'
import {getConfig} from "@/api/config";
import shareAppleIcon from '@/assets/img/share-apple.png'
import addToHomeScreenIcon from '@/assets/img/Add-to-homeScreen.png'
@@ -433,6 +439,7 @@ async function reSendCode() {
userFormState.token = undefined
// refOtpInput.value?.clearInput()
enableSendAgainCode.value = false
normalizeAuthFormFields(userFormState)
await loginCustomer(userFormState)
reset()
}
@@ -472,11 +479,13 @@ function useStyle() {
function handleOnChange(value: string) {
userFormState.token = value
normalizeAuthFormFields(userFormState)
// formRef.value?.validateFields()
}
async function handleOnComplete(value: string) {
userFormState.token = value
normalizeAuthFormFields(userFormState)
phoneVerification()
}
@@ -501,6 +510,7 @@ function phoneVerification() {
formRef.value?.validateFields().then(async () => {
try {
loading.value = true
normalizeAuthFormFields(userFormState)
if (isSMS.value) {
if (!stepTwoVerify.value) {
userFormState.token = undefined
+1 -1
View File
@@ -3,7 +3,7 @@
<div class="font-bold text-center text-xl">ورود / ثبت نام</div>
<a-form :model="userFormState" name="basic" @finish="phoneVerification" class="!mt-5">
<a-form-item label="شماره تلفن همراه" name="mobile" :rules="[required,mobileValidation('شماره تلفن همراه')]">
<BasicInput v-model:value="userFormState.mobile" type="tel" size="large" place-holder="شماره تلفن همراه"/>
<BasicInput v-model:value="userFormState.mobile" type="tel" inputmode="numeric" size="large" place-holder="شماره تلفن همراه"/>
<div class="text-xs mt-1 text-gray-400">مالکیت شماره باید به نام خودتان باشد</div>
</a-form-item>
<a-form-item>
+5 -1
View File
@@ -64,6 +64,7 @@
v-model:value="userFormState.mobile"
:place-holder="variant === 'desktop' ? '۰۹۱۲۳۴۵۶۷۸۹' : 'شماره تلفن'"
:size="variant === 'desktop' ? 'large' : undefined"
type="tel"
inputmode="numeric"
/>
</a-form-item>
@@ -73,8 +74,9 @@
label="کلمه عبور"
name="password"
>
<AInputPassword
<BasicInput
v-model:value="userFormState.password"
is-password
place-holder="کلمه عبور"
:size="variant === 'desktop' ? 'large' : undefined"
/>
@@ -236,6 +238,7 @@ import router from '@/router'
import {useConfigStore} from "@/store/configStore";
import {useSettingsStore} from '@/store/settingsStore'
import {getProjectLoginLogo, getProjectLoginTaglineLines, hasCustomLoginLogoLayout} from "@/utils/config";
import { normalizeAuthFormFields } from '@/utils/persianDigits'
withDefaults(
defineProps<{
@@ -288,6 +291,7 @@ function registerAccount() {
URLUserType() === 'single' ? userFormState.type = 2 : userFormState.type = 1
// console.log(userFormState)
if (!userFormState.referral_id || userFormState.referral_id === '') delete userFormState.referral_id
normalizeAuthFormFields(userFormState)
const { id } = await registerCustomer(userFormState)
registeredInfo.value = true
// console.log(registeredInfo.value)
@@ -17,6 +17,7 @@ import { useWalletStore } from '@/store/walletStore'
import { useSettingsStore } from '@/store/settingsStore'
import { setTruth } from '@/app/authBoot'
import { completeLoginNavigation } from '@/layouts/composables/useMobileScrollReset'
import { normalizeAuthFormFields } from '@/utils/persianDigits'
export function useLoginForm() {
const { time, onFinish, reset } = useCountdownTimer('00:02:00', 'mm:ss')
@@ -41,6 +42,7 @@ export function useLoginForm() {
async function reSendCode() {
userFormState.token = undefined
enableSendAgainCode.value = false
normalizeAuthFormFields(userFormState)
await loginCustomer(userFormState)
reset()
}
@@ -64,10 +66,12 @@ export function useLoginForm() {
function handleOnChange(value: string) {
userFormState.token = value
normalizeAuthFormFields(userFormState)
}
async function handleOnComplete(value: string) {
userFormState.token = value
normalizeAuthFormFields(userFormState)
phoneVerification()
}
@@ -103,6 +107,7 @@ export function useLoginForm() {
formRef.value?.validateFields().then(async () => {
try {
loading.value = true
normalizeAuthFormFields(userFormState)
if (isSMS.value) {
if (!stepTwoVerify.value) {
userFormState.token = undefined
@@ -5,6 +5,7 @@ import type { User } from '@/models/login'
import { loading, URLUserType } from '@/utils'
import { registerCustomer } from '@/api/login'
import router from '@/router'
import { normalizeAuthFormFields } from '@/utils/persianDigits'
export function useRegisterForm() {
const registeredInfo = ref(false)
@@ -31,6 +32,7 @@ export function useRegisterForm() {
if (!userFormState.referral_id || userFormState.referral_id === '') {
delete userFormState.referral_id
}
normalizeAuthFormFields(userFormState)
await registerCustomer(userFormState)
registeredInfo.value = true
} catch (e: any) {
@@ -107,8 +107,9 @@ function goToAboutUs() {
label="کلمه عبور"
name="password"
>
<AInputPassword
<BasicInput
v-model:value="userFormState.password"
is-password
place-holder="کلمه عبور"
size="large"
/>
@@ -82,13 +82,15 @@ function handleSuccessDismiss() {
v-model:value="userFormState.mobile"
place-holder="۰۹۱۲۳۴۵۶۷۸۹"
size="large"
type="tel"
inputmode="numeric"
/>
</a-form-item>
<a-form-item :rules="[required()]" label="کلمه عبور" name="password">
<AInputPassword
<BasicInput
v-model:value="userFormState.password"
is-password
place-holder="کلمه عبور"
size="large"
/>