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.
Files changed (73) hide show
  1. package/api/index.ts +202 -161
  2. package/api/interceptors.ts +23 -17
  3. package/components/Button/Btn.vue +4 -4
  4. package/components/Button/ScrollButtons.vue +2 -2
  5. package/components/Complex/ContentBlock.vue +1 -1
  6. package/components/Complex/MessageBlock.vue +26 -0
  7. package/components/Complex/Page.vue +8 -2
  8. package/components/Complex/WhiteBlock.vue +7 -0
  9. package/components/Dialog/Dialog.vue +9 -39
  10. package/components/Dialog/FamilyDialog.vue +10 -7
  11. package/components/Form/FormBlock.vue +91 -45
  12. package/components/Form/FormSection.vue +5 -2
  13. package/components/Form/FormTextSection.vue +3 -3
  14. package/components/Form/FormToggle.vue +4 -5
  15. package/components/Form/ManagerAttachment.vue +210 -0
  16. package/components/Form/ProductConditionsBlock.vue +70 -16
  17. package/components/Input/Datepicker.vue +45 -0
  18. package/components/Input/EmptyFormField.vue +1 -1
  19. package/components/Input/FileInput.vue +2 -3
  20. package/components/Input/FormInput.vue +31 -7
  21. package/components/Input/PanelInput.vue +7 -2
  22. package/components/Input/RoundedEmptyField.vue +5 -0
  23. package/components/Input/RoundedInput.vue +2 -2
  24. package/components/Input/RoundedSelect.vue +150 -0
  25. package/components/Layout/Drawer.vue +5 -2
  26. package/components/Layout/Header.vue +41 -5
  27. package/components/Layout/Loader.vue +1 -1
  28. package/components/Layout/SettingsPanel.vue +47 -13
  29. package/components/List/ListEmpty.vue +1 -1
  30. package/components/Menu/MenuHover.vue +30 -0
  31. package/components/Menu/MenuNav.vue +30 -14
  32. package/components/Menu/MenuNavItem.vue +10 -7
  33. package/components/Pages/Anketa.vue +68 -47
  34. package/components/Pages/Auth.vue +139 -46
  35. package/components/Pages/ContragentForm.vue +505 -0
  36. package/components/Pages/Documents.vue +11 -11
  37. package/components/Pages/InvoiceInfo.vue +30 -0
  38. package/components/Pages/MemberForm.vue +574 -316
  39. package/components/Pages/ProductAgreement.vue +2 -2
  40. package/components/Pages/ProductConditions.vue +671 -78
  41. package/components/Panel/PanelHandler.vue +309 -0
  42. package/components/Panel/PanelSelectItem.vue +3 -3
  43. package/components/Transitions/SlideTransition.vue +5 -0
  44. package/components/Utilities/Chip.vue +27 -0
  45. package/components/Utilities/IconBorder.vue +17 -0
  46. package/components/Utilities/JsonViewer.vue +27 -0
  47. package/composables/axios.ts +2 -2
  48. package/composables/classes.ts +227 -107
  49. package/composables/constants.ts +31 -51
  50. package/composables/index.ts +106 -2
  51. package/composables/styles.ts +33 -11
  52. package/configs/i18n.ts +15 -0
  53. package/layouts/default.vue +11 -8
  54. package/layouts/full.vue +1 -1
  55. package/locales/ru.json +647 -0
  56. package/nuxt.config.ts +14 -2
  57. package/package.json +35 -12
  58. package/pages/500.vue +4 -4
  59. package/pages/Token.vue +52 -0
  60. package/plugins/helperFunctionsPlugins.ts +11 -6
  61. package/plugins/storePlugin.ts +0 -1
  62. package/plugins/vuetifyPlugin.ts +8 -1
  63. package/store/data.store.ts +2666 -0
  64. package/store/form.store.ts +1 -1
  65. package/store/member.store.ts +164 -52
  66. package/store/rules.ts +193 -0
  67. package/types/enum.ts +83 -0
  68. package/types/env.d.ts +10 -0
  69. package/types/index.ts +279 -8
  70. package/components/Button/BtnIcon.vue +0 -47
  71. package/store/data.store.js +0 -2482
  72. package/store/messages.ts +0 -429
  73. 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="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
5
- <base-form-toggle v-model="answerToAll" :title="$t('questionnaireType.answerAllNo')" :disabled="formStore.isDisabled[whichSurvey] || !$dataStore.isTask()" :has-border="false" @clicked="handleToggler"></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="[$libStyles.blueBgLight, $libStyles.rounded]"
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
- ></base-form-input>
27
+ />
22
28
  </section>
