hl-core 0.0.8-beta.3 → 0.0.8-beta.31

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 (46) hide show
  1. package/api/index.ts +77 -21
  2. package/api/interceptors.ts +17 -13
  3. package/components/Dialog/Dialog.vue +7 -37
  4. package/components/Form/FormBlock.vue +65 -28
  5. package/components/Form/FormSection.vue +4 -1
  6. package/components/Form/ManagerAttachment.vue +197 -0
  7. package/components/Form/ProductConditionsBlock.vue +64 -12
  8. package/components/Input/Datepicker.vue +5 -1
  9. package/components/Input/FormInput.vue +28 -7
  10. package/components/Input/PanelInput.vue +5 -0
  11. package/components/Input/RoundedSelect.vue +137 -0
  12. package/components/Layout/Drawer.vue +1 -0
  13. package/components/Layout/Header.vue +40 -4
  14. package/components/Layout/SettingsPanel.vue +39 -9
  15. package/components/Menu/MenuHover.vue +30 -0
  16. package/components/Menu/MenuNav.vue +28 -11
  17. package/components/Menu/MenuNavItem.vue +5 -2
  18. package/components/Pages/Anketa.vue +38 -21
  19. package/components/Pages/Auth.vue +145 -30
  20. package/components/Pages/InvoiceInfo.vue +30 -0
  21. package/components/Pages/MemberForm.vue +381 -144
  22. package/components/Pages/ProductConditions.vue +496 -17
  23. package/components/Panel/PanelHandler.vue +75 -2
  24. package/components/Utilities/Chip.vue +27 -0
  25. package/components/Utilities/JsonViewer.vue +27 -0
  26. package/composables/classes.ts +165 -25
  27. package/composables/constants.ts +13 -1
  28. package/composables/index.ts +58 -2
  29. package/composables/styles.ts +9 -3
  30. package/configs/i18n.ts +19 -0
  31. package/layouts/default.vue +2 -2
  32. package/locales/en.json +583 -0
  33. package/locales/kz.json +583 -0
  34. package/locales/ru.json +585 -0
  35. package/nuxt.config.ts +8 -0
  36. package/package.json +15 -9
  37. package/pages/500.vue +1 -1
  38. package/pages/Token.vue +51 -0
  39. package/plugins/helperFunctionsPlugins.ts +3 -0
  40. package/plugins/storePlugin.ts +0 -1
  41. package/plugins/vuetifyPlugin.ts +8 -1
  42. package/store/data.store.js +705 -624
  43. package/store/member.store.ts +147 -22
  44. package/store/rules.js +41 -3
  45. package/types/index.ts +39 -0
  46. package/store/messages.ts +0 -434
@@ -9,8 +9,16 @@
9
9
  <v-text-field v-model="$dataStore.user.fullName" :readonly="true" hide-details variant="plain" :label="$dataStore.user.roles?.join(', ')"></v-text-field>
10
10
  <i class="mdi mdi-account-outline text-2xl text-[#A0B3D8]"></i
11
11
  ></base-panel-item>
12
+ <base-panel-item v-if="$dataStore.isEFO" @click="changeBridge('lka')" class="cursor-pointer">
13
+ {{ $t('labels.lkaLong') }}
14
+ <i class="mdi mdi-chevron-right text-2xl text-[#A0B3D8]"></i
15
+ ></base-panel-item>
16
+ <base-panel-item v-if="$dataStore.isLKA" @click="changeBridge('efo')" class="cursor-pointer">
17
+ {{ $t('labels.efoLong') }}
18
+ <i class="mdi mdi-web text-2xl text-[#A0B3D8]"></i
19
+ ></base-panel-item>
12
20
  <base-panel-item
13
- v-for="panelItem of dataStore.settings.items.filter(i => (typeof i.show === 'boolean' ? i.show : true))"
21
+ v-for="panelItem of dataStore.settings.items.filter(i => $dataStore.filters.show(i))"
14
22
  :key="panelItem.title!"
15
23
  class="cursor-pointer"
16
24
  @click="panelItem.action ? panelItem.action() : null"
