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