This commit is contained in:
@ -1,41 +1,42 @@
|
||||
import config from "./config";
|
||||
import config from './config'
|
||||
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
import head from "./config/head";
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import head from './config/head'
|
||||
// import sitemap from "./config/sitemap";
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: "2025-05-15",
|
||||
compatibilityDate: '2025-05-15',
|
||||
devtools: { enabled: true },
|
||||
|
||||
devServer: {
|
||||
host: "localhost",
|
||||
host: 'localhost',
|
||||
port: 4002,
|
||||
},
|
||||
|
||||
nitro: {
|
||||
output: {
|
||||
dir: "./dist",
|
||||
dir: './dist',
|
||||
},
|
||||
},
|
||||
|
||||
alias: {
|
||||
"@": fileURLToPath(new URL("./", import.meta.url)),
|
||||
'@': fileURLToPath(new URL('./', import.meta.url)),
|
||||
},
|
||||
|
||||
css: ["@/assets/css/tailwind.css"],
|
||||
css: ['@/assets/css/tailwind.css'],
|
||||
...config,
|
||||
htmlValidator: {
|
||||
usePrettier: true,
|
||||
logLevel: "error",
|
||||
logLevel: 'error',
|
||||
failOnError: false,
|
||||
},
|
||||
app: {
|
||||
head: {
|
||||
title: 'Vino Galante',
|
||||
htmlAttrs: {
|
||||
lang: "ru",
|
||||
lang: 'ru',
|
||||
},
|
||||
...head,
|
||||
},
|
||||
},
|
||||
});
|
||||
})
|
||||
|
@ -16,11 +16,7 @@
|
||||
<section>
|
||||
<div class="w-11/12 h-full flex flex-col justify-start">
|
||||
<div>
|
||||
<UiHeading
|
||||
tag="H1"
|
||||
class="whitespace-pre-line [&]:font-bold"
|
||||
size="300"
|
||||
>
|
||||
<UiHeading tag="H1" class="whitespace-pre-line [&]:font-bold" size="300">
|
||||
{{ book.title }}
|
||||
</UiHeading>
|
||||
<UiParagraph class="mb-10" size="250">
|
||||
@ -41,9 +37,7 @@
|
||||
<!--левый-->
|
||||
<div class="flex flex-col items-center min-h-[310px]">
|
||||
<div class="flex flex-row">
|
||||
<UiParagraph class="[&]:text-6xl"
|
||||
>{{ book.price }} </UiParagraph
|
||||
>
|
||||
<UiParagraph class="[&]:text-6xl">{{ book.price }} </UiParagraph>
|
||||
<img src="/img/svg/books/ruble.svg" alt="ruble" />
|
||||
</div>
|
||||
<div class="mr-10 flex items-center flex-col gap-3">
|
||||
@ -59,9 +53,7 @@
|
||||
<div class="min-h-[310px]">
|
||||
<!--о книге-->
|
||||
<div>
|
||||
<ul
|
||||
class="flex flex-row mr-14 items-center justify-between lg:whitespace-nowrap"
|
||||
>
|
||||
<ul class="flex flex-row mr-14 items-center justify-between lg:whitespace-nowrap">
|
||||
<li class="flex flex-row mr-14 gap-3 items-center">
|
||||
<img src="/img/svg/books/book-pages.svg" alt="страниц" />
|
||||
<UiParagraph size="250" as="span">
|
||||
@ -69,10 +61,7 @@
|
||||
</UiParagraph>
|
||||
</li>
|
||||
<li class="flex flex-row mr-14 gap-3 items-center">
|
||||
<img
|
||||
src="/img/svg/books/book-illustrations.svg"
|
||||
alt="иллюстраций"
|
||||
/>
|
||||
<img src="/img/svg/books/book-illustrations.svg" alt="иллюстраций" />
|
||||
<UiParagraph size="250" as="span">
|
||||
{{ book.illust }}
|
||||
</UiParagraph>
|
||||
@ -88,14 +77,9 @@
|
||||
|
||||
<!--навигация по книге-->
|
||||
<div class="mt-24">
|
||||
<ul
|
||||
class="flex flex-row mr-32 items-end justify-between lg:whitespace-nowrap"
|
||||
>
|
||||
<ul class="flex flex-row mr-32 items-end justify-between lg:whitespace-nowrap">
|
||||
<li class="flex flex-row items-center">
|
||||
<NuxtLink
|
||||
to="#"
|
||||
class="flex flex-col items-center cursor-pointer"
|
||||
>
|
||||
<NuxtLink to="#" class="flex flex-col items-center cursor-pointer">
|
||||
<div class="w-[62px] h-[58px]">
|
||||
<img
|
||||
src="/img/svg/books/read.svg"
|
||||
@ -105,16 +89,11 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<UiParagraph size="250" as="span">
|
||||
Читай отрывок
|
||||
</UiParagraph>
|
||||
<UiParagraph size="250" as="span"> Читай отрывок </UiParagraph>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li class="flex flex-row gap-3 items-center">
|
||||
<NuxtLink
|
||||
to="#"
|
||||
class="flex flex-col items-center gap-4 cursor-pointer"
|
||||
>
|
||||
<NuxtLink to="#" class="flex flex-col items-center gap-4 cursor-pointer">
|
||||
<div class="w-[62px] h-[53px]">
|
||||
<img
|
||||
src="/img/svg/books/download.svg"
|
||||
@ -124,9 +103,7 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<UiParagraph size="250" as="span">
|
||||
Скачай отрывок
|
||||
</UiParagraph>
|
||||
<UiParagraph size="250" as="span"> Скачай отрывок </UiParagraph>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li class="flex flex-row gap-3 items-center">
|
||||
@ -135,12 +112,7 @@
|
||||
class="flex flex-col items-center gap-3 cursor-pointer"
|
||||
>
|
||||
<div class="w-[62px] h-[53px]">
|
||||
<img
|
||||
src="/img/svg/books/down2.svg"
|
||||
alt="Содержание"
|
||||
width="62"
|
||||
height="53"
|
||||
/>
|
||||
<img src="/img/svg/books/down2.svg" alt="Содержание" width="62" height="53" />
|
||||
</div>
|
||||
|
||||
<UiParagraph size="250" as="span"> Содержание </UiParagraph>
|
||||
@ -153,9 +125,7 @@
|
||||
<!--нижний блок-->
|
||||
<section class="ml-20 mt-32">
|
||||
<div>
|
||||
<UiHeading tag="h2" size="300" class="text-three">
|
||||
Что ты узнаешь
|
||||
</UiHeading>
|
||||
<UiHeading tag="h2" size="300" class="text-three"> Что ты узнаешь </UiHeading>
|
||||
<ul class="flex mt-20 flex-row items-center justify-between">
|
||||
<li
|
||||
class="flex flex-col-reverse justify-end w-32 gap-4 h-64 items-center transition-transform transform hover:scale-110"
|
||||
@ -171,10 +141,7 @@
|
||||
</div>
|
||||
<div class="flex justify-center text-center mt-36">
|
||||
<UiParagraph>
|
||||
Или купи на ЛитРес - <br /><a
|
||||
class="text-three"
|
||||
:href="book.href"
|
||||
target="_blank"
|
||||
Или купи на ЛитРес - <br /><a class="text-three" :href="book.href" target="_blank"
|
||||
>Реферальная ссылка для поддержки автора</a
|
||||
>
|
||||
</UiParagraph>
|
||||
@ -188,59 +155,59 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from "vue";
|
||||
import { useRoute } from "#app";
|
||||
import UiHeading from "@/components/Typography/UiHeading.vue";
|
||||
import UiParagraph from "@/components/Typography/UiParagraph.vue";
|
||||
import UiButton from "@/components/UiButton/UiButton.vue";
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { useRoute } from '#app'
|
||||
import UiHeading from '@/components/Typography/UiHeading.vue'
|
||||
import UiParagraph from '@/components/Typography/UiParagraph.vue'
|
||||
import UiButton from '@/components/UiButton/UiButton.vue'
|
||||
|
||||
interface BookDetail {
|
||||
id: number;
|
||||
title: string;
|
||||
metaTitle: string;
|
||||
subtitle: string;
|
||||
subdesc: string;
|
||||
description: string;
|
||||
img: string;
|
||||
price: string;
|
||||
buttonText: string;
|
||||
buttonFormat: string;
|
||||
pages: string;
|
||||
illust: string;
|
||||
format: string;
|
||||
id: number
|
||||
title: string
|
||||
metaTitle: string
|
||||
subtitle: string
|
||||
subdesc: string
|
||||
description: string
|
||||
img: string
|
||||
price: string
|
||||
buttonText: string
|
||||
buttonFormat: string
|
||||
pages: string
|
||||
illust: string
|
||||
format: string
|
||||
whoUKnows: Array<{
|
||||
text: string;
|
||||
svg: string;
|
||||
}>;
|
||||
href: string;
|
||||
hrefTitles: string;
|
||||
text: string
|
||||
svg: string
|
||||
}>
|
||||
href: string
|
||||
hrefTitles: string
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const route = useRoute()
|
||||
|
||||
const currentBookData = ref<BookDetail | null>(null);
|
||||
const currentBookData = ref<BookDetail | null>(null)
|
||||
|
||||
const book = computed(() => currentBookData.value);
|
||||
const book = computed(() => currentBookData.value)
|
||||
|
||||
const loadBookData = async (slug: string) => {
|
||||
try {
|
||||
const module = await import(`./_data/${slug}.json`);
|
||||
currentBookData.value = module.default as BookDetail;
|
||||
const module = await import(`./_data/${slug}.json`)
|
||||
currentBookData.value = module.default as BookDetail
|
||||
} catch (error) {
|
||||
console.error(`Ошибка при загрузке книги с slug '${slug}':`, error);
|
||||
currentBookData.value = null;
|
||||
console.error(`Ошибка при загрузке книги с slug '${slug}':`, error)
|
||||
currentBookData.value = null
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => route.params.slug,
|
||||
async (newSlug) => {
|
||||
if (newSlug) {
|
||||
await loadBookData(newSlug as string);
|
||||
await loadBookData(newSlug as string)
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
watch(book, (newBook) => {
|
||||
if (newBook) {
|
||||
@ -248,17 +215,17 @@ watch(book, (newBook) => {
|
||||
title: `${newBook.metaTitle} | Vino Galante`,
|
||||
meta: [
|
||||
{
|
||||
name: "description",
|
||||
content: "Онлайн магазин книг автора Vino Galante",
|
||||
name: 'description',
|
||||
content: 'Онлайн магазин книг автора Vino Galante',
|
||||
},
|
||||
],
|
||||
link: [
|
||||
{
|
||||
rel: "canonical",
|
||||
rel: 'canonical',
|
||||
href: `https://ebook.miduway.space/books/${route.params.slug}`,
|
||||
},
|
||||
],
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user