|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<script lang='ts' setup> |
|
|
|
import { useUserStore } from "@/store/modules/user" |
|
|
|
import { ref } from 'vue' |
|
|
|
import { getUserDetail, getZxxyNavis, getTuijian } from '@/api/knowledge/index' |
|
|
|
import { getUserDetail, getZxxyNavis, getTuijian, getCarousel } from '@/api/knowledge/index' |
|
|
|
import Archivestype from '@/views/knowledge/knowledge/components/archivestype.vue' |
|
|
|
import Navili from './components/Navili.vue' |
|
|
|
import { UserQuery, UserDetail, NaviQuery, Navi, Graphicform, PageParam } from '@/api/knowledge/types' |
|
|
|
@ -57,6 +57,7 @@ const pageParamTuijian = reactive<PageParam>({ |
|
|
|
usertoken: userToken, |
|
|
|
|
|
|
|
}) |
|
|
|
const carousel = ref<Graphicform[]>(); |
|
|
|
function errorImg(e: any) { |
|
|
|
e.srcElement.src = errimg; |
|
|
|
//这一句没用,如果默认图片的路径错了还是会一直闪屏,在方法的前面加个.once只让它执行一次也没用 |
|
|
|
@ -107,7 +108,13 @@ onMounted(() => { |
|
|
|
pageParamTuijian.total = data.total |
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
getCarousel(pageParamTuijian) |
|
|
|
.then(({ data }) => { |
|
|
|
carousel.value = data.list |
|
|
|
|
|
|
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -131,6 +138,7 @@ function handleCurrentChange() { |
|
|
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -148,8 +156,10 @@ function handleCurrentChange() { |
|
|
|
</div> |
|
|
|
<div class="grid-tuijian"> |
|
|
|
<el-carousel indicator-position="outside" class="mycarousel" style="width: 412px;height:290px; "> |
|
|
|
<el-carousel-item v-for="item in 4" :key="item"> |
|
|
|
<h3 text="2xl" justify="center">{{ item }}</h3> |
|
|
|
<el-carousel-item v-for="(item, index) in carousel" :key="index"> |
|
|
|
<!-- <h3 text="2xl" justify="center">{{ item.gThumbnail }}</h3> --> |
|
|
|
<img style="width: 412px; height: 300px;border-radius:8px;margin-top: 4px; margin-left: 4px;" |
|
|
|
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" /> |
|
|
|
</el-carousel-item> |
|
|
|
</el-carousel> |
|
|
|
|
|
|
|
|