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