hl-core 0.0.8 → 0.0.9-beta.10
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/api/index.ts +202 -161
- package/api/interceptors.ts +23 -17
- package/components/Button/Btn.vue +4 -4
- package/components/Button/ScrollButtons.vue +2 -2
- package/components/Complex/ContentBlock.vue +1 -1
- package/components/Complex/MessageBlock.vue +26 -0
- package/components/Complex/Page.vue +8 -2
- package/components/Complex/WhiteBlock.vue +7 -0
- package/components/Dialog/Dialog.vue +9 -39
- package/components/Dialog/FamilyDialog.vue +10 -7
- package/components/Form/FormBlock.vue +91 -45
- package/components/Form/FormSection.vue +5 -2
- package/components/Form/FormTextSection.vue +3 -3
- package/components/Form/FormToggle.vue +4 -5
- package/components/Form/ManagerAttachment.vue +210 -0
- package/components/Form/ProductConditionsBlock.vue +70 -16
- package/components/Input/Datepicker.vue +45 -0
- package/components/Input/EmptyFormField.vue +1 -1
- package/components/Input/FileInput.vue +2 -3
- package/components/Input/FormInput.vue +31 -7
- package/components/Input/PanelInput.vue +7 -2
- package/components/Input/RoundedEmptyField.vue +5 -0
- package/components/Input/RoundedInput.vue +2 -2
- package/components/Input/RoundedSelect.vue +150 -0
- package/components/Layout/Drawer.vue +5 -2
- package/components/Layout/Header.vue +41 -5
- package/components/Layout/Loader.vue +1 -1
- package/components/Layout/SettingsPanel.vue +47 -13
- package/components/List/ListEmpty.vue +1 -1
- package/components/Menu/MenuHover.vue +30 -0
- package/components/Menu/MenuNav.vue +30 -14
- package/components/Menu/MenuNavItem.vue +10 -7
- package/components/Pages/Anketa.vue +68 -47
- package/components/Pages/Auth.vue +139 -46
- package/components/Pages/ContragentForm.vue +505 -0
- package/components/Pages/Documents.vue +11 -11
- package/components/Pages/InvoiceInfo.vue +30 -0
- package/components/Pages/MemberForm.vue +574 -316
- package/components/Pages/ProductAgreement.vue +2 -2
- package/components/Pages/ProductConditions.vue +671 -78
- package/components/Panel/PanelHandler.vue +309 -0
- package/components/Panel/PanelSelectItem.vue +3 -3
- package/components/Transitions/SlideTransition.vue +5 -0
- package/components/Utilities/Chip.vue +27 -0
- package/components/Utilities/IconBorder.vue +17 -0
- package/components/Utilities/JsonViewer.vue +27 -0
- package/composables/axios.ts +2 -2
- package/composables/classes.ts +227 -107
- package/composables/constants.ts +31 -51
- package/composables/index.ts +106 -2
- package/composables/styles.ts +33 -11
- package/configs/i18n.ts +15 -0
- package/layouts/default.vue +11 -8
- package/layouts/full.vue +1 -1
- package/locales/ru.json +647 -0
- package/nuxt.config.ts +14 -2
- package/package.json +35 -12
- package/pages/500.vue +4 -4
- package/pages/Token.vue +52 -0
- package/plugins/helperFunctionsPlugins.ts +11 -6
- package/plugins/storePlugin.ts +0 -1
- package/plugins/vuetifyPlugin.ts +8 -1
- package/store/data.store.ts +2666 -0
- package/store/form.store.ts +1 -1
- package/store/member.store.ts +164 -52
- package/store/rules.ts +193 -0
- package/types/enum.ts +83 -0
- package/types/env.d.ts +10 -0
- package/types/index.ts +279 -8
- package/components/Button/BtnIcon.vue +0 -47
- package/store/data.store.js +0 -2482
- package/store/messages.ts +0 -429
- package/store/rules.js +0 -153
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<base-fade-transition>
|
|
3
3
|
<section v-if="firstQuestionList && firstQuestionList.length && !firstPanel && !secondPanel" class="flex flex-col">
|
|
4
|
-
<section :class="[$
|
|
5
|
-
<base-form-toggle
|
|
4
|
+
<section :class="[$styles.blueBgLight, $styles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
|
|
5
|
+
<base-form-toggle
|
|
6
|
+
v-model="answerToAll"
|
|
7
|
+
:title="$dataStore.t('questionnaireType.answerAllNo')"
|
|
8
|
+
:disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
9
|
+
:has-border="false"
|
|
10
|
+
@clicked="handleToggler"
|
|
11
|
+
/>
|
|
6
12
|
</section>
|
|
7
13
|
<v-form ref="vForm" class="max-h-[70vh] overflow-y-scroll" @submit="submitForm">
|
|
8
14
|
<section
|
|
9
15
|
v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'N').length"
|
|
10
|
-
:class="[$
|
|
16
|
+
:class="[$styles.blueBgLight, $styles.rounded]"
|
|
11
17
|
class="mx-[10px] p-4 flex flex-col gap-4"
|
|
12
18
|
>
|
|
13
19
|
<base-form-input
|
|
@@ -18,73 +24,79 @@
|
|
|
18
24
|
:maska="$maska.threeDigit"
|
|
19
25
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
20
26
|
:rules="$rules.required"
|
|
21
|
-
|
|
27
|
+
/>
|
|
22
28
|
</section>
|
|
23
29
|
<section
|
|
24
30
|
v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'Y').length"
|
|
25
|
-
:class="[$
|
|
31
|
+
:class="[$styles.blueBgLight, $styles.rounded]"
|
|
26
32
|
class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4"
|
|
27
33
|
>
|
|
28
34
|
<base-form-text-section v-for="(question, index) in firstQuestionList.filter(i => i.first.definedAnswers === 'Y')" :key="index">
|
|
29
35
|
<base-fade-transition>
|
|
30
36
|
<div
|
|
31
37
|
v-if="question.first.answerName === 'Да' && secondQuestionList"
|
|
32
|
-
:class="[$
|
|
38
|
+
:class="[$styles.greenBg, $styles.whiteText, $styles.textSimple]"
|
|
33
39
|
class="rounded-t-lg pl-6 py-1 cursor-pointer"
|
|
34
40
|
@click="openFirstPanel(question)"
|
|
35
41
|
>
|
|
36
|
-
{{ $t('questionnaireType.pleaseAnswer'
|
|
42
|
+
{{ $dataStore.t('questionnaireType.pleaseAnswer', { text: secondQuestionList.length }) }}
|
|
37
43
|
</div>
|
|
38
44
|
</base-fade-transition>
|
|
39
|
-
<span :class="[$
|
|
45
|
+
<span :class="[$styles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
|
|
40
46
|
{{ question.first.name }}
|
|
41
47
|
<base-fade-transition>
|
|
42
|
-
<i
|
|
48
|
+
<i
|
|
49
|
+
v-if="question.first.answerName === 'Да' && secondQuestionList && secondQuestionList.length"
|
|
50
|
+
class="mdi mdi-chevron-right text-2xl cursor-pointer"
|
|
51
|
+
@click="openFirstPanel(question)"
|
|
52
|
+
></i>
|
|
43
53
|
</base-fade-transition>
|
|
44
54
|
</span>
|
|
45
|
-
<div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$
|
|
55
|
+
<div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$styles.textSimple]">
|
|
46
56
|
<v-radio-group
|
|
47
57
|
v-model="question.first.answerName"
|
|
48
58
|
class="anketa-radio"
|
|
49
|
-
:true-icon="`mdi-radiobox-marked ${$
|
|
59
|
+
:true-icon="`mdi-radiobox-marked ${$styles.greenText}`"
|
|
50
60
|
false-icon="mdi-radiobox-blank text-[#636363]"
|
|
51
61
|
:rules="$rules.required"
|
|
52
62
|
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
53
63
|
inline
|
|
54
64
|
>
|
|
55
|
-
<v-radio label="Да" value="Да"
|
|
56
|
-
<v-radio label="Нет" value="Нет"
|
|
65
|
+
<v-radio label="Да" value="Да" />
|
|
66
|
+
<v-radio label="Нет" value="Нет" />
|
|
57
67
|
</v-radio-group>
|
|
58
68
|
</div>
|
|
59
69
|
</base-form-text-section>
|
|
60
70
|
</section>
|
|
61
71
|
</v-form>
|
|
62
|
-
<base-btn
|
|
72
|
+
<base-btn
|
|
73
|
+
class="my-[14px] self-center"
|
|
74
|
+
:loading="isButtonLoading"
|
|
75
|
+
:disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
76
|
+
@click="submitForm"
|
|
77
|
+
:text="$dataStore.t('buttons.save')"
|
|
78
|
+
/>
|
|
63
79
|
</section>
|
|
64
|
-
<
|
|
65
|
-
ref="firstPanelSection"
|
|
80
|
+
<v-btn
|
|
66
81
|
v-if="secondQuestionList && secondQuestionList.length && firstPanel"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
secondPanel = false;
|
|
77
|
-
"
|
|
78
|
-
></v-btn>
|
|
79
|
-
<section v-if="currentQuestion" :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
|
|
82
|
+
icon="mdi mdi-close"
|
|
83
|
+
class="ml-3 !absolute z-10"
|
|
84
|
+
@click="
|
|
85
|
+
firstPanel = false;
|
|
86
|
+
secondPanel = false;
|
|
87
|
+
"
|
|
88
|
+
/>
|
|
89
|
+
<section ref="firstPanelSection" v-if="secondQuestionList && secondQuestionList.length && firstPanel" class="flex flex-col px-[10px] pb-[14px]" :class="[$styles.scrollPage]">
|
|
90
|
+
<section v-if="currentQuestion" :class="[$styles.blueBgLight, $styles.rounded]" class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4">
|
|
80
91
|
<base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
|
|
81
92
|
<base-form-input
|
|
82
93
|
v-if="question.definedAnswers === 'N'"
|
|
83
94
|
v-model="question.answerText"
|
|
84
95
|
class="border-t-[1px] border-t-[#F3F6FC]"
|
|
85
96
|
placeholder="Введите текст"
|
|
86
|
-
|
|
87
|
-
|
|
97
|
+
:readonly="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()"
|
|
98
|
+
/>
|
|
99
|
+
<span v-else class="flex items-center justify-between p-4 cursor-pointer" :class="[$styles.textTitle, $styles.greenText]" @click="openSecondPanel(question)">
|
|
88
100
|
{{ question.answerName ? question.answerName : 'Выбрать вариант ответа' }}
|
|
89
101
|
<i class="mdi mdi-chevron-right text-[28px]"></i>
|
|
90
102
|
</span>
|
|
@@ -93,8 +105,8 @@
|
|
|
93
105
|
</section>
|
|
94
106
|
</base-fade-transition>
|
|
95
107
|
<Teleport v-if="secondPanel" to="#panel-actions">
|
|
96
|
-
<div :class="[$
|
|
97
|
-
<base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"
|
|
108
|
+
<div :class="[$styles.scrollPage]" class="flex flex-col items-center">
|
|
109
|
+
<base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
|
|
98
110
|
<div v-if="$dataStore.questionRefs && $dataStore.questionRefs.length && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
|
|
99
111
|
<base-panel-select-item
|
|
100
112
|
v-for="(item, index) of $dataStore.questionRefs.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
|
|
@@ -102,16 +114,16 @@
|
|
|
102
114
|
:text="`${item.nameRu}`"
|
|
103
115
|
:selected="currentSecond!.answerId === item.ids"
|
|
104
116
|
@click="closeSecondPanel(item)"
|
|
105
|
-
|
|
117
|
+
/>
|
|
106
118
|
</div>
|
|
107
|
-
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"
|
|
119
|
+
<base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
|
|
108
120
|
</div>
|
|
109
121
|
</Teleport>
|
|
110
122
|
<base-scroll-buttons @up="scrollForm('up')" @down="scrollForm('down')" />
|
|
111
123
|
</template>
|
|
112
124
|
|
|
113
125
|
<script lang="ts">
|
|
114
|
-
import { Value } from '
|
|
126
|
+
import { Value } from '../../composables/classes';
|
|
115
127
|
|
|
116
128
|
export default defineComponent({
|
|
117
129
|
setup() {
|
|
@@ -126,14 +138,23 @@ export default defineComponent({
|
|
|
126
138
|
const firstPanel = ref<boolean>(false);
|
|
127
139
|
const secondPanel = ref<boolean>(false);
|
|
128
140
|
const surveyType = ref<'health' | 'critical'>('tab' in route.query && route.query.tab === 'criticalBase' ? 'critical' : 'health');
|
|
129
|
-
const whichSurvey = computed(() =>
|
|
130
|
-
|
|
141
|
+
const whichSurvey = computed(() =>
|
|
142
|
+
surveyType.value === 'health'
|
|
143
|
+
? whichMember.value === 'insured'
|
|
144
|
+
? 'surveyByHealthBase'
|
|
145
|
+
: 'surveyByHealthBasePolicyholder'
|
|
146
|
+
: whichMember.value === 'insured'
|
|
147
|
+
? 'surveyByCriticalBase'
|
|
148
|
+
: 'surveyByCriticalBasePolicyholder',
|
|
149
|
+
);
|
|
150
|
+
const firstQuestionList = ref<AnketaBody[]>([]);
|
|
131
151
|
const secondQuestionList = ref<AnketaSecond[]>([]);
|
|
132
152
|
const currentQuestion = ref<AnketaBody>();
|
|
133
153
|
const currentSecond = ref<AnketaSecond>();
|
|
134
154
|
const isPanelLoading = ref<boolean>(false);
|
|
135
155
|
const searchQuery = ref<string>('');
|
|
136
156
|
|
|
157
|
+
const whichMember = computed(() => ('member' in route.query && !!route.query.member ? (route.query.member as 'insured' | 'policyholder') : 'insured'));
|
|
137
158
|
const scrollForm = (direction: 'up' | 'down') => {
|
|
138
159
|
const scrollObject = { top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' };
|
|
139
160
|
if (firstPanel.value) {
|
|
@@ -153,19 +174,21 @@ export default defineComponent({
|
|
|
153
174
|
}
|
|
154
175
|
});
|
|
155
176
|
formStore[whichSurvey.value]!.type = surveyType.value;
|
|
156
|
-
const anketaToken = await dataStore.setSurvey(formStore[whichSurvey.value]);
|
|
157
|
-
|
|
177
|
+
const anketaToken = await dataStore.setSurvey(formStore[whichSurvey.value]!);
|
|
178
|
+
if (typeof anketaToken === 'string') {
|
|
179
|
+
formStore[whichSurvey.value]!.id = anketaToken;
|
|
180
|
+
}
|
|
158
181
|
isButtonLoading.value = false;
|
|
159
182
|
} else {
|
|
160
183
|
const errors = document.querySelector('.v-input--error');
|
|
161
184
|
if (errors) {
|
|
162
185
|
const errorText = errors.querySelector('.v-label.v-field-label');
|
|
163
186
|
if (errorText) {
|
|
164
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
187
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
|
|
165
188
|
} else {
|
|
166
189
|
const errorFieldText = errors.parentElement?.parentElement?.children[0].innerHTML;
|
|
167
190
|
if (errorFieldText) {
|
|
168
|
-
dataStore.showToaster('error', dataStore.t('toaster.errorFormField'
|
|
191
|
+
dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText }));
|
|
169
192
|
}
|
|
170
193
|
}
|
|
171
194
|
errors.scrollIntoView({
|
|
@@ -247,9 +270,10 @@ export default defineComponent({
|
|
|
247
270
|
await dataStore.getQuestionList(
|
|
248
271
|
surveyType.value,
|
|
249
272
|
formStore.applicationData.processInstanceId,
|
|
250
|
-
formStore.applicationData.insuredApp[0].id,
|
|
273
|
+
whichMember.value === 'insured' ? formStore.applicationData.insuredApp[0].id : formStore.applicationData.clientApp.id,
|
|
251
274
|
whichSurvey.value,
|
|
252
275
|
surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond',
|
|
276
|
+
whichMember.value,
|
|
253
277
|
);
|
|
254
278
|
firstQuestionList.value = formStore[whichSurvey.value]!.body;
|
|
255
279
|
secondQuestionList.value = formStore[surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond']!;
|
|
@@ -259,13 +283,10 @@ export default defineComponent({
|
|
|
259
283
|
answerToAll.value = true;
|
|
260
284
|
}
|
|
261
285
|
await Promise.allSettled(
|
|
262
|
-
firstQuestionList.value.map(async
|
|
286
|
+
firstQuestionList.value.map(async question => {
|
|
263
287
|
await dataStore.definedAnswers(question.first.id, whichSurvey.value);
|
|
264
288
|
}),
|
|
265
289
|
);
|
|
266
|
-
if (formStore.isDisabled.surveyByHealthBase) {
|
|
267
|
-
dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
|
|
268
|
-
}
|
|
269
290
|
};
|
|
270
291
|
|
|
271
292
|
onMounted(async () => {
|
|
@@ -1,27 +1,79 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="flex
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
v-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
<section class="flex h-full" :class="$styles.blueBgLight">
|
|
3
|
+
<!-- @vue-ignore -->
|
|
4
|
+
<aside :class="{ '!hidden': !$display().lgAndUp.value }" class="w-full lg:w-1/4 bg-white flex flex-col justify-between border-r-2 relative px-8">
|
|
5
|
+
<img draggable="false" class="w-[50%] mt-8" src="~/assets/auth-logo.svg" />
|
|
6
|
+
<div class="self-center flex flex-col items-center justify-center base-auth">
|
|
7
|
+
<v-carousel :show-arrows="false" color="#009C73">
|
|
8
|
+
<v-carousel-item v-for="(item, index) of carouselItems" :key="index">
|
|
9
|
+
<img draggable="false" class="mx-auto" :src="item.img" />
|
|
10
|
+
<div class="flex flex-col items-center justify-center mt-12 mb-8 text-center">
|
|
11
|
+
<h2 class="text-[22px] font-medium mb-1">{{ item.title }}</h2>
|
|
12
|
+
<h4 class="text-[16px]">{{ item.subtitle }}</h4>
|
|
13
|
+
</div>
|
|
14
|
+
</v-carousel-item>
|
|
15
|
+
</v-carousel>
|
|
16
|
+
</div>
|
|
17
|
+
<base-btn :text="$dataStore.t('buttons.more')" :disabled="true" class="mb-28" />
|
|
18
|
+
</aside>
|
|
19
|
+
<section v-if="isLogin" class="w-full lg:w-3/4 flex flex-col justify-center">
|
|
20
|
+
<!-- @vue-ignore -->
|
|
21
|
+
<img :class="{ '!block': !$display().lgAndUp.value }" draggable="false" class="hidden w-2/4 sm:w-1/3 mb-10 self-center" src="~/assets/auth-logo.svg" />
|
|
22
|
+
<div class="flex flex-col items-center mb-8 text-center">
|
|
23
|
+
<h1 class="text-[28px] font-medium mb-1">{{ $dataStore.t('labels.welcomeHL') }}</h1>
|
|
24
|
+
<span :class="[$styles.greyTextDark]" class="text-[16px]">{{ $dataStore.t('labels.needAuth') }}</span>
|
|
25
|
+
</div>
|
|
26
|
+
<v-form ref="vForm" class="w-2/3 lg:w-[25vw] self-center">
|
|
27
|
+
<base-rounded-input class="mb-1" v-model.trim="login" :rules="$rules.required" :loading="authLoading" :placeholder="$dataStore.t('buttons.userLogin')" type="text" />
|
|
28
|
+
<base-rounded-input
|
|
29
|
+
class="mb-1"
|
|
30
|
+
v-model.trim="password"
|
|
31
|
+
:rules="$rules.required"
|
|
32
|
+
:loading="authLoading"
|
|
33
|
+
:placeholder="$dataStore.t('buttons.password')"
|
|
34
|
+
:append-inner-icon="showPassword ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
|
|
35
|
+
@append="showPassword = !showPassword"
|
|
36
|
+
:type="showPassword ? ('' as InputTypes) : 'password'"
|
|
37
|
+
/>
|
|
38
|
+
<span v-if="$dataStore.isLKA" class="inline-block w-full text-end mb-4" :class="[$styles.textSimple, $styles.greyTextDark]" @click="isLogin = false">{{
|
|
39
|
+
$dataStore.t('labels.resetPassword')
|
|
40
|
+
}}</span>
|
|
41
|
+
<base-btn :text="$dataStore.t('buttons.login')" :disabled="authLoading" :btn="$styles.greenBtn" @click="submitAuthForm" />
|
|
42
|
+
</v-form>
|
|
43
|
+
</section>
|
|
44
|
+
<section v-if="isLogin === false" class="w-full lg:w-3/4 flex flex-col justify-center items-center">
|
|
45
|
+
<div class="flex flex-col items-center mb-4">
|
|
46
|
+
<h1 class="text-[28px] font-medium mb-1">{{ $dataStore.t('labels.resetPassword') }}</h1>
|
|
47
|
+
<span :class="[$styles.greyTextDark]" class="text-[16px]">{{ $dataStore.t('labels.resetType') }}</span>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="p-[2px] mb-8 rounded-[12px] border-[1px] w-2/3 lg:w-[25vw]" :class="[$styles.whiteBg]">
|
|
50
|
+
<v-tabs v-model="resetPasswordType" density="compact" slider-color="#009c73" class="w-full base-reset-password rounded-[12px]" :class="[$styles.whiteBg]">
|
|
51
|
+
<v-tab :ripple="false" value="phone"> {{ $dataStore.t('form.phoneNumber') }} </v-tab>
|
|
52
|
+
<v-tab :ripple="false" value="email"> {{ $dataStore.t('form.email') }} </v-tab>
|
|
53
|
+
</v-tabs>
|
|
54
|
+
</div>
|
|
55
|
+
<v-form ref="vForm" class="w-2/3 lg:w-[25vw] self-center">
|
|
56
|
+
<base-rounded-input
|
|
57
|
+
v-if="resetPasswordType === 'phone'"
|
|
58
|
+
v-model.trim="phone"
|
|
59
|
+
:maska="$maska.phone"
|
|
60
|
+
:rules="$rules.required.concat($rules.phoneFormat)"
|
|
61
|
+
:loading="authLoading"
|
|
62
|
+
:placeholder="$dataStore.t('form.phoneNumber')"
|
|
63
|
+
type="text"
|
|
64
|
+
/>
|
|
65
|
+
<base-rounded-input
|
|
66
|
+
v-if="resetPasswordType === 'email'"
|
|
67
|
+
v-model.trim="email"
|
|
68
|
+
:rules="$rules.required.concat($rules.email)"
|
|
69
|
+
:loading="authLoading"
|
|
70
|
+
:placeholder="$dataStore.t('form.email')"
|
|
71
|
+
type="text"
|
|
72
|
+
/>
|
|
73
|
+
<span class="inline-block w-full text-end mb-4" :class="[$styles.textSimple, $styles.greyTextDark]" @click="isLogin = true">{{ $dataStore.t('buttons.login') }}</span>
|
|
74
|
+
<base-btn :text="$dataStore.t('buttons.reset')" :disabled="authLoading" :btn="$styles.greenBtn" @click="submitAuthForm" />
|
|
75
|
+
</v-form>
|
|
76
|
+
</section>
|
|
25
77
|
</section>
|
|
26
78
|
</template>
|
|
27
79
|
|
|
@@ -33,24 +85,32 @@ export default defineComponent({
|
|
|
33
85
|
const dataStore = useDataStore();
|
|
34
86
|
|
|
35
87
|
const vForm = ref<any>(null);
|
|
88
|
+
const isLogin = ref<boolean>(true);
|
|
89
|
+
const showPassword = ref<boolean>(false);
|
|
90
|
+
const phone = ref<string>();
|
|
91
|
+
const email = ref<string>();
|
|
92
|
+
const resetPasswordType = ref<string>();
|
|
36
93
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
94
|
+
const carouselItems = [
|
|
95
|
+
{
|
|
96
|
+
title: 'Все полисы в один клик!',
|
|
97
|
+
subtitle: 'Мгновенный доступ к информации о ваших полисах',
|
|
98
|
+
img: '/left-side-1.png',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
title: 'Все полисы в один клик!',
|
|
102
|
+
subtitle: 'Мгновенный доступ к информации о ваших полисах',
|
|
103
|
+
img: '/left-side-1.png',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: 'Все полисы в один клик!',
|
|
107
|
+
subtitle: 'Мгновенный доступ к информации о ваших полисах',
|
|
108
|
+
img: '/left-side-1.png',
|
|
109
|
+
},
|
|
110
|
+
];
|
|
51
111
|
|
|
52
|
-
const login = ref<string>(
|
|
53
|
-
const password = ref<string>(
|
|
112
|
+
const login = ref<string>(getBaseCredentials()[useEnv().envMode].login);
|
|
113
|
+
const password = ref<string>(getBaseCredentials()[useEnv().envMode].password);
|
|
54
114
|
|
|
55
115
|
const numAttempts = ref(0);
|
|
56
116
|
|
|
@@ -68,24 +128,57 @@ export default defineComponent({
|
|
|
68
128
|
const submitAuthForm = async () => {
|
|
69
129
|
await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
|
|
70
130
|
if (v.valid) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
131
|
+
if (isLogin.value === true) {
|
|
132
|
+
authLoading.value = true;
|
|
133
|
+
await dataStore.loginUser(login.value, password.value, numAttempts.value);
|
|
134
|
+
numAttempts.value++;
|
|
135
|
+
authLoading.value = false;
|
|
136
|
+
if (!!dataStore.user.id) {
|
|
137
|
+
await router.push({ name: 'index' });
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
// TODO Reset password
|
|
77
141
|
}
|
|
78
142
|
}
|
|
79
143
|
});
|
|
80
144
|
};
|
|
81
145
|
|
|
82
146
|
return {
|
|
147
|
+
// State
|
|
83
148
|
login,
|
|
84
|
-
password,
|
|
85
149
|
vForm,
|
|
150
|
+
phone,
|
|
151
|
+
email,
|
|
152
|
+
isLogin,
|
|
153
|
+
password,
|
|
86
154
|
authLoading,
|
|
155
|
+
showPassword,
|
|
156
|
+
carouselItems,
|
|
157
|
+
resetPasswordType,
|
|
158
|
+
|
|
159
|
+
// Functions
|
|
87
160
|
submitAuthForm,
|
|
88
161
|
};
|
|
89
162
|
},
|
|
90
163
|
});
|
|
91
164
|
</script>
|
|
165
|
+
|
|
166
|
+
<style>
|
|
167
|
+
.base-auth .v-carousel__controls {
|
|
168
|
+
background: white !important;
|
|
169
|
+
}
|
|
170
|
+
.base-reset-password .v-tab__slider {
|
|
171
|
+
z-index: -1;
|
|
172
|
+
height: 100% !important;
|
|
173
|
+
border-radius: 12px;
|
|
174
|
+
}
|
|
175
|
+
.base-reset-password .v-tab {
|
|
176
|
+
width: 50%;
|
|
177
|
+
color: #566681;
|
|
178
|
+
text-transform: unset;
|
|
179
|
+
font-size: 12px;
|
|
180
|
+
}
|
|
181
|
+
.base-reset-password .v-tab--selected {
|
|
182
|
+
color: white !important;
|
|
183
|
+
}
|
|
184
|
+
</style>
|