modified: main_dc/yalarba/easySite/easySite/app/components/BookingModal.vue
modified: main_dc/yalarba/easySite/easySite/app/components/ImageGallery.vue modified: main_dc/yalarba/easySite/easySite/app/pages/objects/[id]/edit.vue modified: main_dc/yalarba/easySite/easySite/app/pages/objects/[id]/index.vue modified: main_dc/yalarba/easySite/easySite/app/pages/profile/index.vue modified: main_dc/yalarba/easySite/easySite/nuxt.config.ts fix fix fix
This commit is contained in:
@@ -18,14 +18,22 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// Определяем тип объекта недвижимости
|
||||
interface RentalObject {
|
||||
title: string;
|
||||
city?: string; // опционально, если может отсутствовать
|
||||
address?: string; // опционально
|
||||
// другие поля при необходимости
|
||||
}
|
||||
|
||||
defineProps<{
|
||||
object: any
|
||||
dates: any
|
||||
guests: string
|
||||
object: RentalObject | null | undefined;
|
||||
dates: unknown;
|
||||
guests: string;
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
close: []
|
||||
confirm: [bookingData: any]
|
||||
close: [];
|
||||
confirm: [bookingData: unknown];
|
||||
}>()
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -15,6 +15,7 @@ const props = defineProps<{
|
||||
initialIndex: number
|
||||
}>()
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const emit = defineEmits<{
|
||||
close: []
|
||||
}>()
|
||||
|
||||
@@ -18,13 +18,17 @@
|
||||
|
||||
<!-- Загрузка -->
|
||||
<div v-if="loading" class="loading-state">
|
||||
<div class="loading-spinner"></div>
|
||||
<div class="loading-spinner"/>
|
||||
<p class="loading-text">Загрузка данных объекта...</p>
|
||||
</div>
|
||||
|
||||
<!-- Форма -->
|
||||
<ObjectForm v-else-if="object" :object="object" :loading="updating" @submit="handleSubmit"
|
||||
@cancel="handleCancel" />
|
||||
<ObjectForm
|
||||
v-else-if="object"
|
||||
:object="object"
|
||||
:loading="updating"
|
||||
@submit="handleSubmit"
|
||||
@cancel="handleCancel" />
|
||||
|
||||
<!-- Объект не найден -->
|
||||
<div v-else class="error-state">
|
||||
@@ -47,8 +51,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Header from '~/components/layout/Header.vue'
|
||||
import Footer from '~/components/layout/Footer.vue'
|
||||
|
||||
interface ObjectData {
|
||||
id: number
|
||||
|
||||
@@ -56,10 +56,12 @@
|
||||
<div class="main-image">
|
||||
<img :src="object?.images[0]" :alt="object?.title" class="gallery-image" @click="openGallery(0)" />
|
||||
</div>
|
||||
<div class="thumbnails" v-if="object?.images.length > 1">
|
||||
<div v-for="(image, index) in object?.images.slice(1, 5)" :key="index" class="thumbnail"
|
||||
@click="openGallery(index + 1)">
|
||||
<img :src="image" :alt="`${object?.title} - фото ${index + 2}`" />
|
||||
<div v-if="object?.images && object.images.length > 1" class="thumbnails">
|
||||
<div
|
||||
v-for="(image, index) in object.images.slice(1, 5)"
|
||||
:key="index" class="thumbnail"
|
||||
@click="openGallery(index + 1)">
|
||||
<img :src="image" :alt="`${object.title} - фото ${index + 2}`">
|
||||
<div v-if="index === 3 && object.images.length > 5" class="more-images">
|
||||
+{{ object.images.length - 5 }}
|
||||
</div>
|
||||
@@ -112,7 +114,7 @@
|
||||
</section>
|
||||
|
||||
<!-- Отзывы -->
|
||||
<section class="content-section" v-if="reviews.length > 0">
|
||||
<section v-if="reviews.length > 0" class="content-section">
|
||||
<div class="section-header">
|
||||
<h2 class="section-title">Отзывы</h2>
|
||||
<div class="reviews-summary">
|
||||
@@ -172,8 +174,8 @@
|
||||
<div class="form-group">
|
||||
<label class="form-label">Даты</label>
|
||||
<div class="date-inputs">
|
||||
<input type="date" v-model="bookingDates.checkIn" class="form-input" placeholder="Заезд" />
|
||||
<input type="date" v-model="bookingDates.checkOut" class="form-input" placeholder="Выезд" />
|
||||
<input v-model="bookingDates.checkIn" type="date" class="form-input" placeholder="Заезд">
|
||||
<input v-model="bookingDates.checkOut" type="date" class="form-input" placeholder="Выезд">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -185,8 +187,8 @@
|
||||
<option value="4">4 гостя</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn-primary btn-large" @click="showBookingModal = true"
|
||||
:disabled="!bookingDates.checkIn || !bookingDates.checkOut">
|
||||
<button class="btn btn-primary btn-large" :disabled="!bookingDates.checkIn || !bookingDates.checkOut"
|
||||
@click="showBookingModal = true">
|
||||
Забронировать
|
||||
</button>
|
||||
</div>
|
||||
@@ -223,8 +225,8 @@
|
||||
<span>✏️</span>
|
||||
Редактировать
|
||||
</NuxtLink>
|
||||
<button @click="toggleObjectStatus" class="btn btn-outline btn-with-icon"
|
||||
:class="{ 'btn-primary': !object?.isActive }">
|
||||
<button class="btn btn-outline btn-with-icon" :class="{ 'btn-primary': !object?.isActive }"
|
||||
@click="toggleObjectStatus">
|
||||
<span>{{ object?.isActive ? '⏸️' : '▶️' }}</span>
|
||||
{{ object?.isActive ? 'Деактивировать' : 'Активировать' }}
|
||||
</button>
|
||||
@@ -411,7 +413,7 @@ const toggleObjectStatus = async () => {
|
||||
// В реальном приложении здесь был бы API-запрос
|
||||
}
|
||||
|
||||
const handleBooking = (bookingData: any) => {
|
||||
const handleBooking = (bookingData: unknown) => {
|
||||
console.log('Booking confirmed:', bookingData)
|
||||
showBookingModal.value = false
|
||||
// Здесь обработка бронирования
|
||||
|
||||
@@ -237,7 +237,7 @@ const userInitials = computed(() => {
|
||||
if (!auth.user.value?.full_name) return '??'
|
||||
|
||||
const names = auth.user.value.full_name.split(' ')
|
||||
if (names.length >= 2) {
|
||||
if (names.length >= 2 && names[0] && names[1]) {
|
||||
return `${names[0][0]}${names[1][0]}`.toUpperCase()
|
||||
}
|
||||
return auth.user.value.full_name.substring(0, 2).toUpperCase()
|
||||
|
||||
@@ -16,6 +16,7 @@ export default defineNuxtConfig({
|
||||
|
||||
sitemap: {
|
||||
// Базовые настройки
|
||||
// @ts-expect-error becouse of this line siteUrl is note defined in linter
|
||||
siteUrl: 'https://easysite102.ru',
|
||||
gzip: true,
|
||||
cacheMaxAgeSeconds: 3600, // Кэширование на 1 час
|
||||
@@ -78,14 +79,6 @@ export default defineNuxtConfig({
|
||||
// Игнорируем внешние URL при пререндере
|
||||
crawlLinks: false
|
||||
},
|
||||
devProxy: {
|
||||
'/api': {
|
||||
target: 'https://easysite102.ru',
|
||||
changeOrigin: true,
|
||||
// Явно указываем перезапись пути
|
||||
rewrite: (path) => path.replace(/^\/api/, '/api')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -112,6 +105,8 @@ export default defineNuxtConfig({
|
||||
|
||||
|
||||
ui: {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
preset: 'none', // Отключает предустановленные стили
|
||||
fonts: false // Отключает автоподключение шрифтов
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user