forked from gxwebsoft/yufengxing-pc
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.5 KiB
106 lines
2.5 KiB
<template>
|
|
<div class="w-full bg-gray-100 pb-20">
|
|
<div class="text-center flex flex-col items-center py-15 relative ">
|
|
<div class="sub-title">
|
|
<p class="text-gray-200 text-6xl font-bold dark:text-gray-700 py-0 line-height-5">
|
|
{{ comments }}
|
|
</p>
|
|
</div>
|
|
<h2 class="text-3xl font-bold tracking-tight text-[#FF6E0CFF] dark:text-white sm:text-4xl lg:text-5xl">
|
|
{{ title }}
|
|
</h2>
|
|
</div>
|
|
<div class="xl:w-screen-xl m-auto text-xl right-to-left" v-if="show">
|
|
<el-carousel :interval="4000" type="card" height="350px" arrow="never" indicator-position="none">
|
|
<el-carousel-item class="relative" v-for="(item,index) in list" :key="index">
|
|
<el-image :src="item.path" class="cursor-pointer scale-img w-full" />
|
|
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0" v-if="item.comments">{{ item.comments }}</div>
|
|
</el-carousel-item>
|
|
</el-carousel>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import {useServerRequest} from "~/composables/useServerRequest";
|
|
import type {ApiResult, PageResult} from "~/api";
|
|
import type {FileRecord} from "~/api/system/file/model";
|
|
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
config?: any;
|
|
groupId?: number;
|
|
title?: string;
|
|
comments?: string;
|
|
scrollTop: number;
|
|
}>(),
|
|
{
|
|
title: '卡片标题',
|
|
comments: '卡片描述'
|
|
}
|
|
);
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'done'): void;
|
|
}>();
|
|
|
|
const list = ref<FileRecord[]>([])
|
|
|
|
const reload = async () => {
|
|
const {data: response} = await useServerRequest<ApiResult<PageResult<FileRecord>>>('/file/page',{
|
|
baseURL: 'https://server.gxwebsoft.com/api',
|
|
query: {
|
|
groupId: props.groupId
|
|
}
|
|
})
|
|
if(response.value?.data){
|
|
if(response.value?.data.list){
|
|
list.value = response.value?.data.list
|
|
}
|
|
}
|
|
}
|
|
|
|
const show = ref(false)
|
|
watch(
|
|
() => [props.groupId, props.scrollTop],
|
|
() => {
|
|
reload();
|
|
if (props.scrollTop >= 2280) show.value = true
|
|
},
|
|
|
|
{immediate: true}
|
|
);
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.scale-img:hover {
|
|
animation: scale;
|
|
animation-duration: 0.5s;
|
|
animation-fill-mode: forwards;
|
|
}
|
|
|
|
@keyframes scale {
|
|
from {
|
|
transform: scale(1);
|
|
}
|
|
to {
|
|
transform: scale(1.1);
|
|
}
|
|
}
|
|
|
|
.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>
|