bx-1028-policy #20
|
@ -1,8 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { apiFetch } from '~/utils/apiFetch';
|
import { apiFetch } from '~/utils/apiFetch';
|
||||||
|
|
||||||
const { data: menuData } = await apiFetch<ApiMenuType>(`menu/1/?ordering=order`)
|
const { data: menuData } = await apiFetch<ApiMenuType>(`menu/1/`)
|
||||||
const pagesData = menuData.value ? menuData.value.pages : []
|
const pagesData = (menuData.value ? menuData.value.pages : []).sort((a, b) => a.order - b.order)
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { apiFetch } from './utils/apiFetch';
|
||||||
import type { NuxtError } from '#app'
|
import type { NuxtError } from '#app'
|
||||||
import og_img from '/og_img.png'
|
import og_img from '/og_img.png'
|
||||||
|
|
||||||
const { data: seoData } = await apiFetch<ApiKpType>(`kp/2`)
|
const { data: seoData } = await apiFetch<ApiKpType>(`kp/2/`)
|
||||||
useSeoMeta({
|
useSeoMeta({
|
||||||
title: seoData.value?.title,
|
title: seoData.value?.title,
|
||||||
ogTitle: seoData.value?.title,
|
ogTitle: seoData.value?.title,
|
||||||
|
@ -20,7 +20,7 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
if(route.path !== '/404') {
|
if(route.path !== '/404') {
|
||||||
navigateTo('/404')
|
// navigateTo('/404')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -42,6 +42,11 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
vue: {
|
||||||
|
compilerOptions: {
|
||||||
|
isCustomElement: (tag) => ['nobr'].includes(tag),
|
||||||
|
}
|
||||||
|
},
|
||||||
ssr: true,
|
ssr: true,
|
||||||
modules: [
|
modules: [
|
||||||
'@nuxtjs/tailwindcss',
|
'@nuxtjs/tailwindcss',
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { marked } from 'marked';
|
||||||
|
|
||||||
import og_img from '/og_img.png'
|
import og_img from '/og_img.png'
|
||||||
|
|
||||||
const { data: seoData } = await apiFetch<ApiKpType>(`kp/1`)
|
const { data: seoData } = await apiFetch<ApiKpType>(`kp/1/`)
|
||||||
useSeoMeta({
|
useSeoMeta({
|
||||||
title: seoData.value?.title,
|
title: seoData.value?.title,
|
||||||
ogTitle: seoData.value?.title,
|
ogTitle: seoData.value?.title,
|
||||||
|
@ -17,7 +17,7 @@ useSeoMeta({
|
||||||
// twitterCard: 'summary_large_image',
|
// twitterCard: 'summary_large_image',
|
||||||
})
|
})
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { data } = await apiFetch<ApiPagesType>(`pages/${route.params.slug}`)
|
const { data } = await apiFetch<ApiPagesType>(`pages/${route.params.slug}/`)
|
||||||
if (!data.value) {
|
if (!data.value) {
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 404,
|
statusCode: 404,
|
||||||
|
@ -38,6 +38,9 @@ const policyText = computed(() => {
|
||||||
<div class="col-span-full prose max-w-full" v-html="policyText" />
|
<div class="col-span-full prose max-w-full" v-html="policyText" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="siteblock-image" v-if="data?.image">
|
||||||
|
<NuxtImg :src="[imgBase, data?.image].join('/')" :alt="data.title || 'фоновая картинка'" title="" format="webp" />
|
||||||
|
</div>
|
||||||
<div class="siteblock siteblock_calc bg-white">
|
<div class="siteblock siteblock_calc bg-white">
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<CalcModels />
|
<CalcModels />
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { marked } from 'marked';
|
||||||
|
|
||||||
import og_img from '/og_img.png'
|
import og_img from '/og_img.png'
|
||||||
|
|
||||||
const { data: seoData } = await apiFetch<ApiKpType>(`kp/1`)
|
const { data: seoData } = await apiFetch<ApiKpType>(`kp/1/`)
|
||||||
useSeoMeta({
|
useSeoMeta({
|
||||||
title: seoData.value?.title,
|
title: seoData.value?.title,
|
||||||
ogTitle: seoData.value?.title,
|
ogTitle: seoData.value?.title,
|
||||||
|
|
|
@ -22,6 +22,7 @@ type ApiMenuType = {
|
||||||
|
|
||||||
type ApiPagesType = {
|
type ApiPagesType = {
|
||||||
id: number
|
id: number
|
||||||
|
order: number
|
||||||
title: string
|
title: string
|
||||||
menu_title: string
|
menu_title: string
|
||||||
slug: string
|
slug: string
|
||||||
|
|
|
@ -7,7 +7,8 @@ export async function apiFetch<T>(path: string) {
|
||||||
baseURL: config.public.baseUrl,
|
baseURL: config.public.baseUrl,
|
||||||
headers,
|
headers,
|
||||||
onResponseError({ response }) {
|
onResponseError({ response }) {
|
||||||
console.log(response)
|
console.log(response.status)
|
||||||
|
console.log(response.url)
|
||||||
window.location.pathname = '/404'
|
window.location.pathname = '/404'
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 404,
|
statusCode: 404,
|
||||||
|
|
Loading…
Reference in New Issue