百色农校
This commit is contained in:
@@ -15,7 +15,7 @@ import {listCmsLink, pageCmsLink} from "~/api/cms/cmsLink";
|
||||
import type {CmsLink} from "~/api/cms/cmsLink/model";
|
||||
|
||||
const list = ref<CmsLink[]>([])
|
||||
pageCmsLink({limit: 10}).then(res => {
|
||||
pageCmsLink({limit: 8}).then(res => {
|
||||
list.value = res?.list || [];
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<div class="flex flex-col text-base">
|
||||
<p class="text-base text-gray-400 py-2 font-bold">APP客户端</p>
|
||||
<p class="text-base text-gray-400 py-2 font-bold">扫一扫关注公众号</p>
|
||||
<el-avatar :src="config.wxQrcode" shape="square" :size="120" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
<template>
|
||||
<!-- 头部组件 -->
|
||||
<div class="sm:p-0 px-4 shadow-sm fixed z-100 top-0 w-full bg-white">
|
||||
<div class="shadow-sm fixed z-100 top-0 left-0 w-full bg-white">
|
||||
<!-- 顶部通栏 -->
|
||||
<TopBar />
|
||||
<!-- 导航栏 -->
|
||||
<div class="flex justify-between xl:w-screen-xl m-auto">
|
||||
<el-space>
|
||||
<Logo />
|
||||
<Menu :data="navigations" />
|
||||
</el-space>
|
||||
<div class="flex justify-between clear-both hidden-sm-and-down">
|
||||
<div class="flex flex-col w-full">
|
||||
<div class="flex justify-between menu-bg w-full py-3">
|
||||
<div class="xl:w-screen-xl m-auto flex justify-between">
|
||||
<Logo />
|
||||
<img src="https://gxbsnx.com/Temp/images/background/title_right.png" width="291" height="88" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full bg-white">
|
||||
<div class="xl:w-screen-xl m-auto">
|
||||
<Menu :data="navigations" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Login />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -72,16 +72,6 @@
|
||||
<el-menu-item v-else :index="`${index}`"><a :href="navTo(item)">{{ item.title }}</a></el-menu-item>
|
||||
</template>
|
||||
</el-menu>
|
||||
<!-- <div v-if="setting.searchBtn" class="search-tools flex justify-center p-4 mt-5">-->
|
||||
<!-- <el-input v-model="keywords" placeholder="请输入关键词..." :suffix-icon="Search" @change="onSearch"/>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="setting.langBtn" class="lang flex justify-center text-center">-->
|
||||
<!-- <el-space>-->
|
||||
<!-- <a @click="onLang(`zh`)" class="text-sm text-gray-500">中文版</a>-->
|
||||
<!-- <el-divider direction="vertical" />-->
|
||||
<!-- <a @click="onLang(`en`)" class="text-sm text-gray-400">English</a>-->
|
||||
<!-- </el-space>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<nuxt-link to="/" class="flex items-center cursor-pointer gap-sm mr-7" v-if="website">
|
||||
<el-image v-if="website.websiteLogo || logo?.value" :style="`${logo?.style}`" :src="logo?.value || website?.websiteLogo" class="rounded-sm rounded-sm sm:w-[158px] sm:h-[54px] h-[50px] py-1 sm:py-0"/>
|
||||
<el-image v-if="website.websiteLogo || logo?.value" :style="`${logo?.style}`" :src="logo?.value || website?.websiteLogo" class="rounded-sm rounded-sm sm:w-[360px] sm:h-[80px] h-[80px] py-1 sm:py-0"/>
|
||||
<h4 v-else class="text-gray-700 text-xl font-bold" :style="`${logo?.style}`">{{ website?.websiteName }}</h4>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
|
||||
@@ -1,28 +1,62 @@
|
||||
<script setup lang="ts">
|
||||
import {useConfigInfo} from "~/composables/configState";
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import {useConfigInfo, useMenu} from "~/composables/configState";
|
||||
import { Search,Message, Fold } from '@element-plus/icons-vue'
|
||||
const config = useConfigInfo();
|
||||
const keyword = ref<string>('');
|
||||
const i18n = useI18n();
|
||||
const navigations = useMenu();
|
||||
const drawer = ref<boolean>(false);
|
||||
|
||||
const onSearch = () => {
|
||||
window.location.href = `/${i18n.locale.value}/search/${keyword.value}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class=" bg-blue-50 text-gray-400 px-2 py-1" v-if="config.showTopBar == 'true'">
|
||||
<div class="w1200 flex justify-between items-center">
|
||||
<span>{{ config?.topWelcomeInfo }}</span>
|
||||
<div class="head-bg bg-blue-50 text-gray-400 px-2">
|
||||
<div class=" flex justify-between items-center xl:w-screen-xl m-auto sm:px-0 w-full">
|
||||
<span class="text-white">{{ config?.topWelcomeInfo }}</span>
|
||||
<div class="lang flex justify-center text-center items-center">
|
||||
<el-space>
|
||||
<div class="search">
|
||||
<div class="fl mr-5">
|
||||
<el-space size="large">
|
||||
<a :href="`/zh?spm=zh_CN`" class="text-xs flex items-center hidden-sm-and-down"><el-icon color="#fff" size="16"><Message /></el-icon><span class="text-white px-1">校长信箱</span></a>
|
||||
<a :href="`https://old.gxbsnx.com`" class="text-xs flex items-center hidden-sm-and-down"><el-icon color="#fff" size="16"><Message /></el-icon><span class="text-white px-1">旧版</span></a>
|
||||
<div class="search mx-5 hidden-sm-and-down">
|
||||
<div class="fl">
|
||||
<el-input v-model="keyword" :placeholder="`${$t('searchKeywords')}...`" :suffix-icon="Search" @change="onSearch" />
|
||||
</div>
|
||||
</div>
|
||||
<a :href="`/zh?spm=zh_CN`" class="text-sm"><span class="text-gray-500">中文版</span></a>
|
||||
<el-divider direction="vertical" />
|
||||
<a :href="`/en?spm=en_US`" class="text-sm"><span class="text-gray-500">English</span></a>
|
||||
<!-- 移动端 -->
|
||||
<div class="hidden-sm-and-up">
|
||||
<div class="hidden-sm-and-up mx-5 sm:mx-0">
|
||||
<div class="el-dropdown-link flex items-center" @click="drawer = true">
|
||||
<el-icon color="white" :size="24"><Fold /></el-icon>
|
||||
</div>
|
||||
<el-drawer
|
||||
v-model="drawer"
|
||||
:size="290"
|
||||
>
|
||||
<div id="menu">
|
||||
<el-menu
|
||||
currentIndex="/product"
|
||||
:unique-opened="true"
|
||||
>
|
||||
<template v-for="(item,index) in navigations" :key="index">
|
||||
<el-sub-menu v-if="item?.children && item.children.length > 0" :index="`${index}`">
|
||||
<template #title><span>{{ item.title }}</span></template>
|
||||
<el-menu-item v-for="(sub,subIndex) in item.children" :index="`${subIndex}`">
|
||||
<el-space>
|
||||
<el-avatar v-if="sub.icon" :src="sub.icon" shape="square" size="small"></el-avatar>
|
||||
<a :href="navTo(sub)">{{ sub.title }}</a>
|
||||
</el-space>
|
||||
</el-menu-item>
|
||||
</el-sub-menu>
|
||||
<el-menu-item v-else :index="`${index}`"><a :href="navTo(item)">{{ item.title }}</a></el-menu-item>
|
||||
</template>
|
||||
</el-menu>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</div>
|
||||
</el-space>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<!-- 自定义banner -->
|
||||
<div v-if="layout?.banner" class="banner m-auto relative sm:flex hidden-sm-and-down flex justify-center">
|
||||
<el-image :src="layout?.banner" class="min-h-sm sm:h-auto w-full"></el-image>
|
||||
<div class="banner-bar absolute top-0 w-full sm:flex hidden">
|
||||
<div v-if="layout?.banner" class="banner m-auto relative sm:flex hidden-sm-and-down flex justify-center mt-[220px]">
|
||||
<el-image :src="layout?.banner" class="w-screen-xl"></el-image>
|
||||
<div class="banner-bar absolute top-10 w-full sm:flex hidden">
|
||||
<div class="banner-text py-12 md:w-screen-xl m-auto opacity-90 flex flex-col justify-center">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="editor === 1" v-html="data"></div>
|
||||
<MdPreview v-else :id="id" :modelValue="data" />
|
||||
<div v-html="data"></div>
|
||||
<!-- <MdPreview v-else :id="id" :modelValue="data" />-->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
35
components/Index/Ad421.vue
Normal file
35
components/Index/Ad421.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import type {CmsAd} from "~/api/cms/cmsAd/model";
|
||||
import {getCmsAd} from "~/api/cms/cmsAd";
|
||||
|
||||
const ad421 = ref<CmsAd>();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
// 请求数据
|
||||
const reload = async () => {
|
||||
getCmsAd(421).then(res => {
|
||||
if (isMobile.value) {
|
||||
res.height = '67';
|
||||
}
|
||||
ad421.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
reload();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="ad421" v-for="(item,index) in ad421.imageList" :key="index">
|
||||
<nuxt-link :to="ad421.style" class="flex justify-center items-center relative my-4">
|
||||
<el-image class="absolute" :src="item.url" :style="`width: ${ad421.width ? ad421.width + 'px' : 'auto'}; height: ${ad421.height ? ad421.height + 'px' : 'auto'};`" />
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
35
components/Index/Ad422.vue
Normal file
35
components/Index/Ad422.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import type {CmsAd} from "~/api/cms/cmsAd/model";
|
||||
import {getCmsAd} from "~/api/cms/cmsAd";
|
||||
|
||||
const ad422 = ref<CmsAd>();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
// 请求数据
|
||||
const reload = async () => {
|
||||
getCmsAd(422).then(res => {
|
||||
if (isMobile.value) {
|
||||
res.height = '123';
|
||||
}
|
||||
ad422.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
reload();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="ad422" v-for="(item,index) in ad422.imageList" :key="index">
|
||||
<nuxt-link :to="ad422.style" class="flex justify-center items-center relative my-4">
|
||||
<el-image class="absolute" :src="item.url" :style="`width: ${ad422.width ? ad422.width + 'px' : 'auto'}; height: ${ad422.height ? ad422.height + 'px' : 'auto'};`" />
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
58
components/Index/BNNews.vue
Normal file
58
components/Index/BNNews.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="xl:w-screen-xl m-auto py-4 px-4 lg:px-0">
|
||||
<div class="text-center flex flex-col items-center z-0 relative">
|
||||
<h2 class="text-4xl font-bold tracking-tight text-gray-800 dark:text-white">
|
||||
{{ '百农新闻' }}
|
||||
</h2>
|
||||
<div class="sub-title">
|
||||
<p class="text-gray-400 text-sm dark:text-gray-400 py-3">
|
||||
{{ 'BaiSe NongXiao News' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-card shadow="hover">
|
||||
<el-row :gutter="24">
|
||||
<el-col :lg="10" :xs="24">
|
||||
<HotNewsCarousel />
|
||||
</el-col>
|
||||
<el-col :lg="14" :xs="24" class="w-full h-auto">
|
||||
<template v-for="(item, index) in list" :key="index">
|
||||
<nuxt-link :to="`/detail/${item.articleId}.html`" class="item">
|
||||
<div class="text-lg my-3 flex justify-between">
|
||||
<span class="title text-gray-800 hover:text-green-700 text-sm lg:text-lg">{{ item.title }}</span>
|
||||
<span class="text-gray-400 text-sm text-right w-[100px]">{{
|
||||
dayjs(item.createTime).format('MM-DD')
|
||||
}}</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
<div v-if="list.length == 0" class="px-1 text-center text-gray-500 min-h-xs">没有更多了</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { navigateTo } from '#imports';
|
||||
import dayjs from 'dayjs';
|
||||
import type { CmsArticle } from '~/api/cms/cmsArticle/model';
|
||||
import { pageCmsArticle } from '~/api/cms/cmsArticle';
|
||||
import HotNewsCarousel from '~/components/Index/HotNewsCarousel.vue';
|
||||
|
||||
const list = ref<CmsArticle[]>([]);
|
||||
|
||||
// 请求数据
|
||||
const reload = async () => {
|
||||
pageCmsArticle({
|
||||
limit: 8,
|
||||
recommend: 1,
|
||||
parentId: 4131
|
||||
}).then(res => {
|
||||
list.value = res?.list || [];
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
reload();
|
||||
});
|
||||
</script>
|
||||
@@ -1,31 +1,30 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="w-full bg-white mb-3 hidden-sm-and-down" v-if="ad">
|
||||
<div style="margin-top: 210px;" class="w-full bg-white mb-3 hidden-sm-and-down" v-if="ad">
|
||||
<el-carousel :height="`${ad?.height || '500'}px`">
|
||||
<el-carousel-item v-for="(item,index) in ad?.imageList" :key="index">
|
||||
<div class="item relative flex justify-center items-center">
|
||||
<el-image :src="item.url" fit="cover" class="w-full" :style="`height: ${ad?.height}px;`" />
|
||||
<el-image :src="item.url" fit="fill" class="w-full" :style="`height: ${ad?.height}px;`" />
|
||||
<!-- fit: '' | 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'-->
|
||||
</div>
|
||||
{{ad.height}}==
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</div>
|
||||
|
||||
<!-- 移动端 -->
|
||||
<div class="sm:hidden w-full bg-white mt-[48px] mb-3 hidden-sm-and-up" v-if="ad">
|
||||
<el-carousel indicator-position="none" height="150">
|
||||
<div class="sm:hidden w-full bg-white mt-[38px] mb-3 hidden-sm-and-up" v-if="ad">
|
||||
<el-carousel indicator-position="none" height="200">
|
||||
<el-carousel-item v-for="(item,index) in ad?.imageList" :key="index">
|
||||
<el-image :src="item.url" />
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type {CompanyParam} from "~/api/system/company/model";
|
||||
import type {CmsAd} from "~/api/cms/cmsAd/model";
|
||||
import {pageCmsAd} from "~/api/cms/cmsAd";
|
||||
import {getCmsAd, pageCmsAd} from "~/api/cms/cmsAd";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -47,6 +46,9 @@ const emit = defineEmits<{
|
||||
|
||||
const ad = ref<CmsAd>();
|
||||
|
||||
const ad421 = ref<CmsAd>();
|
||||
const ad422 = ref<CmsAd>();
|
||||
|
||||
// 搜索表单
|
||||
const where = reactive<CompanyParam>({
|
||||
keywords: ''
|
||||
@@ -63,6 +65,12 @@ const reload = async () => {
|
||||
ad.value = res.list[0];
|
||||
}
|
||||
})
|
||||
getCmsAd(421).then(res => {
|
||||
ad421.value = res;
|
||||
});
|
||||
getCmsAd(422).then(res => {
|
||||
ad422.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<div class="w-full container-bg bg-blue-600 gap-10 flex justify-center items-center py-6">
|
||||
<span class="text-xl text-white font-bold">联系我们,为您降本增效</span>
|
||||
<el-button size="large" @click="navigateTo(`/order/659.html`)">马上联系</el-button>
|
||||
<el-button size="large" @click="openUrl(`https://zzyx.gxcampus.com/register`)">在线报名</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {navigateTo} from "#imports";
|
||||
import {navigateTo, openUrl} from "#imports";
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
|
||||
@@ -4,22 +4,22 @@
|
||||
<h2 class="text-4xl font-bold tracking-tight text-gray-800 dark:text-white">
|
||||
{{ title || '热点新闻' }}
|
||||
</h2>
|
||||
<!-- <div class="sub-title">-->
|
||||
<!-- <p class="text-gray-400 text-sm dark:text-gray-400 py-3">-->
|
||||
<!-- {{ comments || '官方开发的应用' }}-->
|
||||
<!-- </p>-->
|
||||
<!-- </div>-->
|
||||
<div class="sub-title">
|
||||
<p class="text-gray-400 text-sm dark:text-gray-400 py-3">
|
||||
{{ comments || 'Unlimited Scenery' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="24" id="container" class="clearfix">
|
||||
<el-col v-for="(item,index) in list" :key="index" :xs="24" :span="6" class="left mb-6">
|
||||
<el-col v-for="(item,index) in list" :key="index" :xs="12" :span="6" class="left mb-6">
|
||||
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer" @click="navigateTo(`/detail/${item.articleId}.html`)">
|
||||
<el-image
|
||||
:src="item.image"
|
||||
fit="cover"
|
||||
:lazy="true" class="w-full md:h-[166px] h-[199px] cursor-pointer bg-gray-50"/>
|
||||
:lazy="true" class="w-full md:h-[166px] h-[100px] lg:h-[199px] cursor-pointer bg-gray-50"/>
|
||||
<div class="flex-1 px-4 py-5 sm:p-6 !p-4">
|
||||
<div class="text-gray-700 dark:text-white text-base font-semibold flex flex-col gap-1.5">
|
||||
<div class="line-clamp-2 text-lg min-h-[54px]">
|
||||
<div class="line-clamp-2 text-sm lg:text-lg lg:min-h-[54px] min-h-auto">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -47,9 +47,11 @@
|
||||
<script lang="ts" setup>
|
||||
import {navigateTo} from "#imports";
|
||||
import dayjs from "dayjs";
|
||||
import { View } from '@element-plus/icons-vue'
|
||||
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
|
||||
import {listCmsArticle} from "~/api/cms/cmsArticle";
|
||||
import {listCmsArticle, pageCmsArticle} from "~/api/cms/cmsArticle";
|
||||
import type {CmsArticleParam} from "~/api/cms/cmsArticle/model";
|
||||
import {getImage} from "~/utils/common";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -74,12 +76,14 @@ const id = ref<number>(0);
|
||||
|
||||
// 请求数据
|
||||
const reload = async () => {
|
||||
listCmsArticle({
|
||||
pageCmsArticle({
|
||||
limit: 8,
|
||||
recommend: 1,
|
||||
categoryId: props.categoryId
|
||||
}).then(data => {
|
||||
list.value = data || [];
|
||||
}).then(res => {
|
||||
list.value = res?.list.map(d => {
|
||||
d.image = getImage(d.image)
|
||||
return d;
|
||||
}) || [];
|
||||
})
|
||||
}
|
||||
reload();
|
||||
|
||||
75
components/Index/HotNewsCarousel.vue
Normal file
75
components/Index/HotNewsCarousel.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div class="lg:my-3 my-0 relative">
|
||||
<el-carousel :height="flashHeight + 'px'" indicator-position="none">
|
||||
<el-carousel-item v-for="(item,index) in list" :key="index">
|
||||
<nuxt-link :to="`/detail/${item.articleId}.html`" class="item flex justify-center items-center">
|
||||
<img :src="`${FILE_SERVER}${item.image}`" class="w-[500px] h-[380px]" />
|
||||
<div class="absolute bottom-3 z-100 text-white font-bold px-4 line-clamp-1 text-sm lg:text-lg">{{ item.title }}</div>
|
||||
</nuxt-link>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type {CompanyParam} from "~/api/system/company/model";
|
||||
import {pageCmsArticle} from "~/api/cms/cmsArticle";
|
||||
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
|
||||
import {FILE_SERVER} from "~/config";
|
||||
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
config?: any;
|
||||
list?: any[];
|
||||
disabled?: boolean;
|
||||
title?: string;
|
||||
comments?: string;
|
||||
}>(),
|
||||
{
|
||||
title: '卡片标题',
|
||||
comments: '卡片描述'
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
}>();
|
||||
|
||||
const list = ref<CmsArticle[]>([]);
|
||||
const flashHeight = ref<number>(372)
|
||||
|
||||
// 搜索表单
|
||||
const where = reactive<CompanyParam>({
|
||||
keywords: ''
|
||||
});
|
||||
|
||||
// 请求数据
|
||||
const reload = async () => {
|
||||
pageCmsArticle({
|
||||
recommend: 1,
|
||||
limit: 5,
|
||||
lang: getLang()
|
||||
}).then(res => {
|
||||
list.value = res?.list || [];
|
||||
})
|
||||
if(isMobile.value){
|
||||
flashHeight.value = 260;
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.config,
|
||||
() => {
|
||||
reload();
|
||||
},
|
||||
{immediate: true}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.hidden-sm-and-up .el-carousel{
|
||||
height: 160px;
|
||||
}
|
||||
</style>
|
||||
@@ -2,23 +2,36 @@
|
||||
<div class="xl:w-screen-xl m-auto py-4 px-4 sm:px-0">
|
||||
<div class="text-center flex flex-col items-center z-0 relative">
|
||||
<h2 class="text-4xl font-bold tracking-tight text-gray-800 dark:text-white">
|
||||
{{ title || '合作伙伴' }}
|
||||
{{ title || '友情链接' }}
|
||||
</h2>
|
||||
<div class="sub-title">
|
||||
<p class="text-gray-400 text-sm dark:text-gray-400 py-3">
|
||||
{{ comments || '感谢所有合作伙伴和赞助商的支持!' }}
|
||||
{{ comments || 'Link' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-row id="container" :gutter="24" class="clearfix">
|
||||
<el-col v-for="(item,index) in list" :key="index" :sm="4" :xs="12" class="left mb-8">
|
||||
<el-col v-for="(item,index) in list" :key="index" :sm="6" :xs="12" class="left mb-8 hidden-sm-and-down">
|
||||
<nuxt-link :to="`${item.url}`" class="flex-1 cursor-pointer flex flex-col text-center" target="_blank">
|
||||
<el-card :body-style="{ padding: '0px' }" class="items-center flex justify-center" shadow="hover"
|
||||
@mouseleave="hideMenu" @mouseover="showMenu(item)">
|
||||
<div class="flex-1 py-5 sm:p-4 !p-4">
|
||||
<el-space class="text-gray-700 dark:text-white text-base font-semibold h-[28px] flex justify-center items-center">
|
||||
<el-image v-if="item.icon" :alt="item.name" :src="item.icon" style="height: 30px"/>
|
||||
<span :title="item.name" class="text-lg line-clamp-1">{{ item.name }}</span>
|
||||
<span :title="item.name" class="line-clamp-1 text-sm lg:text-lg">{{ item.name }}</span>
|
||||
</el-space>
|
||||
</div>
|
||||
</el-card>
|
||||
</nuxt-link>
|
||||
</el-col>
|
||||
<el-col v-for="(item,index) in list" :key="index" :sm="6" :xs="12" class="left mb-2 hidden-sm-and-up">
|
||||
<nuxt-link :to="`${item.url}`" class="flex-1 cursor-pointer flex flex-col text-center" target="_blank">
|
||||
<el-card :body-style="{ padding: '0px' }" class="items-center flex justify-center" shadow="hover"
|
||||
@mouseleave="hideMenu" @mouseover="showMenu(item)">
|
||||
<div class="flex-1 py-1 sm:p-0 !p-0">
|
||||
<el-space class="text-gray-700 dark:text-white text-base font-semibold h-[28px] flex justify-center items-center">
|
||||
<el-image v-if="item.icon" :alt="item.name" :src="item.icon" style="height: 30px"/>
|
||||
<span :title="item.name" class="line-clamp-1 text-sm lg:text-lg">{{ item.name }}</span>
|
||||
</el-space>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -68,7 +81,7 @@ const hideMenu = () => {
|
||||
|
||||
// 请求数据
|
||||
const reload = async () => {
|
||||
pageCmsLink({limit: 6}).then(data => {
|
||||
pageCmsLink({limit: 36}).then(data => {
|
||||
list.value = data?.list || [];
|
||||
})
|
||||
}
|
||||
|
||||
123
components/Index/ZSNews.vue
Normal file
123
components/Index/ZSNews.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<div class="xl:w-screen-xl m-auto px-4 sm:px-0">
|
||||
<el-row :gutter="24" id="container" class="clearfix">
|
||||
<el-col :span="8" :xs="24">
|
||||
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer mb-5" >
|
||||
<template #header>
|
||||
<div class="text-lg font-medium">
|
||||
招生就业
|
||||
</div>
|
||||
</template>
|
||||
<div class="px-5">
|
||||
<template v-for="(item,index) in zsList" :key="index">
|
||||
<nuxt-link :to="`/detail/${item.articleId}.html`" class="item">
|
||||
<div class="text-lg my-3 flex justify-between">
|
||||
<span class="title text-gray-800 hover:text-green-700 line-clamp-2 text-sm lg:text-lg">{{ item.title }}</span>
|
||||
<span class="text-gray-400 text-sm text-right w-[100px]">{{ dayjs(item.createTime).format('MM-DD') }}</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8" :xs="24">
|
||||
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer mb-5" >
|
||||
<template #header>
|
||||
<div class="text-lg font-medium">
|
||||
通知公告
|
||||
</div>
|
||||
</template>
|
||||
<div class="px-5">
|
||||
<template v-for="(item,index) in tzList" :key="index">
|
||||
<nuxt-link :to="`/detail/${item.articleId}.html`" class="item">
|
||||
<div class="text-lg my-3 flex justify-between">
|
||||
<span class="title text-gray-800 hover:text-green-700 line-clamp-2 text-sm lg:text-lg">{{ item.title }}</span>
|
||||
<span class="text-gray-400 text-sm text-right w-[100px]">{{ dayjs(item.createTime).format('MM-DD') }}</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8" :xs="24">
|
||||
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer mb-5" >
|
||||
<template #header>
|
||||
<div class="text-lg font-medium">
|
||||
教学教研
|
||||
</div>
|
||||
</template>
|
||||
<div class="px-5">
|
||||
<template v-for="(item,index) in jyList" :key="index">
|
||||
<nuxt-link :to="`/detail/${item.articleId}.html`" class="item">
|
||||
<div class="text-lg my-3 flex justify-between">
|
||||
<span class="title text-gray-800 hover:text-green-700 line-clamp-2 text-sm lg:text-lg">{{ item.title }}</span>
|
||||
<span class="text-gray-400 text-sm text-right w-[100px]">{{ dayjs(item.createTime).format('MM-DD') }}</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-if="disabled" class="px-1 text-center text-gray-500 min-h-xs">
|
||||
没有更多了
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {navigateTo} from "#imports";
|
||||
import dayjs from "dayjs";
|
||||
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
|
||||
import {listCmsArticle, pageCmsArticle} from "~/api/cms/cmsArticle";
|
||||
import type {CmsArticleParam} from "~/api/cms/cmsArticle/model";
|
||||
import Carousel from "~/components/Index/Carousel.vue";
|
||||
import HotNewsCarousel from "~/components/Index/HotNewsCarousel.vue";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
param?: CmsArticleParam;
|
||||
disabled?: boolean;
|
||||
categoryId?: number;
|
||||
title?: string;
|
||||
comments?: string;
|
||||
fit?: any;
|
||||
}>(),
|
||||
{
|
||||
fit: 'cover'
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
}>();
|
||||
|
||||
const zsList = ref<CmsArticle[]>([]);
|
||||
const tzList = ref<CmsArticle[]>([]);
|
||||
const jyList = ref<CmsArticle[]>([]);
|
||||
|
||||
// 请求数据
|
||||
const reload = async () => {
|
||||
pageCmsArticle({
|
||||
limit: 8,
|
||||
recommend: 1,
|
||||
parentId: 4132
|
||||
}).then(res => {
|
||||
zsList.value = res?.list || [];
|
||||
})
|
||||
pageCmsArticle({
|
||||
limit: 8,
|
||||
recommend: 1,
|
||||
categoryId: 4152
|
||||
}).then(res => {
|
||||
tzList.value = res?.list || [];
|
||||
})
|
||||
pageCmsArticle({
|
||||
limit: 8,
|
||||
parentId: 4133
|
||||
}).then(res => {
|
||||
jyList.value = res?.list || [];
|
||||
})
|
||||
}
|
||||
reload();
|
||||
</script>
|
||||
Reference in New Issue
Block a user