荣誉展示栏动态数据

This commit is contained in:
aoli.qu 2023-10-25 00:44:16 +08:00
parent 59ec7b2faf
commit f04d80924f
2 changed files with 50 additions and 84 deletions

View File

@ -21,7 +21,7 @@
<div class="down-class" v-show="fileList.length > 0">
<a-divider orientation="left">封面图</a-divider>
<db-upload v-model="fileList" type="img" disabled="true" max="fileList.length" ></db-upload>
<db-upload v-model="fileList" type="img" :disabled="true" max="fileList.length" ></db-upload>
</div>
</div>
</a-card>
@ -111,10 +111,11 @@ export default {
},
//
close () {
this.$router.push({ path: '/honor/list',
/* this.$router.push({ path: '/honor/list',
query: {
}
})
}) */
this.$router.back()
}
}
}

View File

@ -1,5 +1,4 @@
<template>
<!--一带一路专区 开始-->
<div class="ydyl-zone">
<!-- 大头条 -->
<div class="headline" id="headline1" data-fontsize="36" data-fontcolor="">
@ -21,52 +20,14 @@
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide scroll-articles" data-url="">
<div class="img">
<div class="swiper-slide scroll-articles" v-for="(item, index) in fileList" :key="index">
<div class="img" @click="detail(item.id)">
<a target="_blank">
<img class="swiper-lazy" src="./img/1.jpg" alt="">
<div class="swiper-lazy-preloader"></div>
</a>
</div>
<!-- <div class="tit">
<div class="btn hide"></div>
<a href="http://www.news.cn/photo/2023-10/18/c_1129921976.htm" target="_blank">习近平同印度尼西亚总统佐科会谈</a>
</div> -->
</div>
<div class="swiper-slide scroll-articles" data-url="">
<div class="img">
<a target="_blank">
<img class="swiper-lazy" src="./img/2.jpg" alt="">
<div class="swiper-lazy-preloader"></div>
<img class="swiper-lazy" :src="item.files[0].url" alt="">
<!-- <div class="swiper-lazy-preloader"></div> -->
</a>
</div>
</div>
<div class="swiper-slide scroll-articles" data-url="">
<div class="img">
<a target="_blank">
<img class="swiper-lazy" src="./img/3.jpg" alt="">
<div class="swiper-lazy-preloader"></div>
</a>
</div>
</div>
<div class="swiper-slide scroll-articles" data-url="">
<div class="img">
<a target="_blank">
<img class="swiper-lazy" src="./img/4.jpg" alt="">
<div class="swiper-lazy-preloader"></div>
</a>
</div>
</div>
<div class="swiper-slide scroll-articles" data-url="">
<div class="img">
<a target="_blank">
<img class="swiper-lazy" src="./img/5.jpg" alt="">
<div class="swiper-lazy-preloader"></div>
</a>
</div>
</div>
</div>
<div class="swiper-pagination"></div>
@ -79,66 +40,70 @@
<div class="focus-newsText bg-white right">
<div class="list list-txt" id="focusListNews1">
<ul>
<li class="active"><span><a target="_blank" @click="detail(3)">
下堡坪乡让流动党员有</a></span></li>
<li><span><a target="_blank">
身边榜样灯塔 做新时代的追光者</a></span></li>
<li> <span><a target="_blank">
医路守护夕阳红 真情服务暖人心</a></span></li>
<li> <span><a target="_blank">
点点滴滴暖民心</a></span></li>
<li> <span><a target="_blank">
下堡坪乡5家入选夷陵区美丽庭院</a></span></li>
<li ><span><a target="_blank">
福利院幸福掠影</a></span></li>
<li><span><a target="_blank">
福利院简介</a></span></li>
<li> <span><a target="_blank">
福利院分工职责</a></span></li>
<li> <span><a target="_blank">
院长简介</a></span></li>
<li> <span><a target="_blank">
相关制度</a></span></li>
<li v-for="(item, index) in honorList" :key="index" :class="{ active: index === 0 }">
<span><a target="_blank" @click="detail(item.id)">
{{ item.title }}</a></span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!--一带一路专区 结束-->
</template>
<script>
import Swiper from "swiper";
import "swiper/dist/css/swiper.min.css";
import Swiper from 'swiper'
import 'swiper/dist/css/swiper.min.css'
import {
honorPage
} from '@/api/honor/honor'
export default {
data() {
data () {
return {
honorList: [],
fileList: []
}
},
components: {
created () {
this.getData()
},
mounted() {
this.initSwiper();
mounted () {
this.initSwiper()
},
methods: {
//swiper
initSwiper() {
getData () {
honorPage({
pageNum: 1,
pageSize: 10
}).then((res) => {
console.log(res)
this.honorList = res.rows
this.fileList = this.honorList.filter(item => item.files && item.files != '[]')
.map(item => ({
id: item.id,
files: JSON.parse(item.files)
}))
console.log(this.fileList)
})
},
// swiper
initSwiper () {
this.$nextTick(() => {
new Swiper(".swiper-container", {
new Swiper('.swiper-container', {
// ,swiper/swiperswiper
observer: true,
autoplay: 3000,
/* slidesPerView: 1,
spaceBetween: 18, */
prevButton: ".swiper-button-prev",
nextButton: ".swiper-button-next",
prevButton: '.swiper-button-prev',
nextButton: '.swiper-button-next'
// freeMode: true
});
});
})
})
},
detail(id) {
detail (id) {
this.$router.push({
path: '/honor/detail',
query: {