kun 19/10/2/23:50

This commit is contained in:
沈学坤
2019-10-02 23:47:29 +08:00
parent ea2f30ba31
commit 0ea5a7991a
2 changed files with 64 additions and 25 deletions

View File

@@ -26,7 +26,7 @@
<div class="top">
<div class="b">
<span>通知公告</span>
<span>更多>></span>
<span @click="$jParams('newsList',{type:3})">更多>></span>
</div>
</div>
<!-- 列表显示 -->
@@ -94,7 +94,7 @@
<img class="n" :src="imgUrl.ws" alt />
<span>统一战线</span>
</div>
<span @click="$jump('newsList')">更多>></span>
<span @click="$jParams('newsList',{type:1})">更多>></span>
</div>
<ul class="ulo">
<template v-for="(battle,index) in bgData.battle">
@@ -111,7 +111,7 @@
<img class="e" :src="imgUrl.zz" alt />
<span>组织生活</span>
</div>
<span @click="$jump('newsList')">更多>></span>
<span @click="$jParams('newsList',{type:2})">更多>></span>
</div>
<ul class="ult">
<template v-for="(organization,index) in bgData.organization">
@@ -275,7 +275,7 @@ export default {
var mySwiper = new Swiper(".swiper-one", {
loop: true,
autoplay: {
delay: 1500
delay: 3000
},
/** 如果需要前进后退按钮 */

View File

@@ -1,35 +1,35 @@
<template>
<div class="wrapper">
<div class="wrapper" v-if="bgData">
<header-nav :index_num="index_num"></header-nav>
<div id="box">
<template v-for="(list,index) in four">
<div id="news"
:key="index"
@click="$jump('newsDetails')">
<template v-for="(info,index) in bgData.info">
<div id="news" :key="index" @click="$jump('newsDetails')">
<div class="news-box">
<img src="../../../static/img/img5.png"
alt />
<img :src="info.cover" alt />
<section>
<h3>因势而谋书写能源转型发展大文章</h3>
<h3>{{info.title}}</h3>
<aside>
<span>来源:央视网</span>
<span>发布时间:2019-08-08</span>
<span>浏览量:11123</span>
<span>发布时间:{{info.created_at}}</span>
<span>浏览量:{{info.view}}</span>
</aside>
<p>近日,国家能源局召开党组中心组学习(扩大)会议,专题学习习近平新时代中国特色社会主义思想学习纲要中关于掌握马克思主义 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习习近平新时代中国特色社会主义思想学习纲要中关于掌握马克思主义 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习习近平新时代中国特色社会主义思想学习纲要中关于掌握马克思主义</p>
<p>{{info.content}}</p>
</section>
</div>
</div>
</template>
<!-- 分页按钮 -->
<div class="page">
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
background
layout="prev, pager, next"
:total="10"></el-pagination>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
:pager-count="7"
background
layout="prev, pager, next"
:total="totalCount"
></el-pagination>
</div>
</div>
<footer-nav class="footer"></footer-nav>
@@ -53,25 +53,64 @@ export default {
pageSize: 1,
currentPage: 1,
totalCount: 1,
four: [1, 2, 3, 4]
bgData: [],
getType: null
};
},
computed: {},
watch: {},
watch: {
},
methods: {
getData() {
console.log(this.getType)
let _this = this
this.$http({
method: 'get',
url: 'v1/article/list',
params: {
page: _this.currentPage,
type: _this.getType
}
}).then(res => {
if (res.data.code === 200) {
_this.bgData = res.data.data.data
_this.totalCount = _this.bgData.allNum
_this.pageSize = _this.bgData.info.length
} else {
_this.$Message.error('请求数据有问题!')
}
})
// eslint-disable-next-line handle-callback-err
.catch(err => {
console.log(err)
})
},
handleSizeChange(val) {
this.pageNum = val;
this.getPackData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData()
this.getPackData();
},
getPackData() {}
getPackData() { }
},
created() {
this.getType = this.$route.params.type
this.currentPage = Number(localStorage.getItem("pagination")) || 1;
this.getType = Number(localStorage.getItem("getType")) || this.getType;
this.handleCurrentChange(this.currentPage);
this.getData()
},
beforeUpdate() {
localStorage.setItem('pagination', this.currentPage)
localStorage.setItem('getType',this.getType)
},
beforeDestroy() {
localStorage.clear()
},
mounted() {}
};