@@ -18,23 +26,31 @@
18
26
  {{ panelItem.title }}
19
27
  <i v-if="panelItem.icon" class="mdi text-xl text-[#A0B3D8]" :class="[panelItem.icon]"></i>
20
28
  </base-panel-item>
21
- <base-panel-item @click="dialog = true" class="cursor-pointer">
22
- Выход
23
- <i class="mdi mdi-logout text-xl text-[#A0B3D8]"></i>
29
+ <base-panel-item v-if="hasHistory" @click="openHistory" class="cursor-pointer">
30
+ {{ $t('historyStatementsAndStatuses') }}
31
+ <i class="mdi mdi-history text-xl text-[#A0B3D8]"></i>
24
32
  </base-panel-item>
25
-
26
- <base-dialog v-model="dialog" :title="$t('dialog.exit')" :subtitle="$t('dialog.dataWillClear')" actions="default" @yes="logoutUser" @no="dialog = false"> </base-dialog
33
+ <base-panel-item @click="dialogSignOut = true" class="cursor-pointer" :class="[$libStyles.redText]">
34
+ {{ $t('buttons.logout') }}
35
+ <i class="mdi mdi-logout text-xl"></i>
36
+ </base-panel-item>
37
+ <div v-if="$dataStore.settings.open" class="absolute bottom-2 w-full flex items-center justify-center opacity-30 text-sm">
38
+ <p>{{ pkg.version }}</p>
39
+ </div>
40
+ <base-dialog v-model="dialogSignOut" :title="$t('dialog.exit')" :subtitle="$t('dialog.dataWillClear')" actions="default" @yes="logoutUser" @no="dialogSignOut = false">
41
+ </base-dialog
27
42
  ></base-drawer>
28
43
  </template>
29
44
 
30
45
  <script lang="ts" setup>
31
- const dialog = ref(false);
46
+ import pkg from '@/package.json';
47
+ const dialogSignOut = ref(false);
32
48
  const dataStore = useDataStore();
33
49
 
