|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!-- <div class="relative">--> |
|
|
|
|
|
<!-- <el-image src="https://oss.wsdns.cn/20241108/dbb0ef723f414394bbf6736818f7ac2c.png" class="absolute top-0 z-0" />--> |
|
|
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
|
<!-- <div class="relative">--> |
|
|
|
|
|
<!-- <el-image src="https://oss.wsdns.cn/20241108/dbb0ef723f414394bbf6736818f7ac2c.png" class="absolute top-0 z-0" />--> |
|
|
|
|
|
<!-- </div>--> |
|
|
<div class="w-full bg-white pb-20 mb-3"> |
|
|
<div class="w-full bg-white pb-20 mb-3"> |
|
|
<div class="text-center flex flex-col items-center py-15 relative bg-white"> |
|
|
<div class="text-center flex flex-col items-center py-15 relative bg-white"> |
|
|
<div class="sub-title"> |
|
|
<div class="sub-title"> |
|
@ -14,25 +14,30 @@ |
|
|
</h2> |
|
|
</h2> |
|
|
</div> |
|
|
</div> |
|
|
<div class="xl:w-screen-2xl m-auto text-xl"> |
|
|
<div class="xl:w-screen-2xl m-auto text-xl"> |
|
|
<el-row :gutter="20"> |
|
|
|
|
|
|
|
|
<el-row :gutter="20" v-if="showNews"> |
|
|
<el-col :span="10"> |
|
|
<el-col :span="10"> |
|
|
<div class="carousel py-2"> |
|
|
|
|
|
|
|
|
<div class="carousel py-2 right-to-left"> |
|
|
<el-carousel indicator-position="none" height="400px"> |
|
|
<el-carousel indicator-position="none" height="400px"> |
|
|
<el-carousel-item class="relative" v-for="(item,index) in hotList" :key="index"> |
|
|
<el-carousel-item class="relative" v-for="(item,index) in hotList" :key="index"> |
|
|
<el-image :src="item.image" @click="openSpmUrl(`/detail`,item,item.articleId,true)" class="cursor-pointer" /> |
|
|
|
|
|
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0">{{ item.title }}</div> |
|
|
|
|
|
|
|
|
<el-image :src="item.image" @click="openSpmUrl(`/detail`,item,item.articleId,true)" |
|
|
|
|
|
class="cursor-pointer"/> |
|
|
|
|
|
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0"> |
|
|
|
|
|
{{ item.title }} |
|
|
|
|
|
</div> |
|
|
</el-carousel-item> |
|
|
</el-carousel-item> |
|
|
</el-carousel> |
|
|
</el-carousel> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="13"> |
|
|
<el-col :span="13"> |
|
|
<div class="tabs px-10 w-full"> |
|
|
|
|
|
|
|
|
<div class="tabs px-10 w-full left-2-right"> |
|
|
<el-tabs class="custom-tabs" v-model="categoryId" @tab-change="handleClick"> |
|
|
<el-tabs class="custom-tabs" v-model="categoryId" @tab-change="handleClick"> |
|
|
<el-tab-pane v-for="(cate,index) in category?.data" :key="index" :label="cate.title" :name="cate.navigationId" class="text-xl" /> |
|
|
|
|
|
|
|
|
<el-tab-pane v-for="(cate,index) in category?.data" :key="index" :label="cate.title" |
|
|
|
|
|
:name="cate.navigationId" class="text-xl"/> |
|
|
</el-tabs> |
|
|
</el-tabs> |
|
|
<template v-for="(item,index) in list" :key="index"> |
|
|
<template v-for="(item,index) in list" :key="index"> |
|
|
<li class="flex justify-between py-2"> |
|
|
<li class="flex justify-between py-2"> |
|
|
<a class="line-clamp-1 max-w-2xl" :class="`item-${index}`" :href="getSpmUrl(`/detail`,item,item.articleId)" target="_blank">{{ item.title }}</a> |
|
|
|
|
|
|
|
|
<a class="line-clamp-1 max-w-2xl" :class="`item-${index}`" |
|
|
|
|
|
:href="getSpmUrl(`/detail`,item,item.articleId)" target="_blank">{{ item.title }}</a> |
|
|
<span class="text-gray-400 font-200">{{ dayjs(item.createTime).format('YYYY-MM-DD') }}</span> |
|
|
<span class="text-gray-400 font-200">{{ dayjs(item.createTime).format('YYYY-MM-DD') }}</span> |
|
|
</li> |
|
|
</li> |
|
|
</template> |
|
|
</template> |
|
@ -58,11 +63,12 @@ import type {CmsNavigation} from "~/api/cms/cmsNavigation/model"; |
|
|
const props = withDefaults( |
|
|
const props = withDefaults( |
|
|
defineProps<{ |
|
|
defineProps<{ |
|
|
config?: any; |
|
|
config?: any; |
|
|
parentId?: number; |
|
|
|
|
|
|
|
|
parentId?: number | string; |
|
|
list?: any[]; |
|
|
list?: any[]; |
|
|
disabled?: boolean; |
|
|
disabled?: boolean; |
|
|
title?: string; |
|
|
title?: string; |
|
|
comments?: string; |
|
|
comments?: string; |
|
|
|
|
|
scrollTop: number; |
|
|
}>(), |
|
|
}>(), |
|
|
{ |
|
|
{ |
|
|
title: '卡片标题', |
|
|
title: '卡片标题', |
|
@ -101,12 +107,12 @@ if (hotResponse.value?.data) { |
|
|
|
|
|
|
|
|
// 请求文章栏目 |
|
|
// 请求文章栏目 |
|
|
const getCategory = async () => { |
|
|
const getCategory = async () => { |
|
|
const { data: categoryInfo } = await useServerRequest<ApiResult<CmsNavigation[]>>('/cms/cms-navigation', { |
|
|
|
|
|
|
|
|
const {data: categoryInfo} = await useServerRequest<ApiResult<CmsNavigation[]>>('/cms/cms-navigation', { |
|
|
params: { |
|
|
params: { |
|
|
parentId: props.parentId |
|
|
parentId: props.parentId |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if(categoryInfo.value){ |
|
|
|
|
|
|
|
|
if (categoryInfo.value) { |
|
|
category.value = categoryInfo.value |
|
|
category.value = categoryInfo.value |
|
|
categoryId.value = categoryInfo.value?.data && categoryInfo.value?.data[0].navigationId |
|
|
categoryId.value = categoryInfo.value?.data && categoryInfo.value?.data[0].navigationId |
|
|
} |
|
|
} |
|
@ -126,11 +132,47 @@ const reload = async () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const showNews = ref(false) |
|
|
|
|
|
|
|
|
watch( |
|
|
watch( |
|
|
() => props.parentId, |
|
|
|
|
|
() => { |
|
|
|
|
|
|
|
|
() => [props.parentId, props.scrollTop], |
|
|
|
|
|
([parentId, scrollTop]) => { |
|
|
getCategory(); |
|
|
getCategory(); |
|
|
|
|
|
if (props.scrollTop > 70) showNews.value = true |
|
|
}, |
|
|
}, |
|
|
{immediate: true} |
|
|
{immediate: true} |
|
|
); |
|
|
); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
|
|
|
|
|
|
|
|
.left-2-right { |
|
|
|
|
|
animation: left-2-right-ani; |
|
|
|
|
|
animation-duration: 0.5s; |
|
|
|
|
|
animation-fill-mode: forwards; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@keyframes left-2-right-ani { |
|
|
|
|
|
from { |
|
|
|
|
|
transform: translateX(100%); |
|
|
|
|
|
} |
|
|
|
|
|
to { |
|
|
|
|
|
transform: translateX(0); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.right-to-left { |
|
|
|
|
|
animation: right-to-left-ani; |
|
|
|
|
|
animation-duration: 0.5s; |
|
|
|
|
|
animation-fill-mode: forwards; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@keyframes right-to-left-ani { |
|
|
|
|
|
from { |
|
|
|
|
|
transform: translateX(-100%); |
|
|
|
|
|
} |
|
|
|
|
|
to { |
|
|
|
|
|
transform: translateX(0); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|