@redneckz/wildless-cms-uni-blocks 0.14.971 → 0.14.973
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +135 -21
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/bundle/retail/api/createUserTaskDebit.d.ts +1 -0
- package/bundle/retail/api/getClaimChannel.d.ts +8 -0
- package/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/bundle/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/bundle/retail/utils/hasDelivery.d.ts +10 -0
- package/bundle/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/bundle/utils/getSlugFromUrl.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/retail/api/createUserTaskDebit.d.ts +1 -0
- package/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/dist/retail/api/getClaimChannel.d.ts +8 -0
- package/dist/retail/api/getClaimChannel.js +9 -0
- package/dist/retail/api/getClaimChannel.js.map +1 -0
- package/dist/retail/components/Fields/AddressRetailField.js +20 -0
- package/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/dist/retail/components/Fields/CreditCalcField.js +1 -1
- package/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/dist/retail/components/Fields/PaymentSystemField.js +14 -2
- package/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/dist/retail/components/Fields/RegionRetailField.js +20 -7
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js +34 -0
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/dist/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/dist/retail/utils/filterPaymentSystems.js +13 -0
- package/dist/retail/utils/filterPaymentSystems.js.map +1 -0
- package/dist/retail/utils/hasDelivery.d.ts +10 -0
- package/dist/retail/utils/hasDelivery.js +13 -0
- package/dist/retail/utils/hasDelivery.js.map +1 -0
- package/dist/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/dist/ui-kit/Select/useSelectPopup.js +1 -5
- package/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/dist/utils/getSlugFromUrl.d.ts +1 -0
- package/dist/utils/getSlugFromUrl.js +12 -0
- package/dist/utils/getSlugFromUrl.js.map +1 -0
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/retail/api/createUserTaskDebit.d.ts +1 -0
- package/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/lib/retail/api/getClaimChannel.d.ts +8 -0
- package/lib/retail/api/getClaimChannel.js +6 -0
- package/lib/retail/api/getClaimChannel.js.map +1 -0
- package/lib/retail/components/Fields/AddressRetailField.js +20 -0
- package/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/lib/retail/components/Fields/CreditCalcField.js +1 -1
- package/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/lib/retail/components/Fields/PaymentSystemField.js +14 -2
- package/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/lib/retail/components/Fields/RegionRetailField.js +20 -7
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js +31 -0
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/lib/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/lib/retail/utils/filterPaymentSystems.js +10 -0
- package/lib/retail/utils/filterPaymentSystems.js.map +1 -0
- package/lib/retail/utils/hasDelivery.d.ts +10 -0
- package/lib/retail/utils/hasDelivery.js +9 -0
- package/lib/retail/utils/hasDelivery.js.map +1 -0
- package/lib/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/lib/ui-kit/Select/useSelectPopup.js +1 -5
- package/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/lib/utils/getSlugFromUrl.d.ts +1 -0
- package/lib/utils/getSlugFromUrl.js +9 -0
- package/lib/utils/getSlugFromUrl.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +135 -21
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/bundle/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/mobile/bundle/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/mobile/bundle/retail/utils/hasDelivery.d.ts +10 -0
- package/mobile/bundle/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/mobile/bundle/utils/getSlugFromUrl.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/dist/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/dist/retail/api/getClaimChannel.js +9 -0
- package/mobile/dist/retail/api/getClaimChannel.js.map +1 -0
- package/mobile/dist/retail/components/Fields/AddressRetailField.js +20 -0
- package/mobile/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/CreditCalcField.js +1 -1
- package/mobile/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js +14 -2
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +20 -7
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js +34 -0
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/mobile/dist/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/mobile/dist/retail/utils/filterPaymentSystems.js +13 -0
- package/mobile/dist/retail/utils/filterPaymentSystems.js.map +1 -0
- package/mobile/dist/retail/utils/hasDelivery.d.ts +10 -0
- package/mobile/dist/retail/utils/hasDelivery.js +13 -0
- package/mobile/dist/retail/utils/hasDelivery.js.map +1 -0
- package/mobile/dist/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/mobile/dist/ui-kit/Select/useSelectPopup.js +1 -5
- package/mobile/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/mobile/dist/utils/getSlugFromUrl.d.ts +1 -0
- package/mobile/dist/utils/getSlugFromUrl.js +12 -0
- package/mobile/dist/utils/getSlugFromUrl.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +24 -4
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +4 -0
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/lib/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/lib/retail/api/getClaimChannel.js +6 -0
- package/mobile/lib/retail/api/getClaimChannel.js.map +1 -0
- package/mobile/lib/retail/components/Fields/AddressRetailField.js +20 -0
- package/mobile/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/CreditCalcField.js +1 -1
- package/mobile/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js +14 -2
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +20 -7
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +14 -0
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js +31 -0
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +1 -0
- package/mobile/lib/retail/utils/filterPaymentSystems.d.ts +4 -0
- package/mobile/lib/retail/utils/filterPaymentSystems.js +10 -0
- package/mobile/lib/retail/utils/filterPaymentSystems.js.map +1 -0
- package/mobile/lib/retail/utils/hasDelivery.d.ts +10 -0
- package/mobile/lib/retail/utils/hasDelivery.js +9 -0
- package/mobile/lib/retail/utils/hasDelivery.js.map +1 -0
- package/mobile/lib/ui-kit/Select/useSelectPopup.d.ts +1 -2
- package/mobile/lib/ui-kit/Select/useSelectPopup.js +1 -5
- package/mobile/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/mobile/lib/utils/getSlugFromUrl.d.ts +1 -0
- package/mobile/lib/utils/getSlugFromUrl.js +9 -0
- package/mobile/lib/utils/getSlugFromUrl.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +14 -5
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +32 -3
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +6 -0
- package/mobile/src/retail/api/createUserTaskDebit.ts +1 -0
- package/mobile/src/retail/api/getClaimChannel.ts +18 -0
- package/mobile/src/retail/components/Fields/AddressRetailField.tsx +26 -0
- package/mobile/src/retail/components/Fields/CreditCalcField.tsx +1 -1
- package/mobile/src/retail/components/Fields/PaymentSystemField.tsx +21 -2
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +22 -7
- package/mobile/src/retail/hooks/useBiblioglobusDefaultRegion.ts +56 -0
- package/mobile/src/retail/utils/filterPaymentSystems.ts +14 -0
- package/mobile/src/retail/utils/hasDelivery.ts +22 -0
- package/mobile/src/ui-kit/Select/useSelectPopup.tsx +0 -7
- package/mobile/src/utils/getSlugFromUrl.ts +10 -0
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +14 -5
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +32 -3
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +6 -0
- package/src/icons/IconName.ts +4 -4
- package/src/retail/api/createUserTaskDebit.ts +1 -0
- package/src/retail/api/getClaimChannel.ts +18 -0
- package/src/retail/components/Fields/AddressRetailField.tsx +26 -0
- package/src/retail/components/Fields/CreditCalcField.tsx +1 -1
- package/src/retail/components/Fields/PaymentSystemField.tsx +21 -2
- package/src/retail/components/Fields/RegionRetailField.tsx +22 -7
- package/src/retail/hooks/useBiblioglobusDefaultRegion.ts +56 -0
- package/src/retail/utils/filterPaymentSystems.ts +14 -0
- package/src/retail/utils/hasDelivery.ts +22 -0
- package/src/ui-kit/Select/useSelectPopup.tsx +0 -7
- package/src/utils/getSlugFromUrl.ts +10 -0
|
@@ -8,6 +8,7 @@ import { createDraftTask } from '../../retail/api/createDraftTask';
|
|
|
8
8
|
import { createParticipant } from '../../retail/api/createParticipant';
|
|
9
9
|
import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
10
10
|
import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
|
|
11
|
+
import { getClaimChannel } from '../../retail/api/getClaimChannel';
|
|
11
12
|
import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
|
|
12
13
|
import { getTaskById } from '../../retail/api/getTaskById';
|
|
13
14
|
import { saveReferalInfo } from '../../retail/api/saveReferalInfo';
|
|
@@ -18,9 +19,11 @@ import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDial
|
|
|
18
19
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
19
20
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
20
21
|
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
22
|
+
import { BIBLIOGLOBUS_SLUG } from '../../retail/utils/filterPaymentSystems';
|
|
21
23
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
22
24
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
23
25
|
import { formatPhone } from '../../utils/formatPhone';
|
|
26
|
+
import { getCardSlugFromUrl } from '../../utils/getSlugFromUrl';
|
|
24
27
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
25
28
|
import { productTypeToConsentsMap } from './consents';
|
|
26
29
|
import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
|
|
@@ -76,6 +79,7 @@ export const useApplicationLeadApi = ({
|
|
|
76
79
|
|
|
77
80
|
const referalData = leadFormStore.referalData;
|
|
78
81
|
const marketingInfo = sessionStore.marketingInfo;
|
|
82
|
+
const referrerUrl = sessionStore.referrerUrl;
|
|
79
83
|
|
|
80
84
|
if (!profileId) {
|
|
81
85
|
throw new Error();
|
|
@@ -91,6 +95,7 @@ export const useApplicationLeadApi = ({
|
|
|
91
95
|
marketingInfo,
|
|
92
96
|
saveUserData,
|
|
93
97
|
sendAspects,
|
|
98
|
+
referrerUrl,
|
|
94
99
|
});
|
|
95
100
|
verifyPhoneDialog.close();
|
|
96
101
|
if (productType === 'debitCard') {
|
|
@@ -214,6 +219,18 @@ const getAcceptedConsents = (formData: LeadFormState, productType: ProductType):
|
|
|
214
219
|
.map((_) => consents[_]?.text);
|
|
215
220
|
};
|
|
216
221
|
|
|
222
|
+
// Padding line to fix eslint padding-line-between-statements
|
|
223
|
+
|
|
224
|
+
const computeClaimChannel = async (slug: string | null): Promise<string | undefined> => {
|
|
225
|
+
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const claimData = await getClaimChannel();
|
|
230
|
+
|
|
231
|
+
return claimData.find((item) => item.key === slug)?.code;
|
|
232
|
+
};
|
|
233
|
+
|
|
217
234
|
const updateUserData = async ({
|
|
218
235
|
programId,
|
|
219
236
|
profileId,
|
|
@@ -223,6 +240,7 @@ const updateUserData = async ({
|
|
|
223
240
|
marketingInfo,
|
|
224
241
|
saveUserData,
|
|
225
242
|
sendAspects,
|
|
243
|
+
referrerUrl,
|
|
226
244
|
}: {
|
|
227
245
|
programId: string;
|
|
228
246
|
profileId: number;
|
|
@@ -232,17 +250,27 @@ const updateUserData = async ({
|
|
|
232
250
|
marketingInfo: MarketingInfo | null;
|
|
233
251
|
saveUserData: (userData: UserData) => void;
|
|
234
252
|
sendAspects: (profileId: number, taskId: number) => void;
|
|
253
|
+
referrerUrl: string | null;
|
|
235
254
|
}) => {
|
|
236
|
-
let taskId: number;
|
|
237
|
-
let participantId: number;
|
|
238
255
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
256
|
+
const slug = getCardSlugFromUrl(referrerUrl as string);
|
|
239
257
|
|
|
240
258
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
241
259
|
|
|
242
260
|
try {
|
|
261
|
+
let taskId: number;
|
|
262
|
+
let participantId: number;
|
|
263
|
+
|
|
243
264
|
if (productType === 'debitCard') {
|
|
265
|
+
const claimChannelCode = await computeClaimChannel(slug);
|
|
266
|
+
|
|
244
267
|
const debitData = await createUserTaskDebit(
|
|
245
|
-
getDebitLeadFormTaskData(
|
|
268
|
+
getDebitLeadFormTaskData({
|
|
269
|
+
formData,
|
|
270
|
+
programId,
|
|
271
|
+
marketingInfo,
|
|
272
|
+
claimChannelCode,
|
|
273
|
+
}),
|
|
246
274
|
);
|
|
247
275
|
|
|
248
276
|
taskId = debitData.taskId;
|
|
@@ -265,6 +293,7 @@ const updateUserData = async ({
|
|
|
265
293
|
}),
|
|
266
294
|
);
|
|
267
295
|
}
|
|
296
|
+
|
|
268
297
|
if (referalData?.referalCode) {
|
|
269
298
|
await saveReferalInfo({
|
|
270
299
|
taskId,
|
|
@@ -25,6 +25,7 @@ type InitApplicationLeadProps = {
|
|
|
25
25
|
export interface ApplicationLeadStore {
|
|
26
26
|
marketingInfo: MarketingInfo | null;
|
|
27
27
|
isNewMicroservice: boolean | null;
|
|
28
|
+
referrerUrl: string | null;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export const useInitApplicationLead = ({
|
|
@@ -78,6 +79,11 @@ export const useInitApplicationLead = ({
|
|
|
78
79
|
|
|
79
80
|
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
80
81
|
sessionStore.isNewMicroservice = isNewMicroservice || null;
|
|
82
|
+
|
|
83
|
+
const referrer = globalThis.document.referrer;
|
|
84
|
+
if (referrer) {
|
|
85
|
+
sessionStore.referrerUrl = referrer as string;
|
|
86
|
+
}
|
|
81
87
|
}, [queryFromStorage]);
|
|
82
88
|
|
|
83
89
|
useEffect(() => {
|
package/src/icons/IconName.ts
CHANGED
|
@@ -7,11 +7,11 @@ export const IconsWithoutInversion = new Set([
|
|
|
7
7
|
]);
|
|
8
8
|
|
|
9
9
|
export enum IconMap {
|
|
10
|
-
YoutubeIcon = 'YoutubeIcon', WalletWithMoneyIcon = 'WalletWithMoneyIcon', WalletIcon = 'WalletIcon', WalletAddIcon = 'WalletAddIcon', VKIcon = 'VKIcon', UserTickIcon = 'UserTickIcon', UserSquareIcon = 'UserSquareIcon', UserGeoLocationIcon = 'UserGeoLocationIcon', TelegramIcon = 'TelegramIcon', StarIcon = 'StarIcon', SoundIcon = 'SoundIcon', SmallClockIcon = 'SmallClockIcon', SignDocsIcon = 'SignDocsIcon', ShieldTickIcon = 'ShieldTickIcon', SecurityСardIcon = 'SecurityСardIcon', SafeIcon = 'SafeIcon', RutubeIcon = 'RutubeIcon', RustoreIcon = 'RustoreIcon', RoundRubleIcon = 'RoundRubleIcon', ResponseOKIcon = 'ResponseOKIcon', ResponseFailIcon = 'ResponseFailIcon', RefreshIcon = 'RefreshIcon', ProfileIcon = 'ProfileIcon', Profile2UserIcon = 'Profile2UserIcon', PlusIcon = 'PlusIcon', PlusCircleIcon = 'PlusCircleIcon', PlayMarketIcon = 'PlayMarketIcon', PhoneIcon = 'PhoneIcon', PhoneCallingIcon = 'PhoneCallingIcon', PersonalCardIcon = 'PersonalCardIcon',
|
|
10
|
+
YoutubeIcon = 'YoutubeIcon', WalletWithMoneyIcon = 'WalletWithMoneyIcon', WalletIcon = 'WalletIcon', WalletAddIcon = 'WalletAddIcon', VKIcon = 'VKIcon', UserTickIcon = 'UserTickIcon', UserSquareIcon = 'UserSquareIcon', UserGeoLocationIcon = 'UserGeoLocationIcon', TelegramIcon = 'TelegramIcon', StarIcon = 'StarIcon', SoundIcon = 'SoundIcon', SmallClockIcon = 'SmallClockIcon', SignDocsIcon = 'SignDocsIcon', ShieldTickIcon = 'ShieldTickIcon', SecurityСardIcon = 'SecurityСardIcon', SafeIcon = 'SafeIcon', RutubeIcon = 'RutubeIcon', RustoreIcon = 'RustoreIcon', RoundRubleIcon = 'RoundRubleIcon', ResponseOKIcon = 'ResponseOKIcon', ResponseFailIcon = 'ResponseFailIcon', RefreshIcon = 'RefreshIcon', ProfileIcon = 'ProfileIcon', Profile2UserIcon = 'Profile2UserIcon', PlusIcon = 'PlusIcon', PlusCircleIcon = 'PlusCircleIcon', PlayMarketIcon = 'PlayMarketIcon', PhoneIcon = 'PhoneIcon', PhoneCallingIcon = 'PhoneCallingIcon', PersonalCardIcon = 'PersonalCardIcon', PercentIcon = 'PercentIcon', PercentageRoundIcon = 'PercentageRoundIcon', PassSendIcon = 'PassSendIcon', PackA4Icon = 'PackA4Icon', OkIcon = 'OkIcon', NotificationBingIcon = 'NotificationBingIcon', NewLoanIcon = 'NewLoanIcon', NewDocIcon = 'NewDocIcon', MonitorMobileIcon = 'MonitorMobileIcon', MoneyInsuranceIcon = 'MoneyInsuranceIcon', MoneyIcon = 'MoneyIcon', MinusIcon = 'MinusIcon', MapOpenedIcon = 'MapOpenedIcon', MapMarkerSingleIcon = 'MapMarkerSingleIcon', MapMarkerClusterYellowIcon = 'MapMarkerClusterYellowIcon', MapMarkerClusterIcon = 'MapMarkerClusterIcon', MailIcon = 'MailIcon', MagnifierIcon = 'MagnifierIcon', LoupeIcon = 'LoupeIcon', LogoIcon = 'LogoIcon', LockIcon = 'LockIcon', InfoCircleIcon = 'InfoCircleIcon', HuaweiIcon = 'HuaweiIcon', HouseIcon = 'HouseIcon', HeartTickIcon = 'HeartTickIcon', HeartIcon = 'HeartIcon', HeadphonesIcon = 'HeadphonesIcon', GridIcon = 'GridIcon', GpsIcon = 'GpsIcon', GosUslugiIcon = 'GosUslugiIcon', GlobalIcon = 'GlobalIcon', GeolocationIcon = 'GeolocationIcon', FullScreenIcon = 'FullScreenIcon', FaxIcon = 'FaxIcon', EuroIcon = 'EuroIcon', EmptyWalletIcon = 'EmptyWalletIcon', EmptyWalletChangeIcon = 'EmptyWalletChangeIcon', DzenIcon = 'DzenIcon', DoneSimpleIcon = 'DoneSimpleIcon', DoneIcon = 'DoneIcon', DollarIcon = 'DollarIcon', DocIcon = 'DocIcon', DocDownloadIcon = 'DocDownloadIcon', DiscountShapeIcon = 'DiscountShapeIcon', DevIcon = 'DevIcon', CupIcon = 'CupIcon', CourtHouseIcon = 'CourtHouseIcon', CopyIcon = 'CopyIcon', ConvertCardIcon = 'ConvertCardIcon', CoinIcon = 'CoinIcon', CloseIcon = 'CloseIcon', ClientIcon = 'ClientIcon', ChineseYuanRenminbiIcon = 'ChineseYuanRenminbiIcon', ChevronLeftIcon = 'ChevronLeftIcon', ChatBotIcon = 'ChatBotIcon', ChartSquareIcon = 'ChartSquareIcon', ChartRoundIcon = 'ChartRoundIcon', ChartIcon = 'ChartIcon', CardTickIcon = 'CardTickIcon', CardSendIcon = 'CardSendIcon', CardPosIcon = 'CardPosIcon', CardIcon = 'CardIcon', CallbackIcon = 'CallbackIcon', CalendarTickIcon = 'CalendarTickIcon', CalendarIcon = 'CalendarIcon', CalendarCircleIcon = 'CalendarCircleIcon', BurgerIcon = 'BurgerIcon', BuildingIcon = 'BuildingIcon', BriefcaseIcon = 'BriefcaseIcon', BelarusianFlag = 'BelarusianFlag', BankIcon = 'BankIcon', BankColorIcon = 'BankColorIcon', AtmIcon = 'AtmIcon', ArrowUpSolidIcon = 'ArrowUpSolidIcon', ArrowUpIcon = 'ArrowUpIcon', ArrowTopRightIcon = 'ArrowTopRightIcon', ArrowRightIcon = 'ArrowRightIcon', ArrowLeftIcon = 'ArrowLeftIcon', ArrowDownSolidIcon = 'ArrowDownSolidIcon', ArrowDownIcon = 'ArrowDownIcon', AppleIcon = 'AppleIcon', AlarmIcon = 'AlarmIcon', ActualBalanceIcon = 'ActualBalanceIcon', AchievementIcon = 'AchievementIcon'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export enum IconTitleMap {
|
|
14
|
-
YoutubeIcon = 'Лого «Youtube»', WalletWithMoneyIcon = 'Кошелёк с деньгами', WalletIcon = 'Кошелёк', WalletAddIcon = 'Кошелёк с плюсом', VKIcon = 'Лого «VK»', UserTickIcon = 'Пользователь', UserSquareIcon = 'Пользователь в рамке', UserGeoLocationIcon = 'Самолётик', TelegramIcon = 'Лого «Telegram»', StarIcon = 'Звезда', SoundIcon = 'Кольцо', SmallClockIcon = 'Маленькие часы', SignDocsIcon = 'Подписанные документы', ShieldTickIcon = 'Безопасность', SecurityСardIcon = 'Безопасность', SafeIcon = 'Сейф', RutubeIcon = 'Лого «Rutube»', RustoreIcon = 'Лого «Rustore»', RoundRubleIcon = 'Рубль (круг.)', ResponseOKIcon = 'Ок', ResponseFailIcon = 'Ошибка', RefreshIcon = 'RefreshIcon', ProfileIcon = 'Профиль', Profile2UserIcon = 'Профиль, 2 персоны', PlusIcon = 'Плюс', PlusCircleIcon = 'Плюс в круге', PlayMarketIcon = 'Лого «PlayMarket»', PhoneIcon = 'Телефон', PhoneCallingIcon = 'Звонящий телефон', PersonalCardIcon = 'Персональная карта',
|
|
14
|
+
YoutubeIcon = 'Лого «Youtube»', WalletWithMoneyIcon = 'Кошелёк с деньгами', WalletIcon = 'Кошелёк', WalletAddIcon = 'Кошелёк с плюсом', VKIcon = 'Лого «VK»', UserTickIcon = 'Пользователь', UserSquareIcon = 'Пользователь в рамке', UserGeoLocationIcon = 'Самолётик', TelegramIcon = 'Лого «Telegram»', StarIcon = 'Звезда', SoundIcon = 'Кольцо', SmallClockIcon = 'Маленькие часы', SignDocsIcon = 'Подписанные документы', ShieldTickIcon = 'Безопасность', SecurityСardIcon = 'Безопасность', SafeIcon = 'Сейф', RutubeIcon = 'Лого «Rutube»', RustoreIcon = 'Лого «Rustore»', RoundRubleIcon = 'Рубль (круг.)', ResponseOKIcon = 'Ок', ResponseFailIcon = 'Ошибка', RefreshIcon = 'RefreshIcon', ProfileIcon = 'Профиль', Profile2UserIcon = 'Профиль, 2 персоны', PlusIcon = 'Плюс', PlusCircleIcon = 'Плюс в круге', PlayMarketIcon = 'Лого «PlayMarket»', PhoneIcon = 'Телефон', PhoneCallingIcon = 'Звонящий телефон', PersonalCardIcon = 'Персональная карта', PercentIcon = 'Проценты', PercentageRoundIcon = 'Проценты (круг.)', PassSendIcon = 'Бизнес', PackA4Icon = 'Пачка бумаги А4', OkIcon = 'Лого «Одноклассники»', NotificationBingIcon = 'Колокольчик нотификаций', NewLoanIcon = 'Новая заявка', NewDocIcon = 'Новый документ', MonitorMobileIcon = 'Монитор и мобильный', MoneyInsuranceIcon = 'Денежное страхование', MoneyIcon = 'Деньги', MinusIcon = 'Минус', MapOpenedIcon = 'Иконка Развёрнутая карта', MapMarkerSingleIcon = 'Маркер карты РСХБ', MapMarkerClusterYellowIcon = 'Маркер карты (желтый)', MapMarkerClusterIcon = 'Маркер карты', MailIcon = 'E-mail', MagnifierIcon = 'MagnifierIcon', LoupeIcon = 'Лупа', LogoIcon = 'Логотип', LockIcon = 'Замок', InfoCircleIcon = 'InfoCircleIcon', HuaweiIcon = 'Лого «Huawei»', HouseIcon = 'Ипотека', HeartTickIcon = 'Сердцебеение', HeartIcon = 'Сердце', HeadphonesIcon = 'HeadphonesIcon', GridIcon = 'Сетка (белая)', GpsIcon = 'Gps', GosUslugiIcon = 'ГосУслуги', GlobalIcon = 'Глобус', GeolocationIcon = 'Геолокация', FullScreenIcon = 'FullScreenIcon', FaxIcon = 'Факс', EuroIcon = 'Евро', EmptyWalletIcon = 'Пустой кошелёк', EmptyWalletChangeIcon = 'Пустой кошелёк с возвратом', DzenIcon = 'Лого «Дзен»', DoneSimpleIcon = 'Зелёная \'галочка\'', DoneIcon = 'Зелёная \'галочка\' в круге', DollarIcon = 'Доллар', DocIcon = 'Документ', DocDownloadIcon = 'Скачать документ', DiscountShapeIcon = 'Скидка', DevIcon = 'Разработка', CupIcon = 'Кубок', CourtHouseIcon = 'Здание суда', CopyIcon = 'Копирование', ConvertCardIcon = 'Конвертирование', CoinIcon = 'Монеты', CloseIcon = 'Крестик', ClientIcon = 'Клиент', ChineseYuanRenminbiIcon = 'Китайский юань', ChevronLeftIcon = 'Стрелка \'Влево\'', ChatBotIcon = 'Чат-бот', ChartSquareIcon = 'Деньги внутри кошелька', ChartRoundIcon = 'Диаграмма (в круге)', ChartIcon = 'Инвестиции', CardTickIcon = 'Кред. карта с галочкой', CardSendIcon = 'Карта', CardPosIcon = 'Кред. карта под наклоном', CardIcon = 'Кред. карта', CallbackIcon = 'Телефон', CalendarTickIcon = 'Календарь с галочкой', CalendarIcon = 'Календарь', CalendarCircleIcon = 'Скруглённый календарь', BurgerIcon = 'Бургер', BuildingIcon = 'Здание с деревом', BriefcaseIcon = 'Портфель', BelarusianFlag = 'Белорусский флаг', BankIcon = 'Банк', BankColorIcon = 'Банк (в цвете)', AtmIcon = 'Банкомат', ArrowUpSolidIcon = 'Стрелка сплошная \'Вверх\'', ArrowUpIcon = 'Стрелка \'Вверх\'', ArrowTopRightIcon = 'Стрелка \'Вверх-право\'', ArrowRightIcon = 'Стрелка \'Вправо\'', ArrowLeftIcon = 'Стрелка \'Влево\'', ArrowDownSolidIcon = 'Стрелка сплошная \'Вниз\'', ArrowDownIcon = 'Стрелка \'Вниз\'', AppleIcon = 'Лого «Apple»', AlarmIcon = 'Предупреждение', ActualBalanceIcon = 'Деньги', AchievementIcon = 'Достижение'
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -19,7 +19,7 @@ export enum IconTitleMap {
|
|
|
19
19
|
* @title Иконка
|
|
20
20
|
* @enumNames [
|
|
21
21
|
* "",
|
|
22
|
-
* 'Лого «Youtube»', 'Кошелёк с деньгами', 'Кошелёк', 'Кошелёк с плюсом', 'Лого «VK»', 'Пользователь', 'Пользователь в рамке', 'Самолётик', 'Лого «Telegram»', 'Звезда', 'Кольцо', 'Маленькие часы', 'Подписанные документы', 'Безопасность', 'Безопасность', 'Сейф', 'Лого «Rutube»', 'Лого «Rustore»', 'Рубль (круг.)', 'Ок', 'Ошибка', 'RefreshIcon', 'Профиль', 'Профиль, 2 персоны', 'Плюс', 'Плюс в круге', 'Лого «PlayMarket»', 'Телефон', 'Звонящий телефон', 'Персональная карта', 'Проценты
|
|
22
|
+
* 'Лого «Youtube»', 'Кошелёк с деньгами', 'Кошелёк', 'Кошелёк с плюсом', 'Лого «VK»', 'Пользователь', 'Пользователь в рамке', 'Самолётик', 'Лого «Telegram»', 'Звезда', 'Кольцо', 'Маленькие часы', 'Подписанные документы', 'Безопасность', 'Безопасность', 'Сейф', 'Лого «Rutube»', 'Лого «Rustore»', 'Рубль (круг.)', 'Ок', 'Ошибка', 'RefreshIcon', 'Профиль', 'Профиль, 2 персоны', 'Плюс', 'Плюс в круге', 'Лого «PlayMarket»', 'Телефон', 'Звонящий телефон', 'Персональная карта', 'Проценты', 'Проценты (круг.)', 'Бизнес', 'Пачка бумаги А4', 'Лого «Одноклассники»', 'Колокольчик нотификаций', 'Новая заявка', 'Новый документ', 'Монитор и мобильный', 'Денежное страхование', 'Деньги', 'Минус', 'Иконка Развёрнутая карта', 'Маркер карты РСХБ', 'Маркер карты (желтый)', 'Маркер карты', 'E-mail', 'MagnifierIcon', 'Лупа', 'Логотип', 'Замок', 'InfoCircleIcon', 'Лого «Huawei»', 'Ипотека', 'Сердцебеение', 'Сердце', 'HeadphonesIcon', 'Сетка (белая)', 'Gps', 'ГосУслуги', 'Глобус', 'Геолокация', 'FullScreenIcon', 'Факс', 'Евро', 'Пустой кошелёк', 'Пустой кошелёк с возвратом', 'Лого «Дзен»', 'Зелёная \'галочка\'', 'Зелёная \'галочка\' в круге', 'Доллар', 'Документ', 'Скачать документ', 'Скидка', 'Разработка', 'Кубок', 'Здание суда', 'Копирование', 'Конвертирование', 'Монеты', 'Крестик', 'Клиент', 'Китайский юань', 'Стрелка \'Влево\'', 'Чат-бот', 'Деньги внутри кошелька', 'Диаграмма (в круге)', 'Инвестиции', 'Кред. карта с галочкой', 'Карта', 'Кред. карта под наклоном', 'Кред. карта', 'Телефон', 'Календарь с галочкой', 'Календарь', 'Скруглённый календарь', 'Бургер', 'Здание с деревом', 'Портфель', 'Белорусский флаг', 'Банк', 'Банк (в цвете)', 'Банкомат', 'Стрелка сплошная \'Вверх\'', 'Стрелка \'Вверх\'', 'Стрелка \'Вверх-право\'', 'Стрелка \'Вправо\'', 'Стрелка \'Влево\'', 'Стрелка сплошная \'Вниз\'', 'Стрелка \'Вниз\'', 'Лого «Apple»', 'Предупреждение', 'Деньги', 'Достижение'
|
|
23
23
|
* ]
|
|
24
24
|
*/
|
|
25
|
-
export type IconName = '' | 'YoutubeIcon' | 'WalletWithMoneyIcon' | 'WalletIcon' | 'WalletAddIcon' | 'VKIcon' | 'UserTickIcon' | 'UserSquareIcon' | 'UserGeoLocationIcon' | 'TelegramIcon' | 'StarIcon' | 'SoundIcon' | 'SmallClockIcon' | 'SignDocsIcon' | 'ShieldTickIcon' | 'SecurityСardIcon' | 'SafeIcon' | 'RutubeIcon' | 'RustoreIcon' | 'RoundRubleIcon' | 'ResponseOKIcon' | 'ResponseFailIcon' | 'RefreshIcon' | 'ProfileIcon' | 'Profile2UserIcon' | 'PlusIcon' | 'PlusCircleIcon' | 'PlayMarketIcon' | 'PhoneIcon' | 'PhoneCallingIcon' | 'PersonalCardIcon' | '
|
|
25
|
+
export type IconName = '' | 'YoutubeIcon' | 'WalletWithMoneyIcon' | 'WalletIcon' | 'WalletAddIcon' | 'VKIcon' | 'UserTickIcon' | 'UserSquareIcon' | 'UserGeoLocationIcon' | 'TelegramIcon' | 'StarIcon' | 'SoundIcon' | 'SmallClockIcon' | 'SignDocsIcon' | 'ShieldTickIcon' | 'SecurityСardIcon' | 'SafeIcon' | 'RutubeIcon' | 'RustoreIcon' | 'RoundRubleIcon' | 'ResponseOKIcon' | 'ResponseFailIcon' | 'RefreshIcon' | 'ProfileIcon' | 'Profile2UserIcon' | 'PlusIcon' | 'PlusCircleIcon' | 'PlayMarketIcon' | 'PhoneIcon' | 'PhoneCallingIcon' | 'PersonalCardIcon' | 'PercentIcon' | 'PercentageRoundIcon' | 'PassSendIcon' | 'PackA4Icon' | 'OkIcon' | 'NotificationBingIcon' | 'NewLoanIcon' | 'NewDocIcon' | 'MonitorMobileIcon' | 'MoneyInsuranceIcon' | 'MoneyIcon' | 'MinusIcon' | 'MapOpenedIcon' | 'MapMarkerSingleIcon' | 'MapMarkerClusterYellowIcon' | 'MapMarkerClusterIcon' | 'MailIcon' | 'MagnifierIcon' | 'LoupeIcon' | 'LogoIcon' | 'LockIcon' | 'InfoCircleIcon' | 'HuaweiIcon' | 'HouseIcon' | 'HeartTickIcon' | 'HeartIcon' | 'HeadphonesIcon' | 'GridIcon' | 'GpsIcon' | 'GosUslugiIcon' | 'GlobalIcon' | 'GeolocationIcon' | 'FullScreenIcon' | 'FaxIcon' | 'EuroIcon' | 'EmptyWalletIcon' | 'EmptyWalletChangeIcon' | 'DzenIcon' | 'DoneSimpleIcon' | 'DoneIcon' | 'DollarIcon' | 'DocIcon' | 'DocDownloadIcon' | 'DiscountShapeIcon' | 'DevIcon' | 'CupIcon' | 'CourtHouseIcon' | 'CopyIcon' | 'ConvertCardIcon' | 'CoinIcon' | 'CloseIcon' | 'ClientIcon' | 'ChineseYuanRenminbiIcon' | 'ChevronLeftIcon' | 'ChatBotIcon' | 'ChartSquareIcon' | 'ChartRoundIcon' | 'ChartIcon' | 'CardTickIcon' | 'CardSendIcon' | 'CardPosIcon' | 'CardIcon' | 'CallbackIcon' | 'CalendarTickIcon' | 'CalendarIcon' | 'CalendarCircleIcon' | 'BurgerIcon' | 'BuildingIcon' | 'BriefcaseIcon' | 'BelarusianFlag' | 'BankIcon' | 'BankColorIcon' | 'AtmIcon' | 'ArrowUpSolidIcon' | 'ArrowUpIcon' | 'ArrowTopRightIcon' | 'ArrowRightIcon' | 'ArrowLeftIcon' | 'ArrowDownSolidIcon' | 'ArrowDownIcon' | 'AppleIcon' | 'AlarmIcon' | 'ActualBalanceIcon' | 'AchievementIcon';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { fetchRetailJSON } from './doRequest';
|
|
2
|
+
|
|
3
|
+
export type GetClaimChannelResponse = {
|
|
4
|
+
code: string;
|
|
5
|
+
deliveryEmail: string;
|
|
6
|
+
description: string;
|
|
7
|
+
id: number;
|
|
8
|
+
key: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const getClaimChannel = async (): Promise<GetClaimChannelResponse[]> => {
|
|
12
|
+
const res = await fetchRetailJSON<GetClaimChannelResponse[]>(
|
|
13
|
+
'light-api-cash/v1/claimChannel/',
|
|
14
|
+
'GET',
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
return res || ([] as GetClaimChannelResponse[]);
|
|
18
|
+
};
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
3
4
|
import { getOfficePoint } from '../../../components/OfficesAtmsMap/renderOfficeCard';
|
|
4
5
|
import { useOfficesAtmsMapData } from '../../../components/OfficesAtmsMap/useOfficesAtmsMapData';
|
|
5
6
|
import { ClientOnly } from '../../../ui-kit/ClientOnly';
|
|
6
7
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
7
8
|
import { SelectControl } from '../../../ui-kit/Select/SelectControl';
|
|
8
9
|
import { YandexMap } from '../../../ui-kit/YandexMap/YandexMap';
|
|
10
|
+
import { getCardSlugFromUrl } from '../../../utils/getSlugFromUrl';
|
|
9
11
|
import { fetchRegionOffices, type OfficeType } from '../../api/regionOffices';
|
|
10
12
|
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
13
|
+
import { BIBLIOGLOBUS_SLUG } from '../../utils/filterPaymentSystems';
|
|
14
|
+
|
|
15
|
+
const BIBLIOGLOBUS_OFFICE_ID = '714680716';
|
|
11
16
|
|
|
12
17
|
export const AddressRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
13
18
|
const [offices, setOffices] = useState<OfficeType[]>([]);
|
|
14
19
|
const { data } = useLeadFormData('REGION_RF');
|
|
15
20
|
|
|
21
|
+
const sessionStore = useSessionStore<{ referrerUrl?: string }>();
|
|
22
|
+
const referrerUrl = sessionStore.referrerUrl;
|
|
23
|
+
|
|
16
24
|
const regionValue = field('regionRetail')?.value || {};
|
|
17
25
|
const addressField = field(input?.name ?? '');
|
|
18
26
|
|
|
@@ -27,6 +35,24 @@ export const AddressRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
27
35
|
}
|
|
28
36
|
}, [regionValue.key]);
|
|
29
37
|
|
|
38
|
+
// Логика для biblioglobus - выбор отделения по умолчанию
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!referrerUrl || !offices.length) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const slug = getCardSlugFromUrl(referrerUrl);
|
|
45
|
+
if (slug === BIBLIOGLOBUS_SLUG) {
|
|
46
|
+
const defaultOffice = offices.find(
|
|
47
|
+
(office) => office.id?.toString() === BIBLIOGLOBUS_OFFICE_ID,
|
|
48
|
+
);
|
|
49
|
+
addressField.onChange?.({
|
|
50
|
+
key: defaultOffice?.id?.toString() || '',
|
|
51
|
+
text: defaultOffice?.address || '',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, [referrerUrl, offices]);
|
|
55
|
+
|
|
30
56
|
const { points } = useOfficesAtmsMapData({
|
|
31
57
|
data: offices,
|
|
32
58
|
filtrationState: {},
|
|
@@ -14,7 +14,7 @@ export const CreditCalcField = JSX<CustomFieldProps>(({ field, params }) => {
|
|
|
14
14
|
const defaultParams = calcValue
|
|
15
15
|
? defaultValueAdapter(field(FIELD_NAME).value as CreditCalculatorUserInputParams)
|
|
16
16
|
: params?.calcData?.defaultParams;
|
|
17
|
-
const defaultCalcSum = defaultParams?.sum ?? 0;
|
|
17
|
+
const defaultCalcSum = params?.calcData?.defaultParams?.sum ?? 0;
|
|
18
18
|
|
|
19
19
|
const handleChange = useCallback((_: CreditCalculatorUserInputParams) => {
|
|
20
20
|
field(FIELD_NAME).onChange?.(_);
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useLocalStore } from '@redneckz/uni-jsx/lib/Store/useLocalStore';
|
|
4
|
+
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
4
5
|
import { useAsyncEffect } from '../../../hooks/useAsyncEffect';
|
|
5
6
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
6
7
|
import { RadioButtonGroupControl } from '../../../ui-kit/RadioButtonGroup/RadioButtonGroupControl';
|
|
7
8
|
import { type Option } from '../../../ui-kit/Select/Option';
|
|
9
|
+
import { getCardSlugFromUrl } from '../../../utils/getSlugFromUrl';
|
|
8
10
|
import { getPaymentSystems } from '../../api/getPaymentSystems';
|
|
11
|
+
import { filterPaymentSystems } from '../../utils/filterPaymentSystems';
|
|
9
12
|
|
|
10
13
|
const optionKey = (option: { key?: string } | undefined) => option?.key;
|
|
11
14
|
|
|
@@ -13,12 +16,28 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
13
16
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState<Option[]>([]);
|
|
14
17
|
|
|
15
18
|
const localStore = useLocalStore<{ programId: string }>();
|
|
19
|
+
const sessionStore = useSessionStore<{ referrerUrl?: string }>();
|
|
20
|
+
|
|
16
21
|
useAsyncEffect(async () => {
|
|
17
22
|
const { programId } = localStore;
|
|
18
|
-
if (programId) {
|
|
19
|
-
|
|
23
|
+
if (!programId) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
28
|
+
|
|
29
|
+
const referrerUrl = sessionStore.referrerUrl;
|
|
30
|
+
|
|
31
|
+
if (!referrerUrl) {
|
|
20
32
|
setPaymentSystemOptions(fetchedPaymentSystems ?? []);
|
|
33
|
+
|
|
34
|
+
return;
|
|
21
35
|
}
|
|
36
|
+
|
|
37
|
+
const slug = getCardSlugFromUrl(referrerUrl);
|
|
38
|
+
const filteredSystems = filterPaymentSystems(fetchedPaymentSystems ?? [], slug);
|
|
39
|
+
|
|
40
|
+
setPaymentSystemOptions(filteredSystems);
|
|
22
41
|
}, []);
|
|
23
42
|
|
|
24
43
|
const items = useMemo(
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
4
|
+
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
4
5
|
import { type ProductType } from '../../../components/ApplicationLeadForm/ApplicationLeadFormContent';
|
|
5
6
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
6
7
|
import { type Option } from '../../../ui-kit/Select/Option';
|
|
7
8
|
import { SelectControl } from '../../../ui-kit/Select/SelectControl';
|
|
8
9
|
import { getRegionsCardDelivery } from '../../api/getRegionsCardDelivery';
|
|
10
|
+
import { useBiblioglobusDefaultRegion } from '../../hooks/useBiblioglobusDefaultRegion';
|
|
9
11
|
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
10
12
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
13
|
+
import { calculateRegionHasDelivery, getRegionDeliveryStatus } from '../../utils/hasDelivery';
|
|
11
14
|
|
|
12
15
|
export const RegionRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
13
16
|
const { programId, productType } = useRetailFormStore();
|
|
14
17
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
15
18
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
16
19
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
20
|
+
const sessionStore = useSessionStore<{ referrerUrl?: string }>();
|
|
21
|
+
|
|
17
22
|
const isDebit = productType === 'debitCard';
|
|
18
23
|
const isSalaryCard = programId === '38';
|
|
19
24
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
@@ -24,20 +29,30 @@ export const RegionRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
24
29
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
25
30
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
26
31
|
|
|
32
|
+
useBiblioglobusDefaultRegion({
|
|
33
|
+
referrerUrl: sessionStore.referrerUrl ?? undefined,
|
|
34
|
+
regions,
|
|
35
|
+
regionsDelivery,
|
|
36
|
+
onRegionChange: handleChangeRegion,
|
|
37
|
+
onRegionHasDeliveryChange: handleChangeRegionHasDelivery,
|
|
38
|
+
onMethodObtainChange: handleChangeMethodObtain,
|
|
39
|
+
});
|
|
40
|
+
|
|
27
41
|
const onChange = useCallback(
|
|
28
42
|
(value: Option) => {
|
|
29
|
-
const regionHasDelivery =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
:
|
|
43
|
+
const regionHasDelivery = calculateRegionHasDelivery({
|
|
44
|
+
isDebit,
|
|
45
|
+
isEsiaAuth,
|
|
46
|
+
isSalaryCard,
|
|
47
|
+
isDeliveryActive,
|
|
48
|
+
regionDelivery: getRegionDeliveryStatus(regionsDelivery, value),
|
|
49
|
+
});
|
|
35
50
|
|
|
36
51
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
37
52
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
38
53
|
handleChangeRegion?.(value);
|
|
39
54
|
},
|
|
40
|
-
[
|
|
55
|
+
[calculateRegionHasDelivery],
|
|
41
56
|
);
|
|
42
57
|
|
|
43
58
|
useEffect(() => {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
3
|
+
import { getCardSlugFromUrl } from '../../utils/getSlugFromUrl';
|
|
4
|
+
import { type DictionaryItem } from '../model/LeadFormData';
|
|
5
|
+
import { BIBLIOGLOBUS_SLUG } from '../utils/filterPaymentSystems';
|
|
6
|
+
|
|
7
|
+
export type RegionDelivery = { regionCode: string; deliveryFlg: boolean };
|
|
8
|
+
|
|
9
|
+
export const useBiblioglobusDefaultRegion = (args: {
|
|
10
|
+
referrerUrl?: string;
|
|
11
|
+
regions?: DictionaryItem[];
|
|
12
|
+
regionsDelivery?: RegionDelivery[];
|
|
13
|
+
onRegionChange?: (option: Option) => void;
|
|
14
|
+
onRegionHasDeliveryChange?: (value: boolean) => void;
|
|
15
|
+
onMethodObtainChange?: (value: string) => void;
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
referrerUrl,
|
|
19
|
+
regions,
|
|
20
|
+
regionsDelivery,
|
|
21
|
+
onRegionChange,
|
|
22
|
+
onRegionHasDeliveryChange,
|
|
23
|
+
onMethodObtainChange,
|
|
24
|
+
} = args;
|
|
25
|
+
|
|
26
|
+
const slug = referrerUrl ? getCardSlugFromUrl(referrerUrl) : '';
|
|
27
|
+
const defaultRegion = regions?.find((region) => region.key === 'REGION_77');
|
|
28
|
+
const regionHasDelivery = Boolean(
|
|
29
|
+
regionsDelivery?.find((rd) => rd.regionCode === 'REGION_77')?.deliveryFlg,
|
|
30
|
+
);
|
|
31
|
+
const isReady = Boolean(
|
|
32
|
+
referrerUrl &&
|
|
33
|
+
regions &&
|
|
34
|
+
regionsDelivery &&
|
|
35
|
+
slug === BIBLIOGLOBUS_SLUG &&
|
|
36
|
+
defaultRegion?.key &&
|
|
37
|
+
defaultRegion?.value,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!isReady || !defaultRegion || !defaultRegion.key || !defaultRegion.value) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
onRegionChange?.({ key: defaultRegion.key, text: defaultRegion.value });
|
|
46
|
+
onRegionHasDeliveryChange?.(regionHasDelivery);
|
|
47
|
+
onMethodObtainChange?.(regionHasDelivery ? 'courier' : 'office');
|
|
48
|
+
}, [
|
|
49
|
+
isReady,
|
|
50
|
+
defaultRegion,
|
|
51
|
+
regionHasDelivery,
|
|
52
|
+
onRegionChange,
|
|
53
|
+
onRegionHasDeliveryChange,
|
|
54
|
+
onMethodObtainChange,
|
|
55
|
+
]);
|
|
56
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
2
|
+
|
|
3
|
+
const BIBLIOGLOBUS_SLUG = 'biblioglobus';
|
|
4
|
+
const UNIONPAY_TEXT = 'UnionPay';
|
|
5
|
+
|
|
6
|
+
export const filterPaymentSystems = (systems: Option[], slug: string | null): Option[] => {
|
|
7
|
+
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
8
|
+
return systems;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return systems.filter((system) => system.text === UNIONPAY_TEXT);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { BIBLIOGLOBUS_SLUG };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
2
|
+
import { type RegionDelivery } from '../hooks/useBiblioglobusDefaultRegion';
|
|
3
|
+
|
|
4
|
+
export const getRegionDeliveryStatus = (
|
|
5
|
+
regionsDelivery: RegionDelivery[] | undefined,
|
|
6
|
+
value: Option,
|
|
7
|
+
) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
|
|
8
|
+
|
|
9
|
+
export const calculateRegionHasDelivery = (args: {
|
|
10
|
+
isDebit: boolean;
|
|
11
|
+
isEsiaAuth: boolean;
|
|
12
|
+
isSalaryCard: boolean;
|
|
13
|
+
isDeliveryActive: boolean;
|
|
14
|
+
regionDelivery?: boolean;
|
|
15
|
+
}) => {
|
|
16
|
+
const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
|
|
17
|
+
if (isDebit) {
|
|
18
|
+
return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return isDeliveryActive && regionDelivery;
|
|
22
|
+
};
|
|
@@ -8,7 +8,6 @@ import { SelectPopup, type SelectPopupProps } from './SelectPopup';
|
|
|
8
8
|
|
|
9
9
|
interface SelectPopupOptions extends SelectPopupProps, OnCloseProps {
|
|
10
10
|
isOpen?: boolean;
|
|
11
|
-
onChangeQuery?: (value: string) => void;
|
|
12
11
|
disableFilterOptions?: boolean;
|
|
13
12
|
isSearch?: boolean;
|
|
14
13
|
}
|
|
@@ -24,7 +23,6 @@ export function useSelectPopup({
|
|
|
24
23
|
disableFilterOptions = false,
|
|
25
24
|
onChangeQuery = noop,
|
|
26
25
|
renderOptions,
|
|
27
|
-
isSearch = false,
|
|
28
26
|
}: SelectPopupOptions) {
|
|
29
27
|
const popup = usePopupManager();
|
|
30
28
|
|
|
@@ -37,15 +35,10 @@ export function useSelectPopup({
|
|
|
37
35
|
(option: Option) => {
|
|
38
36
|
close();
|
|
39
37
|
onChange(option);
|
|
40
|
-
onChangeQuery(isSearch && option?.text ? option.text : '');
|
|
41
38
|
},
|
|
42
39
|
[close, onChange],
|
|
43
40
|
);
|
|
44
41
|
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
onChangeQuery(isSearch && value?.text ? value.text : '');
|
|
47
|
-
}, [value]);
|
|
48
|
-
|
|
49
42
|
const inputRef = useRef<HTMLDivElement | null>(null);
|
|
50
43
|
const popupRef = useOutsideClick<HTMLDivElement>(close);
|
|
51
44
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function getCardSlugFromUrl(url: string): string | null {
|
|
2
|
+
const lastSegment = url.split('/').filter(Boolean).pop();
|
|
3
|
+
if (!lastSegment) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const parts = lastSegment.split('-');
|
|
8
|
+
|
|
9
|
+
return parts.length > 1 ? parts[parts.length - 1] : null;
|
|
10
|
+
}
|