faqs added

This commit is contained in:
Komek Hayytnazarov 2022-12-13 13:55:02 +05:00
parent 4b331bb5a8
commit eddf8cd81a
9 changed files with 88 additions and 156 deletions

View File

@ -192,4 +192,6 @@ export const locale = {
INFO_STEP_1:
"ШАГ 1. Заполните профиль. Чтобы открыть форму, нажмите кнопку «Редактировать».",
INFO_STEP_2: "ШАГ 2. Подайте документы онлайн, нажав кнопку «Подать заявку».",
FAQ: "Frequently asked questions",
};

View File

@ -191,4 +191,6 @@ export const locale = {
INFO_STEP_2: "ШАГ 2. Подайте документы онлайн, нажав кнопку «Подать заявку».",
INFO_FORM: `Заполните все поля. Проверьте правильность внесенной информации, поскольку все данные из этого раздела автоматически отобразятся в «Вопроснике», необходимого для регистрации. Обратите внимание, что Вы сможете подать документы онлайн только когда заполнены все поля в этом разделе.`,
FAQ: "Часто задаваемые вопросы",
};

View File

@ -164,14 +164,11 @@ export const locale = {
REGISTER_DATE: "Hasaba alyş senesi",
STATUS: "Ýagdaýy",
REMARK: "Bellik",
APPLICATION_ACCEPTED_BY:
"Arza admin: {accepted_by} tarapyndan kabul edildi.",
APPLICATION_ACCEPTED_BY: "Arza admin: {accepted_by} tarapyndan kabul edildi.",
APPLICATION_ACCEPTED_DATE: "Kabul edilen senesi: {accepted_date}.",
APPLICATION_APPROVED_BY:
"Arza admin: {approved_by} tarapyndan tassyklandy.",
APPLICATION_APPROVED_BY: "Arza admin: {approved_by} tarapyndan tassyklandy.",
APPLICATION_APPROVED_DATE: "Tassyklanan senesi: {approved_date}.",
APPLICATION_NEEDS_TO_BE_IMPROVED_TEXT_INTRO:
"Siziň arzaňyzda düzedilmeli kemçilikler bar.",
APPLICATION_NEEDS_TO_BE_IMPROVED_TEXT_INTRO: "Siziň arzaňyzda düzedilmeli kemçilikler bar.",
LEG_BTN_DRAFT: "Arza geç",
LEG_BTN_REFINE: "Arza geç",
@ -191,4 +188,6 @@ export const locale = {
INFO_STEP_2: `Ädim 2. "Arza tabşyrmak" düwmesine basyp, resminamalary onlaýn tabşyryň.`,
INFO_FORM: `Ähli meýdançalary dolduryň. Girizilen maglumatlaryň dogrulygyny barlaň, sebäbi bu bölümdäki maglumatlar awtomatiki usulda hasaba alynmak üçin zerur bolan "Sowalnama" geçer. Üns beriň, şu bölümde ähli meýdançalary dolduranyňyzdan soň resminamalary onlaýn tabşyrmaga mümkinçilik dörär.`,
FAQ: "Sorag-jogap",
};

View File

@ -36,26 +36,11 @@ const routes = [
name: "profile-form",
component: () => import("../views/profile-forms/ProfileForm.vue"),
},
/* {
path: "contacts-form",
name: "contacts",
component: () => import("../views/profile-forms/Contacts.vue"),
},
{
path: "bank-form",
name: "bank-account",
component: () => import("../views/profile-forms/BankAccount.vue"),
path: "faq",
name: "faq",
component: () => import("../views/faq/Main.vue"),
},
{
path: "business-form",
name: "business",
component: () => import("../views/profile-forms/ProfileForm.vue"),
},
{
path: "company-form",
name: "company",
component: () => import("../views/profile-forms/Company.vue"),
}, */
{
path: "contracts",
name: "contracts",

View File

@ -23,6 +23,11 @@ export const useTopMenuStore = defineStore("topMenu", {
pageName: "create-ticket",
title: "NEW_TICKET",
},
{
icon: "FolderIcon",
pageName: "faq",
title: "FAQ",
},
],
},
{

View File

@ -12,7 +12,7 @@
</div>
<div v-else-if="isLoading"
class="flex sm:w-2/3 intro-y grid grid-cols-1 lg:grid-cols-1 text-center m-auto text-primary text-lg">
{{ $t('LOADING') }} ..
{{ $t('LOADING') }} ...
</div>
<div v-else-if="!hasNumber"
class="flex sm:w-2/3 intro-y grid grid-cols-1 lg:grid-cols-1 text-center m-auto text-primary text-lg">

View File

@ -1,126 +0,0 @@
<template>
<div class="intro-y mt-8">
<div class="lg:flex">
<div class="flex flex-col sm:w-1/3 ">
<div class="flex m-auto">
<Calculator @on-enter="(number) => onEnter(number)" />
</div>
</div>
<div class="flex sm:w-2/3 mx-auto mt-20 text-3xl text-primary">
<div v-if="firstTouched" class="w-3/4">
<div v-if="isLoading">
{{ $t('LOADING') }} ...
</div>
<div v-else>
<div v-if="hasNumber" class=" text-base text-black">
<PreviewComponent class="intro-y box py-4">
<div class="mt-2 p-2 font-medium text-center"> {{ contract.Workflow }} </div>
<div>
<div class="flex pl-4 m-2">
<div class="flex items-center">
<div class="font-medium">{{ $t('INPUT_NUMBER') }} :</div>
<div class="pl-3">{{ contract.InputNumber }}</div>
</div>
</div>
<div class="flex pl-4 m-2">
<div class="flex items-center">
<div class="font-medium">{{ $t('INPUT_DATE') }} :</div>
<div class="pl-3">{{ contract.InputDate }}</div>
</div>
</div>
<div class="flex pl-4 m-2">
<div class="flex items-center">
<div class="font-medium">{{ $t('REGISTER_DATE') }} :</div>
<div class="pl-3">{{ contract.RegDate }}</div>
</div>
</div>
<div class="flex pl-4 m-2">
<div class="flex items-center">
<div class="font-medium">{{ $t('STATUS') }} :</div>
<div class="pl-3">{{ contract.Status }}</div>
</div>
</div>
<div class="flex pl-4 m-2">
<div class="flex items-center">
<div class="font-medium"> {{ $t('REMARK') }}:</div>
<div class="pl-3">{{ contract.Remark }}</div>
</div>
</div>
</div>
</PreviewComponent>
</div>
<div v-else>
{{ $t('DATA_NOT_FOUND') }}
</div>
</div>
</div>
<div v-else class="text-center">
{{ $t('FIRST_TOUCH_WARNING') }}
</div>
</div>
</div>
</div>
</template>
<script setup>
import Calculator from "@/components/calculator/Main.vue";
import { fetchWrapper } from "@/api";
import { ref, reactive } from "vue";
import { helper as $h } from "@/utils/helper";
const baseUrl = `${import.meta.env.VITE_API_URL}/api`;
const isLoading = ref(false);
const hasNumber = ref(false);
const firstTouched = ref(false);
let contract = reactive({});
const onEnter = async (number) => {
// reset contract
Object.assign(contract, {});
firstTouched.value = true;
console.log("NUMBER ENTERED: " + number);
try {
hasNumber.value = false;
isLoading.value = true;
// await delay(2000)
const response = await fetchWrapper.post(
`${baseUrl}/contract`,
{
"number": number
}
);
isLoading.value = false;
if ('data' in response) {
Object.assign(contract, response.data);
contract.InputDate = $h.formatDate(contract.InputDate, "DD.MM.YYYY");
contract.RegDate = $h.formatDate(contract.RegDate, "DD.MM.YYYY");
console.log("contract: ", contract);
hasNumber.value = true;
}
} catch (error) {
console.log("contract error ", error);
isLoading.value = false;
hasNumber.value = false;
}
};
</script>

67
src/views/faq/Main.vue Normal file
View File

@ -0,0 +1,67 @@
<template>
<div class="intro-y flex items-center mt-8">
<h2 class="text-lg font-medium mr-auto">{{ $t('FAQ') }}</h2>
</div>
<!-- BEGIN: FAQ Content -->
<div class="intro-y mt-5">
<div v-if="isLoading" class="m-auto text-center text-primary text-lg">
{{ $t('LOADING') }} ...
</div>
<div class="box">
<AccordionGroup class="p-5" v-for="(faq, faqKey) in FAQs" :key="faqKey">
<AccordionItem>
<Accordion>
{{ faq.question_text }}
</Accordion>
<AccordionPanel class="text-slate-600 dark:text-slate-500 leading-relaxed">
{{ faq.options }}
</AccordionPanel>
</AccordionItem>
</AccordionGroup>
</div>
</div>
<!-- END: FAQ Content -->
</template>
<script setup>
import { fetchWrapper } from "@/api";
import { ref, reactive, onBeforeMount, onMounted } from "vue";
import { delay } from "@/helpers";
let FAQs = ref([]);
const baseUrl = `${import.meta.env.VITE_API_URL}/api`;
const isLoading = ref(false);
const fetchFAQs = async () => {
try {
isLoading.value = true;
FAQs.value.splice(0);
// await delay(2000)
const response = await fetchWrapper.get(`${baseUrl}/faqs`);
FAQs.value = [...response['data']];
isLoading.value = false;
console.log("response fetchUsers: ", FAQs.value);
} catch (error) {
console.log("contract error ", error);
isLoading.value = false;
}
}
onBeforeMount(async () => {
await fetchFAQs();
});
</script>

View File

@ -90,6 +90,7 @@ const onAddNewUser = () => {
const fetchUsers = async () => {
try {
isLoading.value = true;
// clear array
users.value.splice(0);
@ -97,18 +98,15 @@ const fetchUsers = async () => {
users.value = [...response['data']];
console.log("response fetchUsers: ", users.value);
isLoading.value = false;
} catch (e) {
console.log("error fetchUsers: ", e);
isLoading.value = false;
}
}
onBeforeMount(async () => {
isLoading.value = true;
await fetchUsers();
isLoading.value = false;
});
</script>