Port modular price, product, and PWA fixes into boursecu
Sync live quote handling, SSE product images, store hours, file URL normalization, PWA icon cache, TV monitor, about software, SuperAdmin menu gates, price alerts, and related UX from modular while preserving boursecu branding and config constraints. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,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'
|
||||
import { normalizeAuthFormFields, persianToEnglishDigits } from '@/utils/persianDigits'
|
||||
import { beginSmsOtpCapture, clearPendingSmsOtp } from '@/utils/webOtp'
|
||||
import { usePwaInstall } from '@/composables/usePwaInstall'
|
||||
import {
|
||||
@@ -79,12 +79,12 @@ export function useLoginForm() {
|
||||
}
|
||||
|
||||
function handleOnChange(value: string) {
|
||||
userFormState.token = value
|
||||
userFormState.token = persianToEnglishDigits(String(value ?? ''))
|
||||
normalizeAuthFormFields(userFormState)
|
||||
}
|
||||
|
||||
async function handleOnComplete(value: string) {
|
||||
userFormState.token = value
|
||||
userFormState.token = persianToEnglishDigits(String(value ?? ''))
|
||||
normalizeAuthFormFields(userFormState)
|
||||
phoneVerification()
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@ import { loading, URLUserType } from '@/utils'
|
||||
import { registerCustomer } from '@/api/login'
|
||||
import router from '@/router'
|
||||
import { normalizeAuthFormFields } from '@/utils/persianDigits'
|
||||
import { useSettingsStore } from '@/store/settingsStore'
|
||||
|
||||
export function useRegisterForm() {
|
||||
const registeredInfo = ref(false)
|
||||
const disableForm = ref(false)
|
||||
const settingsStore = useSettingsStore()
|
||||
|
||||
const userFormState = reactive<User>({
|
||||
access_token: '',
|
||||
@@ -17,7 +19,10 @@ export function useRegisterForm() {
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (!settingsStore.loaded) {
|
||||
await settingsStore.fetchSettings()
|
||||
}
|
||||
if (router.currentRoute.value.query.id) {
|
||||
userFormState.referral_id = router.currentRoute.value.query.id as string
|
||||
disableForm.value = true
|
||||
@@ -29,7 +34,10 @@ export function useRegisterForm() {
|
||||
try {
|
||||
loading.value = true
|
||||
URLUserType() === 'single' ? (userFormState.type = 2) : (userFormState.type = 1)
|
||||
if (!userFormState.referral_id || userFormState.referral_id === '') {
|
||||
// فیلد مخفی + بدون لینک دعوت → کد را نفرست
|
||||
if (!settingsStore.isReferralFieldVisible && !disableForm.value) {
|
||||
delete userFormState.referral_id
|
||||
} else if (!userFormState.referral_id || userFormState.referral_id === '') {
|
||||
delete userFormState.referral_id
|
||||
}
|
||||
normalizeAuthFormFields(userFormState)
|
||||
|
||||
Reference in New Issue
Block a user