This commit is contained in:
f4ilji
2025-01-08 22:48:54 +05:00
parent ad5e26ff0c
commit abc6bcf1ba
16 changed files with 226 additions and 69 deletions
@@ -41,6 +41,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
};
// Создайте массив промисов для загрузки всех компонентов
@@ -66,6 +67,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
};
return defineAsyncComponent(componentMap[type] || null);
},
@@ -0,0 +1,37 @@
<template>
<div class="mb-[50px] space-y-3">
<h2 class="font-semibold text-[#1A5AAF] text-lg">{{ title }}</h2>
<div v-for="(item, index) in items" :key="index">
<h3 class="font-semibold mb-4">{{ item.header }}</h3>
<div class="font-light">
<p v-for="(detail, idx) in item.details" :key="idx">
<span v-if="detail.url">
<a :href="detail.url" class="text-blue-500 hover:underline">{{ detail.content }}</a>
</span>
<span v-else>
{{ detail.content }}
</span>
</p>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
title: {
type: String,
required: true,
},
items: {
type: Array,
required: true,
},
},
};
</script>
<style scoped>
/* ваши стили, если необходимо */
</style>
@@ -0,0 +1,104 @@
<template>
<!-- <div v-if="loading" class="flex flex-col space-y-4">-->
<!-- <div class="group block rounded-xl overflow-hidden animate-pulse">-->
<!-- <div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">-->
<!-- <div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">-->
<!-- <div class="w-full h-full bg-gray-200"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<section class="bg-[#F5F5F5] w-full py-10">
<div class="max-w-screen-xl md:flex justify-around w-full mx-auto px-4 py-[50px] flex-wrap">
<ContactGroup v-for="contact in contacts.data.content"
:title="contact.title"
:items="contact.items"
/>
</div>
</section>
</template>
<script>
import ContactGroup from './ContactGroup.vue';
import axios from "axios";
export default {
components: {
ContactGroup,
},
data() {
return {
loading: false,
contacts: null,
contactItems: [
{
header: 'Главный корпус',
details: [
{text: '622031, Нижний Тагил, Красногвардейская 57', url: null},
],
},
{
header: 'Свяжитесь с нами',
details: [
{text: '(3435) 25-48-00', url: null},
{text: 'office@ntspi.ru', url: 'mailto:office@ntspi.ru'},
],
},
],
admissionItems: [
{
header: 'Расписание',
details: [
{text: 'Понедельник - Пятница с 08.30 до 17.00', url: null},
],
},
{
header: 'Ответственный секретарь приемной комиссии',
details: [
{text: '+7(906)-802-55-59', url: null},
{text: 'ntgspi@yandex.ru', url: 'mailto:ntgspi@yandex.ru'},
]
}
],
usefulItems: [
{
header: 'Полезное',
details: [
{text: 'Виртуальный тур', url: 'https://ntspi.ru/panorama/tour.html'},
],
},
],
};
},
methods: {
getContact(id) {
axios.get(route('client.widget.contact.show', id))
.then(response => {
this.contacts = response.data;
this.loading = false; // Установить состояние загрузки в false
})
.catch(error => {
console.error('Ошибка:', error);
});
},
},
mounted() {
const id = this.block?.data.contact || this.contactId
this.getContact(id);
},
props: {
block: {
type: Object,
},
contactId: {
type: String,
default: null,
}
},
};
</script>
<style scoped>
/* ваши стили, если необходимо */
</style>
@@ -8,6 +8,7 @@
</div>
</div>
</div>
<div v-else>
<!-- Card Blog -->
@@ -66,7 +67,7 @@ export default {
},
methods: {
getResource(id) {
axios.get(route('client.widget.page.resource.index', id))
axios.get(route('client.widget.page.resource.show', id))
.then(response => {
this.resource = response.data;
this.loading = false; // Установить состояние загрузки в false
@@ -1,21 +1,38 @@
<template>
<div v-if="loading" class="flex flex-col space-y-4">
<div class="group block rounded-xl overflow-hidden animate-pulse">
<div class="group flex justify-center space-x-8 mb-8 flex-wrap rounded-xl overflow-hidden animate-pulse items-center">
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div>
</div>
</div>
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div>
</div>
</div>
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div>
</div>
</div>
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5">
<div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44">
<div class="w-full h-full bg-gray-200"></div>
</div>
</div>
</div>
</div>
<div v-else>
<!-- Card Blog -->
<div class="px-0 py-10 sm:px-2 lg:py-14 mx-auto">
<div v-if="resource.data.length !== 0" class="px-0 py-10 sm:px-2 lg:py-14 mx-auto">
<!-- Title -->
<div class="max-w-2xl text-center mx-auto mb-10 lg:mb-14">
<h2 class="text-2xl font-bold md:text-4xl md:leading-tight">Полезные ресурсы</h2>
<p class="mt-1 text-gray-600">We've helped some great companies brand, design and get to market.</p>
<p class="mt-1 text-gray-600"></p>
</div>
<!-- End Title -->
@@ -66,7 +83,7 @@ export default {
},
methods: {
getResource(id) {
axios.get(route('client.widget.page.resource.index', id))
axios.get(route('client.widget.page.resource.show', id))
.then(response => {
this.resource = response.data;
this.loading = false; // Установить состояние загрузки в false
@@ -41,6 +41,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
};
// Создайте массив промисов для загрузки всех компонентов
@@ -66,6 +67,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
};
return defineAsyncComponent(componentMap[type] || null);
},
@@ -41,6 +41,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
};
// Создайте массив промисов для загрузки всех компонентов
@@ -65,6 +66,7 @@ export default {
pageItem: () => import('@/Components/BuilderUi/Pages/Blocks/PageItemBlock.vue'),
customForm: () => import('@/Components/BuilderUi/Pages/Blocks/FormBlock.vue'),
pageResourceList: () => import('@/Components/BuilderUi/Pages/Blocks/PageResourceList.vue'),
contact: () => import('@/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue'),
};
return defineAsyncComponent(componentMap[type] || null);
},