34
50
  const handleFontSize = (action: 'increase' | 'decrease') => {
35
51
  if (action === 'increase' && dataStore.fontSize < 24) dataStore.fontSize += 2;
36
52
  if (action === 'decrease' && dataStore.fontSize > 14) dataStore.fontSize -= 2;
37
- if (dataStore.isEFO) {
53
+ if (dataStore.isBridge) {
38
54
  dataStore.sendToChild(constants.postActions.font, dataStore.fontSize);
39
55
  } else {
40
56
  dataStore.sendToParent(constants.postActions.font, dataStore.fontSize);
@@ -42,7 +58,21 @@ const handleFontSize = (action: 'increase' | 'decrease') => {
42
58
  };
43
59
 
44
60
  const logoutUser = async () => {
45
- dialog.value = false;
61
+ dialogSignOut.value = false;
46
62
  await dataStore.logoutUser();
47
63
  };
64
+
65
+ const hasHistory = computed(() => {
66
+ return !dataStore.isLKA;
67
+ });
68
+
69
+ const openHistory = async () => {
70
+ dataStore.sendToParent(constants.postActions.toStatementHistory, dataStore.isBridge ? '' : dataStore.product);
71
+ };
72
+
73
+ const changeBridge = async (toBridge: 'efo' | 'lka') => {
74
+ const bridgeUrl = import.meta.env[`VITE_${toBridge.toUpperCase()}_URL`] as string;
75
+ if (!bridgeUrl) return;
76
+ window.open(`${bridgeUrl}/#/Token?token=${dataStore.accessToken}`, '_blank');
77
+ };
48
78
  </script>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <v-menu v-if="items.length" :activator="activator" location="bottom center" :offset="top" transition="scale-transition">
3
+ <base-form-text-section class="p-4 border-[1px] flex flex-col gap-3 elevation-3 w-[250px]">
4
+ <div v-for="item of items.filter(i => $dataStore.filters.show(i))" :key="item.id">
5
+ <base-menu-nav-item :class="[$libStyles.textSimple]" :menu-item="item" @click="$emit(item.id)"></base-menu-nav-item>
6
+ </div>
7
+ </base-form-text-section>
8
+ </v-menu>
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import { MenuItem } from '@/composables/classes';
13
+
14
+ export default defineComponent({
15
+ props: {
16
+ items: {
17
+ type: Array as PropType<MenuItem[]>,
18
+ default: [],
19
+ },
20
+ activator: {
21
+ type: String,
22
+ default: 'parent',
23
+ },
24
+ top: {
25
+ type: Number,
26
+ default: 10,
27
+ },
28
+ },
29
+ });
30
+ </script>
@@ -6,7 +6,7 @@
6
6
  :has-back="hasBack"
7
7
  :back-icon="backIcon"
8
8
  :has-more="hasMore"
9
- :hide-more-on-lg="hideMoreOnLg"
9
+ :hide-more-on-lg="hideOnLg"
10
10
  :more-icon="moreIcon"
11
11
  @onBack="$emit('onBack')"
12
12
  @onMore="$emit('onMore')"
@@ -16,11 +16,11 @@
16
16
  <slot name="start"></slot>
17
17
  <base-fade-transition>
18
18
  <div v-if="$dataStore.menuItems && $dataStore.menuItems.length" class="flex flex-col gap-[10px]">
19
- <div v-for="(item, index) of $dataStore.menuItems.filter(i => (typeof i.show === 'boolean' ? i.show : true))" :key="index">
19
+ <div v-for="(item, index) of $dataStore.menuItems.filter(i => $dataStore.filters.show(i))" :key="index">
20
20
  <base-menu-nav-item
21
21
  :menu-item="item"
22
22
  :selected="!!selected.title && !!item.title && selected.title === item.title"
23
- :disabled="typeof item.disabled === 'boolean' ? item.disabled : false"
23
+ :disabled="$dataStore.filters.disabled(item)"
24
24
  @click.left="pickItem(item)"
25
25
  @click.middle="openTab(item)"
26
26
  >
@@ -32,10 +32,18 @@
32
32
  <slot name="end"></slot>
33
33
  <slot name="actions"></slot>
34
34
  <base-fade-transition>
35
- <div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[30%] w-full pr-4">
35
+ <div v-if="$dataStore.buttons && $dataStore.buttons.length" class="flex flex-col gap-[10px] justify-self-end absolute bottom-5 lg:bottom-[10%] w-full pr-4">
36
36
  <div v-for="(item, index) of $dataStore.buttons" :key="index">
37
37
  <transition enter-active-class="animate__animated animate__fadeIn animate__faster" leave-active-class="animate__animated animate__fadeOut animate__faster">
38
- <base-btn v-if="typeof item.show === 'boolean' ? item.show : true" :text="item.title!" :btn="item.color" :disabled="item.disabled" :loading="$dataStore.isButtonsLoading" @click="item.action"> </base-btn>
38
+ <base-btn
39
+ v-if="$dataStore.filters.show(item)"
40
+ :text="item.title!"
41
+ :btn="item.color"
42
+ :disabled="item.disabled"
43
+ :loading="$dataStore.isButtonsLoading"
44
+ @click="item.action"
45
+ >
46
+ </base-btn>
39
47
  </transition>
40
48
  </div></div
41
49
  ></base-fade-transition>
@@ -69,10 +77,6 @@ export default defineComponent({
69
77
  type: Boolean,
70
78
  default: false,
71
79
  },
72
- hideMoreOnLg: {
73
- type: Boolean,
74
- default: false,
75
- },
76
80
  moreIcon: {
77
81
  type: String,
78
82
  default: 'mdi-cog-outline',
@@ -84,7 +88,7 @@ export default defineComponent({
84
88
  const router = useRouter();
85
89
 
86
90
  const pickItem = async (item: MenuItem) => {
87
- if (item.title !== dataStore.menu.selectedItem.title && (typeof item.disabled === 'boolean' ? !item.disabled : true)) {
91
+ if (item.title !== dataStore.menu.selectedItem.title && !dataStore.filters.disabled(item)) {
88
92
  if (typeof item.link === 'object') {
89
93
  if (item.link && 'name' in item.link) {
90
94
  await router.push(item.link as RouteLocationNormalized);
@@ -102,7 +106,20 @@ export default defineComponent({
102
106
  }
103
107
  };
104
108
 
105
- return { pickItem, openTab };
109
+ const hideOnLg = computed(() => {
110
+ switch (router.currentRoute.value.name) {
111
+ case 'Insurance-Product':
112
+ case 'Menu':
113
+ case 'History':
114
+ case 'Main':
115
+ case 'taskId':
116
+ return false;
117
+ default:
118
+ return true;
119
+ }
120
+ });
121
+
122
+ return { pickItem, openTab, hideOnLg };
106
123
  },
107
124
  });
108
125
  </script>
@@ -7,10 +7,13 @@
7
7
  $libStyles.textSimple,
8
8
  disabled ? 'cursor-not-allowed opacity-50' : '',
9
9
  ]"
10
- class="h-[60px] flex items-center justify-between hover:bg-[#A0B3D8] hover:!text-white pl-4 cursor-pointer transition-all"
10
+ class="h-[60px] flex items-center justify-between hover:bg-[#A0B3D8] hover:!text-white pl-4 cursor-pointer transition-all group"
11
11
  >
12
12
  <span>{{ menuItem.title }}</span>
13
- <i v-if="menuItem.icon" class="mdi text-xl pr-4" :class="[menuItem.icon]"></i>
13
+ <div class="flex items-center">
14
+ <i v-if="menuItem.icon" class="mdi text-xl pr-4" :class="[menuItem.icon]"></i>
15
+ <base-chip :chip="menuItem.chip"></base-chip>
16
+ </div>
14
17
  <v-tooltip v-if="menuItem.description" activator="parent" location="bottom">{{ menuItem.description }}</v-tooltip>
15
18
  </div>
16
19
  </template>
@@ -39,13 +39,17 @@
39
39
  class="rounded-t-lg pl-6 py-1 cursor-pointer"
40
40
  @click="openFirstPanel(question)"
41
41
  >
42
- {{ $t('questionnaireType.pleaseAnswer').replace('{text}', `${secondQuestionList.length}`) }}
42
+ {{ $t('questionnaireType.pleaseAnswer', { text: secondQuestionList.length }) }}
43
43
  </div>
44
44
  </base-fade-transition>
45
45
  <span :class="[$libStyles.textTitle]" class="border-b-[1px] border-b-[#F3F6FC] p-6 flex items-center justify-between">
46
46
  {{ question.first.name }}
47
47
  <base-fade-transition>
48
- <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>
49
53
  </base-fade-transition>
50
54
  </span>
51
55
  <div class="flex items-center justify-start gap-5 px-4 pt-4" :class="[$libStyles.textSimple]">
@@ -65,24 +69,30 @@
65
69
  </base-form-text-section>
66
70
  </section>
67
71
  </v-form>
68
- <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="$t('buttons.save')"
78
+ ></base-btn>
69
79
  </section>
80
+ <v-btn
81
+ v-if="secondQuestionList && secondQuestionList.length && firstPanel"
82
+ icon="mdi mdi-close"
83
+ class="ml-3 !absolute z-10"
84
+ @click="
85
+ firstPanel = false;
86
+ secondPanel = false;
87
+ "
88
+ ></v-btn>
70
89
  <section
71
90
  ref="firstPanelSection"
72
91
  v-if="secondQuestionList && secondQuestionList.length && firstPanel"
73
- class="flex flex-col px-[10px] py-[14px]"
92
+ class="flex flex-col px-[10px] pb-[14px]"
74
93
  :class="[$libStyles.scrollPage]"
75
94
  >
76
- <v-btn
77
- icon="mdi mdi-close"
78
- variant="text"
79
- size="large"
80
- @click="
81
- firstPanel = false;
82
- secondPanel = false;
83
- "
84
- ></v-btn>
85
- <section v-if="currentQuestion" :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] my-[14px] p-4 flex flex-col gap-4">
95
+ <section v-if="currentQuestion" :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mx-[10px] mt-[14px] p-4 flex flex-col gap-4">
86
96
  <base-form-text-section v-for="question in currentQuestion.second" :title="question.name" :key="question.name">
87
97
  <base-form-input
88
98
  v-if="question.definedAnswers === 'N'"
@@ -132,7 +142,15 @@ export default defineComponent({
132
142
  const firstPanel = ref<boolean>(false);
133
143
  const secondPanel = ref<boolean>(false);
134
144
  const surveyType = ref<'health' | 'critical'>('tab' in route.query && route.query.tab === 'criticalBase' ? 'critical' : 'health');
135
- const whichSurvey = computed(() => (surveyType.value === 'health' ? 'surveyByHealthBase' : 'surveyByCriticalBase'));
145
+ const whichSurvey = computed(() =>
146
+ surveyType.value === 'health'
147
+ ? whichMember.value === 'insured'
148
+ ? 'surveyByHealthBase'
149
+ : 'surveyByHealthBasePolicyholder'
150
+ : whichMember.value === 'insured'
151
+ ? 'surveyByCriticalBase'
152
+ : 'surveyByCriticalBasePolicyholder',
153
+ );
136
154
  const firstQuestionList = ref<AnketaBody[]>();
137
155
  const secondQuestionList = ref<AnketaSecond[]>([]);
138
156
  const currentQuestion = ref<AnketaBody>();
@@ -140,6 +158,7 @@ export default defineComponent({
140
158
  const isPanelLoading = ref<boolean>(false);
141
159
  const searchQuery = ref<string>('');
142
160
 
161
+ const whichMember = computed(() => ('member' in route.query && !!route.query.member ? (route.query.member as string) : 'insured'));
143
162
  const scrollForm = (direction: 'up' | 'down') => {
144
163
  const scrollObject = { top: direction === 'up' ? 0 : screen.height * 10, behavior: 'smooth' };
145
164
  if (firstPanel.value) {
@@ -169,11 +188,11 @@ export default defineComponent({
169
188
  if (errors) {
170
189
  const errorText = errors.querySelector('.v-label.v-field-label');
171
190
  if (errorText) {
172
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
191
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorText.innerHTML?.replace(/[-<>!//.]/g, '') }));
173
192
  } else {
174
193
  const errorFieldText = errors.parentElement?.parentElement?.children[0].innerHTML;
175
194
  if (errorFieldText) {
176
- dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorFieldText));
195
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField', { text: errorFieldText }));
177
196
  }
178
197
  }
179
198
  errors.scrollIntoView({
@@ -255,9 +274,10 @@ export default defineComponent({
255
274
  await dataStore.getQuestionList(
256
275
  surveyType.value,
257
276
  formStore.applicationData.processInstanceId,
258
- formStore.applicationData.insuredApp[0].id,
277
+ whichMember.value === 'insured' ? formStore.applicationData.insuredApp[0].id : formStore.applicationData.clientApp.id,
259
278
  whichSurvey.value,
260
279
  surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond',
280
+ whichMember.value,
261
281
  );
262
282
  firstQuestionList.value = formStore[whichSurvey.value]!.body;
263
283
  secondQuestionList.value = formStore[surveyType.value === 'health' ? 'surveyByHealthSecond' : 'surveyByCriticalSecond']!;
@@ -271,9 +291,6 @@ export default defineComponent({
271
291
  await dataStore.definedAnswers(question.first.id, whichSurvey.value);
272
292
  }),
273
293
  );
274
- if (formStore.isDisabled.surveyByHealthBase) {
275
- dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
276
- }
277
294
  };
278
295
 
279
296
  onMounted(async () => {
@@ -1,27 +1,86 @@
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="$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="$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="$libStyles.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="$t('buttons.more')" :disabled="true" class="mb-28"></base-btn>
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">{{ $t('labels.welcomeHL') }}</h1>
24
+ <span :class="[$libStyles.greyTextDark]" class="text-[16px]">{{ $t('labels.needAuth') }}</span>
25
+ </div>
26
+ <v-form ref="vForm" class="w-2/3 lg:w-[25vw] self-center">
27
+ <base-rounded-input
28
+ class="mb-1"
29
+ v-model.trim="login"
30
+ :rules="$rules.required"
31
+ :loading="authLoading"
32
+ :placeholder="$t('buttons.userLogin')"
33
+ type="text"
34
+ ></base-rounded-input>
35
+ <base-rounded-input
36
+ class="mb-1"
37
+ v-model.trim="password"
38
+ :rules="$rules.required"
39
+ :loading="authLoading"
40
+ :placeholder="$t('buttons.password')"
41
+ :append-inner-icon="showPassword ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
42
+ @append="showPassword = !showPassword"
43
+ :type="showPassword ? ('' as InputTypes) : 'password'"
44
+ ></base-rounded-input>
45
+ <span v-if="$dataStore.isLKA" class="inline-block w-full text-end mb-4" :class="[$libStyles.textSimple, $libStyles.greyTextDark]" @click="isLogin = false">{{
46
+ $t('labels.resetPassword')
47
+ }}</span>
48
+ <base-btn :text="$t('buttons.login')" :disabled="authLoading" :btn="$libStyles.greenBtn" @click="submitAuthForm"></base-btn>
49
+ </v-form>
50
+ </section>
51
+ <section v-if="isLogin === false" class="w-full lg:w-3/4 flex flex-col justify-center items-center">
52
+ <div class="flex flex-col items-center mb-4">
53
+ <h1 class="text-[28px] font-medium mb-1">{{ $t('labels.resetPassword') }}</h1>
54
+ <span :class="[$libStyles.greyTextDark]" class="text-[16px]">{{ $t('labels.resetType') }}</span>
55
+ </div>
56
+ <div class="p-[2px] mb-8 rounded-[12px] border-[1px] w-2/3 lg:w-[25vw]" :class="[$libStyles.whiteBg]">
57
+ <v-tabs v-model="resetPasswordType" density="compact" slider-color="#009c73" class="w-full base-reset-password rounded-[12px]" :class="[$libStyles.whiteBg]">
58
+ <v-tab :ripple="false" value="phone"> {{ $t('form.phoneNumber') }} </v-tab>
59
+ <v-tab :ripple="false" value="email"> {{ $t('form.email') }} </v-tab>
60
+ </v-tabs>
61
+ </div>
62
+ <v-form ref="vForm" class="w-2/3 lg:w-[25vw] self-center">
63
+ <base-rounded-input
64
+ v-if="resetPasswordType === 'phone'"
65
+ v-model.trim="phone"
66
+ :maska="$maska.phone"
67
+ :rules="$rules.required.concat($rules.phoneFormat)"
68
+ :loading="authLoading"
69
+ :placeholder="$t('form.phoneNumber')"
70
+ type="text"
71
+ ></base-rounded-input>
72
+ <base-rounded-input
73
+ v-if="resetPasswordType === 'email'"
74
+ v-model.trim="email"
75
+ :rules="$rules.required.concat($rules.email)"
76
+ :loading="authLoading"
77
+ :placeholder="$t('form.email')"
78
+ type="text"
79
+ ></base-rounded-input>
80
+ <span class="inline-block w-full text-end mb-4" :class="[$libStyles.textSimple, $libStyles.greyTextDark]" @click="isLogin = true">{{ $t('buttons.login') }}</span>
81
+ <base-btn :text="$t('buttons.reset')" :disabled="authLoading" :btn="$libStyles.greenBtn" @click="submitAuthForm"></base-btn>
82
+ </v-form>
83
+ </section>
25
84
  </section>
26
85
  </template>
27
86
 
@@ -33,6 +92,11 @@ export default defineComponent({
33
92
  const dataStore = useDataStore();
34
93
 
35
94
  const vForm = ref<any>(null);
95
+ const isLogin = ref<boolean>(true);
96
+ const showPassword = ref<boolean>(false);
97
+ const phone = ref<string>();
98
+ const email = ref<string>();
99
+ const resetPasswordType = ref<string>();
36
100
 
37
101
  const credentials = {
38
102
  production: { login: '', password: '' },
@@ -41,6 +105,24 @@ export default defineComponent({
41
105
  vercel: { login: '', password: 'asdqwe123' },
42
106
  };
43
107
 
108
+ const carouselItems = [
109
+ {
110
+ title: 'Все полисы в один клик!',
111
+ subtitle: 'Мгновенный доступ к информации о ваших полисах',
112
+ img: '/left-side-1.png',
113
+ },
114
+ {
115
+ title: 'Все полисы в один клик!',
116
+ subtitle: 'Мгновенный доступ к информации о ваших полисах',
117
+ img: '/left-side-1.png',
118
+ },
119
+ {
120
+ title: 'Все полисы в один клик!',
121
+ subtitle: 'Мгновенный доступ к информации о ваших полисах',
122
+ img: '/left-side-1.png',
123
+ },
124
+ ];
125
+
44
126
  const useEnv = {
45
127
  envMode: import.meta.env.VITE_MODE,
46
128
  isDev: import.meta.env.VITE_MODE === 'development',
@@ -68,24 +150,57 @@ export default defineComponent({
68
150
  const submitAuthForm = async () => {
69
151
  await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
70
152
  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' });
153
+ if (isLogin.value === true) {
154
+ authLoading.value = true;
155
+ await dataStore.loginUser(login.value, password.value, numAttempts.value);
156
+ numAttempts.value++;
157
+ authLoading.value = false;
158
+ if (!!dataStore.user.id) {
159
+ await router.push({ name: 'index' });
160
+ }
161
+ } else {
162
+ // TODO Reset password
77
163
  }
78
164
  }
79
165
  });
80
166
  };
81
167
 
82
168
  return {
169
+ // State
83
170
  login,
84
- password,
85
171
  vForm,
172
+ phone,
173
+ email,
174
+ isLogin,
175
+ password,
86
176
  authLoading,
177
+ showPassword,
178
+ carouselItems,
179
+ resetPasswordType,
180
+
181
+ // Functions
87
182
  submitAuthForm,
88
183
  };
89
184
  },
90
185
  });
91
186
  </script>
187
+
188
+ <style>
189
+ .base-auth .v-carousel__controls {
190
+ background: white !important;
191
+ }
192
+ .base-reset-password .v-tab__slider {
193
+ z-index: -1;
194
+ height: 100% !important;
195
+ border-radius: 12px;
196
+ }
197
+ .base-reset-password .v-tab {
198
+ width: 50%;
199
+ color: #566681;
200
+ text-transform: unset;
201
+ font-size: 12px;
202
+ }
203
+ .base-reset-password .v-tab--selected {
204
+ color: white !important;
205
+ }
206
+ </style>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <section class="w-full px-[10px] pt-[14px] flex flex-col gap-4" :class="[$libStyles.scrollPage]" v-if="!!invoiceData">
3
+ <lazy-base-form-section :title="$t('labels.jsonObject')">
4
+ <template #icon>
5
+ <v-btn icon="mdi mdi-content-copy !text-[18px]" size="x-small" variant="plain" color="#A0B3D8" @click="$dataStore.copyToClipboard(JSON.stringify(invoiceData))"></v-btn>
6
+ </template>
7
+ <lazy-base-json-viewer :data="invoiceData" class="bg-white p-4 rounded"></lazy-base-json-viewer>
8
+ </lazy-base-form-section>
9
+ <lazy-base-form-section v-if="invoiceData.paymentLink && invoiceData.status !== 1" :title="$t('labels.epayPage')" class="flex items-center">
10
+ <div class="w-full lg:w-[70%] bg-white">
11
+ <iframe :src="invoiceData.paymentLink" frameborder="0" class="w-full h-[70vh]"></iframe>
12
+ </div>
13
+ </lazy-base-form-section>
14
+ </section>
15
+ </template>
16
+
17
+ <script lang="ts">
18
+ export default defineComponent({
19
+ setup() {
20
+ const formStore = useFormStore();
21
+ const invoiceData = formStore.invoiceData;
22
+
23
+ return {
24
+ // State
25
+ formStore,
26
+ invoiceData,
27
+ };
28
+ },
29
+ });
30
+ </script>