|
@@ -13,7 +13,13 @@
|
|
|
v-for="(item, key) in carouselData.content.value"
|
|
v-for="(item, key) in carouselData.content.value"
|
|
|
:key="key"
|
|
:key="key"
|
|
|
>
|
|
>
|
|
|
- <img class="main-header-image" :src="item.image" />
|
|
|
|
|
|
|
+ <a
|
|
|
|
|
+ :href="item.url || item.image"
|
|
|
|
|
+ target="_blank"
|
|
|
|
|
+ rel="noopener noreferrer"
|
|
|
|
|
+ >
|
|
|
|
|
+ <img class="main-header-image" :src="item.image" />
|
|
|
|
|
+ </a>
|
|
|
</Slide>
|
|
</Slide>
|
|
|
<template #addons>
|
|
<template #addons>
|
|
|
<Navigation />
|
|
<Navigation />
|
|
@@ -165,7 +171,7 @@
|
|
|
>
|
|
>
|
|
|
<img
|
|
<img
|
|
|
:src="item.image" style="width: 100%; height: 100%; object-fit: contain;"
|
|
:src="item.image" style="width: 100%; height: 100%; object-fit: contain;"
|
|
|
- @click="handleImageClick(item.image)"
|
|
|
|
|
|
|
+ @click="handleImageClick(item)"
|
|
|
>
|
|
>
|
|
|
</Slide>
|
|
</Slide>
|
|
|
<template #addons>
|
|
<template #addons>
|
|
@@ -228,6 +234,7 @@ import CarouselItem2 from '@/assets/images/board1/2.jpg';
|
|
|
import CarouselItem3 from '@/assets/images/board1/3.jpg';
|
|
import CarouselItem3 from '@/assets/images/board1/3.jpg';
|
|
|
import CarouselItem4 from '@/assets/images/board1/4.jpg';
|
|
import CarouselItem4 from '@/assets/images/board1/4.jpg';
|
|
|
import CarouselItem5 from '@/assets/images/board1/5.jpg';
|
|
import CarouselItem5 from '@/assets/images/board1/5.jpg';
|
|
|
|
|
+import type { ICarousel } from '~~/server/api/ecms/carousel';
|
|
|
|
|
|
|
|
const carouselConfig = {
|
|
const carouselConfig = {
|
|
|
itemsToShow: 1,
|
|
itemsToShow: 1,
|
|
@@ -235,7 +242,7 @@ const carouselConfig = {
|
|
|
autoplay: 5000,
|
|
autoplay: 5000,
|
|
|
}
|
|
}
|
|
|
const carouselData = await useSSrSimpleDataLoader('carousel', async () => {
|
|
const carouselData = await useSSrSimpleDataLoader('carousel', async () => {
|
|
|
- const res = await $fetch(`/api/ecms/carousel`);
|
|
|
|
|
|
|
+ const res = await $fetch(`/api/ecms/carousel?name=banner`);
|
|
|
if (!res.status)
|
|
if (!res.status)
|
|
|
throw new Error(res.message);
|
|
throw new Error(res.message);
|
|
|
return res.data;
|
|
return res.data;
|
|
@@ -290,8 +297,8 @@ const featured = await useSSrSimpleDataLoader('featured', async () => {
|
|
|
return res.data;
|
|
return res.data;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-function handleImageClick(image: string) {
|
|
|
|
|
- window.open(image, '_blank');
|
|
|
|
|
|
|
+function handleImageClick(image: ICarousel) {
|
|
|
|
|
+ window.open(image.url || image.image, '_blank');
|
|
|
}
|
|
}
|
|
|
function handleServiceClick(service: string) {
|
|
function handleServiceClick(service: string) {
|
|
|
Modal.info({
|
|
Modal.info({
|