百色农校完成
This commit is contained in:
@@ -28,6 +28,8 @@ export interface CmsArticle {
|
|||||||
categoryName?: string;
|
categoryName?: string;
|
||||||
// 封面图
|
// 封面图
|
||||||
image?: string;
|
image?: string;
|
||||||
|
// 版本号
|
||||||
|
version?: number;
|
||||||
// 缩列图
|
// 缩列图
|
||||||
thumbnail?: string;
|
thumbnail?: string;
|
||||||
// 来源
|
// 来源
|
||||||
@@ -119,6 +121,7 @@ export interface CmsArticleParam extends PageParam {
|
|||||||
articleIds?: string;
|
articleIds?: string;
|
||||||
parentId?: number;
|
parentId?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
|
hasImage?: boolean;
|
||||||
// 是否推荐
|
// 是否推荐
|
||||||
recommend?: number;
|
recommend?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
pageCmsArticle({
|
pageCmsArticle({
|
||||||
recommend: 1,
|
recommend: 1,
|
||||||
limit: 5,
|
limit: 5,
|
||||||
|
hasImage: true,
|
||||||
lang: getLang()
|
lang: getLang()
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
imgList.value = res?.list || [];
|
imgList.value = res?.list || [];
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<el-carousel id="flash1" :height="flashHeight + 'px'" :interval="2000">
|
<el-carousel id="flash1" :height="flashHeight + 'px'" :interval="2000">
|
||||||
<el-carousel-item v-for="(item,index) in list" :key="index">
|
<el-carousel-item v-for="(item,index) in list" :key="index">
|
||||||
<div class="item relative flex justify-center items-center">
|
<div class="item relative flex justify-center items-center">
|
||||||
<el-image :src="`${FILE_SERVER}${item.image}`" fit="fill" class="w-full" :style="`height: 300px;`" />
|
{{item.version }}
|
||||||
|
<el-image :src="`${item.version == 1 ? config.FILE_SERVER : ''}${item.image}`" fit="fill" class="w-full" :style="`height: 300px;`" />
|
||||||
<!-- fit: '' | 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'-->
|
<!-- fit: '' | 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'-->
|
||||||
</div>
|
</div>
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
@@ -27,6 +28,7 @@ import {getCmsAd, pageCmsAd} from "~/api/cms/cmsAd";
|
|||||||
import {pageCmsArticle} from "~/api/cms/cmsArticle";
|
import {pageCmsArticle} from "~/api/cms/cmsArticle";
|
||||||
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
|
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
|
||||||
import {FILE_SERVER} from "~/config";
|
import {FILE_SERVER} from "~/config";
|
||||||
|
import {useConfigInfo} from "~/composables/configState";
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -46,6 +48,7 @@ const emit = defineEmits<{
|
|||||||
(e: 'done'): void;
|
(e: 'done'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const config = useConfigInfo()
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const list = ref<CmsArticle[]>([]);
|
const list = ref<CmsArticle[]>([]);
|
||||||
const flashHeight = ref<number>(372)
|
const flashHeight = ref<number>(372)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<el-carousel :height="flashHeight + 'px'" :interval="2000" motion-blur indicator-position="none">
|
<el-carousel :height="flashHeight + 'px'" :interval="2000" motion-blur indicator-position="none">
|
||||||
<el-carousel-item v-for="(item,index) in data" :key="index">
|
<el-carousel-item v-for="(item,index) in data" :key="index">
|
||||||
<nuxt-link :to="`/detail/${item.articleId}.html`" class="item flex justify-center items-center">
|
<nuxt-link :to="`/detail/${item.articleId}.html`" class="item flex justify-center items-center">
|
||||||
<el-image :src="`${FILE_SERVER}${item.image}`" class="w-[500px] h-[380px]" />
|
<el-image :src="`${item.version == 1 ? config.FILE_SERVER : ''}${item.image}`" class="w-[500px] h-[380px]" />
|
||||||
<div class="absolute bottom-0 z-100 w-[468px] bg-black opacity-80 font-bold px-4 line-clamp-1 text-sm lg:text-lg">
|
<div class="absolute bottom-0 z-100 w-[468px] bg-black opacity-80 font-bold px-4 line-clamp-1 text-sm lg:text-lg">
|
||||||
<span class="text-white">{{ item.title }}</span>
|
<span class="text-white">{{ item.title }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -16,9 +16,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type {CompanyParam} from "~/api/system/company/model";
|
import type {CompanyParam} from "~/api/system/company/model";
|
||||||
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
|
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
|
||||||
import {FILE_SERVER} from "~/config";
|
import {useConfigInfo} from "~/composables/configState";
|
||||||
|
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
|
const config = useConfigInfo()
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const appName = '广西百色农业学校';
|
|||||||
|
|
||||||
const isDev = process.env.NODE_ENV === 'development'
|
const isDev = process.env.NODE_ENV === 'development'
|
||||||
if(isDev){
|
if(isDev){
|
||||||
// apiBaseUrl = 'http://127.0.0.1:9000/api'
|
apiBaseUrl = 'http://127.0.0.1:9000/api'
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer">
|
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer">
|
||||||
<nuxt-link :to="`/detail/${item.articleId}.html`">
|
<nuxt-link :to="`/detail/${item.articleId}.html`">
|
||||||
<el-image
|
<el-image
|
||||||
:src="item.image"
|
:src="`${config.FILE_SERVER}${item.image}`"
|
||||||
fit="cover"
|
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-[199px] cursor-pointer bg-gray-50"/>
|
||||||
<div class="flex-1 px-4 py-5 sm:p-6 !p-4">
|
<div class="flex-1 px-4 py-5 sm:p-6 !p-4">
|
||||||
@@ -45,11 +45,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Banner from "@/components/Banner.vue";
|
import Banner from "@/components/Banner.vue";
|
||||||
import { ArrowLeft,View,Search } from '@element-plus/icons-vue'
|
import { ArrowLeft,View,Search } from '@element-plus/icons-vue'
|
||||||
import {useLayout, usePage} from "~/composables/configState";
|
import {useConfigInfo, useLayout, usePage} from "~/composables/configState";
|
||||||
import type {CmsArticle, CmsArticleParam} from "~/api/cms/cmsArticle/model";
|
import type {CmsArticle, CmsArticleParam} from "~/api/cms/cmsArticle/model";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {getViews} from "~/utils/common";
|
import {getViews} from "~/utils/common";
|
||||||
import {pageCmsArticle} from "~/api/cms/cmsArticle";
|
import {pageCmsArticle} from "~/api/cms/cmsArticle";
|
||||||
|
import {FILE_SERVER} from "~/config";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -61,6 +62,7 @@ const total = ref(0);
|
|||||||
// 获取状态
|
// 获取状态
|
||||||
const page = usePage();
|
const page = usePage();
|
||||||
const layout = useLayout();
|
const layout = useLayout();
|
||||||
|
const config = useConfigInfo()
|
||||||
|
|
||||||
// 搜索表单
|
// 搜索表单
|
||||||
const where = reactive<CmsArticleParam>({
|
const where = reactive<CmsArticleParam>({
|
||||||
|
|||||||
1
types/global.d.ts
vendored
1
types/global.d.ts
vendored
@@ -37,6 +37,7 @@ export interface Config {
|
|||||||
IndexAboutNum?: string;
|
IndexAboutNum?: string;
|
||||||
showTopBar?: string;
|
showTopBar?: string;
|
||||||
showLoginButton?: string;
|
showLoginButton?: string;
|
||||||
|
FILE_SERVER?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BreadcrumbItem {
|
export interface BreadcrumbItem {
|
||||||
|
|||||||
Reference in New Issue
Block a user