hl-core 0.0.8-beta.2 → 0.0.8-beta.20

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 (41) hide show
  1. package/api/index.ts +42 -14
  2. package/api/interceptors.ts +1 -1
  3. package/components/Dialog/Dialog.vue +6 -3
  4. package/components/Form/FormBlock.vue +63 -28
  5. package/components/Form/FormSection.vue +4 -1
  6. package/components/Form/ManagerAttachment.vue +196 -0
  7. package/components/Form/ProductConditionsBlock.vue +64 -12
  8. package/components/Input/FormInput.vue +12 -3
  9. package/components/Input/PanelInput.vue +5 -0
  10. package/components/Layout/Drawer.vue +1 -0
  11. package/components/Layout/Header.vue +40 -4
  12. package/components/Layout/SettingsPanel.vue +35 -8
  13. package/components/Menu/MenuHover.vue +30 -0
  14. package/components/Menu/MenuNav.vue +27 -10
  15. package/components/Pages/Anketa.vue +8 -4
  16. package/components/Pages/Auth.vue +147 -30
  17. package/components/Pages/InvoiceInfo.vue +30 -0
  18. package/components/Pages/MemberForm.vue +274 -79
  19. package/components/Pages/ProductConditions.vue +291 -7
  20. package/components/Panel/PanelHandler.vue +74 -1
  21. package/components/Utilities/JsonViewer.vue +27 -0
  22. package/composables/classes.ts +126 -23
  23. package/composables/constants.ts +11 -1
  24. package/composables/styles.ts +9 -3
  25. package/configs/i18n.ts +19 -0
  26. package/layouts/default.vue +2 -2
  27. package/locales/en.json +558 -0
  28. package/locales/kz.json +558 -0
  29. package/locales/ru.json +558 -0
  30. package/nuxt.config.ts +8 -0
  31. package/package.json +7 -2
  32. package/pages/500.vue +1 -1
  33. package/pages/Token.vue +51 -0
  34. package/plugins/helperFunctionsPlugins.ts +2 -0
  35. package/plugins/storePlugin.ts +0 -1
  36. package/plugins/vuetifyPlugin.ts +5 -0
  37. package/store/data.store.js +472 -530
  38. package/store/member.store.ts +120 -15
  39. package/store/rules.js +27 -3
  40. package/types/index.ts +34 -0
  41. package/store/messages.ts +0 -434
@@ -1,27 +1,88 @@
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
+ <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">
4
+ <img draggable="false" class="w-[50%] mt-8" src="~/assets/auth-logo.svg" />
5
+ <div class="self-center flex flex-col items-center justify-center base-auth">
6
+ <v-carousel :show-arrows="false" color="#009C73">
7
+ <v-carousel-item v-for="(item, index) of carouselItems" :key="index">
8
+ <img draggable="false" class="mx-auto" :src="item.img" />
9
+ <div class="flex flex-col items-center justify-center mt-12 mb-8 text-center">
10
+ <h2 class="text-[22px] font-medium mb-1">{{ item.title }}</h2>
11
+ <h4 class="text-[16px]">{{ item.subtitle }}</h4>
12
+ </div>
13
+ </v-carousel-item>
14
+ </v-carousel>
15
+ </div>
16
+ <base-btn :text="$t('buttons.more')" :disabled="true" class="mb-28"></base-btn>
17
+ </aside>
18
+ <section v-if="isLogin" class="w-full lg:w-3/4 flex flex-col justify-center">
19
+ <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" />
20
+ <div class="flex flex-col items-center mb-8 text-center">
21
+ <h1 class="text-[28px] font-medium mb-1">{{ $t('labels.welcomeHL') }}</h1>
22
+ <span :class="[$libStyles.greyTextDark]" class="text-[16px]">{{ $t('labels.needAuth') }}</span>
23
+ </div>
24
+ <v-form ref="vForm" class="w-2/3 lg:w-[25vw] self-center">
25
+ <base-rounded-input
26
+ class="mb-1"
27
+ v-model="login"
28
+ :rules="$rules.required"
29
+ :loading="authLoading"
30
+ :placeholder="$t('buttons.userLogin')"
31
+ type="text"
32
+ @submitted="submitAuthForm"
33
+ ></base-rounded-input>
34
+ <base-rounded-input
35
+ class="mb-1"
36
+ v-model="password"
37
+ :rules="$rules.required"
38
+ :loading="authLoading"
39
+ :placeholder="$t('buttons.password')"
40
+ :append-inner-icon="showPassword ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
41
+ @append="showPassword = !showPassword"
42
+ :type="showPassword ? ('' as InputTypes) : 'password'"
43
+ @submitted="submitAuthForm"
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="phone"
66
+ :maska="$maska.phone"
67
+ :rules="$rules.required.concat($rules.phoneFormat)"
68
+ :loading="authLoading"
69
+ :placeholder="$t('form.phoneNumber')"
70
+ type="text"
71
+ @submitted="submitAuthForm"
72
+ ></base-rounded-input>
73
+ <base-rounded-input
74
+ v-if="resetPasswordType === 'email'"
75
+ v-model="email"
76
+ :rules="$rules.required.concat($rules.email)"
77
+ :loading="authLoading"
78
+ :placeholder="$t('form.email')"
79
+ type="text"
80
+ @submitted="submitAuthForm"
81
+ ></base-rounded-input>
82
+ <span class="inline-block w-full text-end mb-4" :class="[$libStyles.textSimple, $libStyles.greyTextDark]" @click="isLogin = true">{{ $t('buttons.login') }}</span>
83
+ <base-btn :text="$t('buttons.reset')" :disabled="authLoading" :btn="$libStyles.greenBtn" @click="submitAuthForm"></base-btn>
84
+ </v-form>
85
+ </section>
25
86
  </section>
