|
|
|
@ -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> |
|
|
|
|
|
|
|
@ -158,8 +168,8 @@ function handleCurrentChange() { |
|
|
|
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" /> |
|
|
|
|
|
|
|
<div class="card-right"> |
|
|
|
<span class="card-title" :title= item.gTitle >{{ item.gTitle }}</span> |
|
|
|
<span class="card-text" :title= item.gDescribe >{{ item.gDescribe }}</span> |
|
|
|
<span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span> |
|
|
|
<span class="card-text" :title=item.gDescribe>{{ item.gDescribe }}</span> |
|
|
|
|
|
|
|
<span class="time-span"><span class="fa fa-clock-o"></span>{{ formatDate(item.gAddTime) }}</span> |
|
|
|
|
|
|
|
@ -191,7 +201,7 @@ function handleCurrentChange() { |
|
|
|
推荐 |
|
|
|
</li> |
|
|
|
<Navili v-for="(item, index) in naviList" :class="{ active: active === index+1 }" :oneli=item :index=(index+1) |
|
|
|
:active=active @click="scrollTo(index + 1)"></Navili> |
|
|
|
:active=active @click="scrollTo(index+1)"></Navili> |
|
|
|
|
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
|