23
29
  <section
24
30
  v-if="firstQuestionList.filter(i => i.first.definedAnswers === 'Y').length"
25
- :class="[$libStyles.blueBgLight, $libStyles.rounded]"
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="[$libStyles.greenBg, $libStyles.whiteText, $libStyles.textSimple]"
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').replace('{text}', `${secondQuestionList.length}`) }}
42
+ {{ $dataStore.t('questionnaireType.pleaseAnswer', { text: secondQuestionList.length }) }}
37
43
  </div>
38
44
  </base-fade-transition>
39
- <span :class="[$libStyles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
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 v-if="question.first.answerName === 'Да' && secondQuestionList" class="mdi mdi-chevron-right text-2xl cursor-pointer" @click="openFirstPanel(question)"></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="[$libStyles.textSimple]">
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 ${$libStyles.greenText}`"
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="Да"></v-radio>
56
- <v-radio label="Нет" value="Нет"></v-radio>
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 class="my-[14px] self-center" :loading="isButtonLoading" :disabled="formStore.isDisabled[whichSurvey]" @click="submitForm" :text="$t('buttons.save')"></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
- <section
65
- ref="firstPanelSection"
80
+ <v-btn
66
81
  v-if="secondQuestionList && secondQuestionList.length && firstPanel"
67
- class="flex flex-col px-[10px] py-[14px]"
68
- :class="[$libStyles.scrollPage]"
69
- >
70
- <v-btn
71
- icon="mdi mdi-close"
72
- variant="text"
73
- size="large"
74
- @click="
75
- firstPanel = false;
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
- ></base-form-input>
87
- <span v-else class="flex items-center justify-between p-4 cursor-pointer" :class="[$libStyles.textTitle, $libStyles.greenText]" @click="openSecondPanel(question)">
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="[$libStyles.scrollPage]" class="flex flex-col items-center">
97
- <base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"></base-rounded-input>
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
- ></base-panel-select-item>
117
+ />
106
118
  </div>
107
- <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
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 '@/composables/classes';
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(() => (surveyType.value === 'health' ? 'surveyByHealthBase' : 'surveyByCriticalBase'));
130
- const firstQuestionList = ref<AnketaBody[]>();
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
- formStore[whichSurvey.value]!.id = anketaToken;
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').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
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').replace('{text}', errorFieldText));
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 (question: any) => {
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 flex-col justify-evenly">
3
- <img draggable="false" class="w-2/3 lg:w-[25vw] self-center" src="~/assets/auth-logo.svg" />
4
- <v-form ref="vForm" class="w-2/3 lg:w-[35vw] self-center">
5
- <base-rounded-input
6
- class="mb-1"
7
- v-model="login"
8
- :rules="$dataStore.rules.required"
9
- :loading="authLoading"
10
- :placeholder="$t('buttons.userLogin')"
11
- type="text"
12
- @submitted="submitAuthForm"
13
- ></base-rounded-input>
14
- <base-rounded-input
15
- class="mb-1"
16
- v-model="password"
17
- :rules="$dataStore.rules.required"
18
- :loading="authLoading"
19
- :placeholder="$t('buttons.password')"
20
- type="password"
21
- @submitted="submitAuthForm"
22
- ></base-rounded-input>
23
- <base-btn :text="$t('buttons.login')" :disabled="authLoading" :btn="$libStyles.greenBtn" @click="submitAuthForm"></base-btn>
24
- </v-form>
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 credentials = {
38
- production: { login: '', password: '' },
39
- test: { login: '', password: '' },
40
- development: { login: 'manager', password: 'asdqwe123' },
41
- vercel: { login: '', password: 'asdqwe123' },
42
- };
43
-
44
- const useEnv = {
45
- envMode: import.meta.env.VITE_MODE,
46
- isDev: import.meta.env.VITE_MODE === 'development',
47
- isTest: import.meta.env.VITE_MODE === 'test',
48
- isVercel: import.meta.env.VITE_MODE === 'vercel',
49
- isProduction: import.meta.env.VITE_MODE === 'production',
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>(credentials[useEnv.envMode as keyof typeof credentials].login);
53
- const password = ref<string>(credentials[useEnv.envMode as keyof typeof credentials].password);
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
- authLoading.value = true;
72
- await dataStore.loginUser(login.value, password.value, numAttempts.value);
73
- numAttempts.value++;
74
- authLoading.value = false;
75
- if (!!dataStore.user.id) {
76
- router.push({ name: 'index' });
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>