From 0ea5a7991a354efc3e8157195d62aa53079d093d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B2=88=E5=AD=A6=E5=9D=A4?= <1107410514@qq.com>
Date: Wed, 2 Oct 2019 23:47:29 +0800
Subject: [PATCH] kun 19/10/2/23:50
---
src/views/home/HomePage.vue | 8 ++--
src/views/home/NewsList.vue | 81 +++++++++++++++++++++++++++----------
2 files changed, 64 insertions(+), 25 deletions(-)
diff --git a/src/views/home/HomePage.vue b/src/views/home/HomePage.vue
index 7996cf7..ff54fd9 100644
--- a/src/views/home/HomePage.vue
+++ b/src/views/home/HomePage.vue
@@ -26,7 +26,7 @@
@@ -94,7 +94,7 @@
统一战线
- 更多>>
+ 更多>>
@@ -111,7 +111,7 @@
组织生活
- 更多>>
+ 更多>>
@@ -275,7 +275,7 @@ export default {
var mySwiper = new Swiper(".swiper-one", {
loop: true,
autoplay: {
- delay: 1500
+ delay: 3000
},
/** 如果需要前进后退按钮 */
diff --git a/src/views/home/NewsList.vue b/src/views/home/NewsList.vue
index 5ea3b95..9875fbc 100644
--- a/src/views/home/NewsList.vue
+++ b/src/views/home/NewsList.vue
@@ -1,35 +1,35 @@
-
+
-
-
+
+
-

+
- 因势而谋书写能源转型发展大文章
+ {{info.title}}
- 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习《习近平新时代中国特色社会主义思想学习纲要》中关于“掌握马克思主义 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习《习近平新时代中国特色社会主义思想学习纲要》中关于“掌握马克思主义 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习《习近平新时代中国特色社会主义思想学习纲要》中关于“掌握马克思主义
+ {{info.content}}
-
+
@@ -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() {}
};