26
87
  </template>
27
88
 
@@ -33,6 +94,11 @@ export default defineComponent({
33
94
  const dataStore = useDataStore();
34
95
 
35
96
  const vForm = ref<any>(null);
97
+ const isLogin = ref<boolean>(true);
98
+ const showPassword = ref<boolean>(false);
99
+ const phone = ref<string>();
100
+ const email = ref<string>();
101
+ const resetPasswordType = ref<string>();
36
102
 
37
103
  const credentials = {
38
104
  production: { login: '', password: '' },
@@ -41,6 +107,24 @@ export default defineComponent({
41
107
  vercel: { login: '', password: 'asdqwe123' },
42
108
  };
43
109
 
110
+ const carouselItems = [
111
+ {
112
+ title: 'Все полисы в один клик!',
113
+ subtitle: 'Мгновенный доступ к информации о ваших полисах',
114
+ img: '/left-side-1.png',
115
+ },
116
+ {
117
+ title: 'Все полисы в один клик!',
118
+ subtitle: 'Мгновенный доступ к информации о ваших полисах',
119
+ img: '/left-side-1.png',
120
+ },
121
+ {
122
+ title: 'Все полисы в один клик!',
123
+ subtitle: 'Мгновенный доступ к информации о ваших полисах',
124
+ img: '/left-side-1.png',
125
+ },
126
+ ];
127
+
44
128
  const useEnv = {
45
129
  envMode: import.meta.env.VITE_MODE,
46
130
  isDev: import.meta.env.VITE_MODE === 'development',
@@ -68,24 +152,57 @@ export default defineComponent({
68
152
  const submitAuthForm = async () => {
69
153
  await vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
70
154
  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' });
155
+ if (isLogin.value === true) {
156
+ authLoading.value = true;
157
+ await dataStore.loginUser(login.value, password.value, numAttempts.value);
158
+ numAttempts.value++;
159
+ authLoading.value = false;
160
+ if (!!dataStore.user.id) {
161
+ router.push({ name: 'index' });
162
+ }
163
+ } else {
164
+ // TODO Reset password
77
165
  }
78
166
  }
79
167
  });
80
168
  };
81
169
 
82
170
  return {
171
+ // State
83
172
  login,
84
- password,
85
173
  vForm,
174
+ phone,
175
+ email,
176
+ isLogin,
177
+ password,
86
178
  authLoading,
179
+ showPassword,
180
+ carouselItems,
181
+ resetPasswordType,
182
+
183
+ // Functions
87
184
  submitAuthForm,
88
185
  };
89
186
  },
90
187
  });
91
188
  </script>
189
+
190
+ <style>
191
+ .base-auth .v-carousel__controls {
192
+ background: white !important;
193
+ }
194
+ .base-reset-password .v-tab__slider {
195
+ z-index: -1;
196
+ height: 100% !important;
197
+ border-radius: 12px;
198
+ }
199
+ .base-reset-password .v-tab {
200
+ width: 50%;
201
+ color: #566681;
202
+ text-transform: unset;
203
+ font-size: 12px;
204
+ }
205
+ .base-reset-password .v-tab--selected {
206
+ color: white !important;
207
+ }
208
+ </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>