From ccabe846fb841a6864cb72c860f6f1db505f8554 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B2=88=E5=AD=A6=E5=9D=A4?= <1107410514@qq.com>
Date: Tue, 24 Sep 2019 20:10:04 +0800
Subject: [PATCH] kun 19/9/24 20:10
---
src/router.js | 6 +
src/store.js | 12 +-
src/views/homePage/homePage.vue | 151 +++++++++++--
src/views/homePage/newsDetails.vue | 29 ++-
src/views/homePage/newsList.vue | 204 ++++++++++++++++++
.../informationQuery/informationQuery.vue | 154 ++++++++++---
static/js/tool.js | 10 +
tests/unit/shuffling.vue | 137 ++++++++++++
8 files changed, 639 insertions(+), 64 deletions(-)
create mode 100644 src/views/homePage/newsList.vue
create mode 100644 static/js/tool.js
create mode 100644 tests/unit/shuffling.vue
diff --git a/src/router.js b/src/router.js
index 290e663..03d88c9 100644
--- a/src/router.js
+++ b/src/router.js
@@ -5,6 +5,7 @@ import Router from 'vue-router'
import homePage from './views/homePage/homePage'
import applyFor from './views/homePage/applyFor'
import newsDetails from './views/homePage/newsDetails'
+import newsList from './views/homePage/newsList'
/** 登录 */
import login from './views/login/login'
/** 注册 */
@@ -33,6 +34,11 @@ export default new Router({
mode: 'hash',
base: process.env.BASE_URL,
routes: [
+ {
+ path: '/newsList',
+ name: 'newsList',
+ component: newsList
+ },
{
path: '/informationQuery',
name: 'informationQuery',
diff --git a/src/store.js b/src/store.js
index 3c7424e..ef5f0b7 100644
--- a/src/store.js
+++ b/src/store.js
@@ -4,13 +4,7 @@ import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
- state: {
-
- },
- mutations: {
-
- },
- actions: {
-
- }
+ state: {},
+ mutations: {},
+ actions: {}
})
diff --git a/src/views/homePage/homePage.vue b/src/views/homePage/homePage.vue
index c4119b1..f220e70 100644
--- a/src/views/homePage/homePage.vue
+++ b/src/views/homePage/homePage.vue
@@ -59,7 +59,7 @@
党组织信息
- 更多>>
+ 更多>>
@@ -84,11 +84,11 @@
统一战线
-
更多>>
+
更多>>
- -
+
-
{{item.text}}
@@ -101,11 +101,11 @@
组织生活
- 更多>>
+ 更多>>
- -
+
-
{{item.text}}
@@ -132,10 +132,27 @@
@@ -167,6 +183,7 @@ export default {
data() {
return {
index_num: 0,
+ leftPos: 0,
imgUrl: {
lb: require("../../../static/img/lb.png"),
gq: require("../../../static/img/gq.png"),
@@ -261,7 +278,7 @@ export default {
"活动策划是提高市场占有率的有效行为,一份可执行、可操作、创意突出的活动策划案,可有效提升企业的知名度及品牌美誉度。活动策划案是相对于市场策划案而言,严格说它们同属市场策划的兄弟分支,活动策划、..."
}
],
- list: [1, 2, 3, 4, 5, 6, 7, 8]
+ lists: [1, 2, 3, 4, 5, 6, 7, 8]
};
},
computed: {},
@@ -281,29 +298,53 @@ export default {
}
});
},
+ scrollFeeds: function(btn) {
+ let feeds = document.querySelector(".f-row");
+ if (btn === "left") {
+ this.leftPos += 460;
+ let scrollAmount = 0;
+ var slideTimer = setInterval(function() {
+ feeds.scrollLeft -= 10;
+ scrollAmount += 10;
+ if (scrollAmount >= 460) {
+ window.clearInterval(slideTimer);
+ }
+ }, 25);
+ } else {
+ this.leftPos -= 460;
+ let scrollAmount = 0;
+ // eslint-disable-next-line no-redeclare
+ var slideTimer = setInterval(function() {
+ feeds.scrollLeft += 10;
+ scrollAmount += 10;
+ if (scrollAmount >= 460) {
+ window.clearInterval(slideTimer);
+ }
+ }, 25);
+ }
+ }
+ /*
initialSwiper() {
var swiper = new Swiper(".swiper-two", {
spaceBetween: 20,
- slidesPerView: 4,
- slidesPerGroup: 2,
- /** loop: true,*/
+ slidesPerView: 18 / 4,
+ slidesPerGroup: 7 / 4,
loopFillGroupWithBlank: true,
- /** 如果需要前进后退按钮 */
+ // 如果需要前进后退按钮
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
},
- observer: true /*启动动态检查器,当改变swiper的样式(例如隐藏/显示)或者修改swiper的子元素时,自动初始化swiper。*/,
- observeParents: true /*将observe应用于Swiper的父元素。当Swiper的父元素变化时,例如window.resize,Swiper更新。*/
});
}
+ */
},
created() {},
mounted() {
this.initSwiper();
- this.initialSwiper();
+ /*this.initialSwiper();*/
}
};
@@ -332,18 +373,83 @@ export default {
.swiper-box-list {
width: 100%;
- height: 196px;
+ height: 250px;
box-sizing: border-box;
- padding: 0 42px 0 4px;
- display: flex;
+ padding: 0 42px 0 0px;
+ position: relative;
- .swiper-button-prev.swiper-button-disabled,
- .swiper-button-next.swiper-button-disabled {
+ .mv-btn {
+ cursor: pointer;
+ height: 60px;
+ width: 60px;
+ border-radius: 18px;
+ z-index: 20;
+ position: absolute;
+ &.left-side {
+ left: 0px;
+ top: 60px;
+ }
+ &.right-side {
+ right: 40px;
+ top: 60px;
+ }
+ }
+
+ #img-box {
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+ display: flex;
+ align-items: flex-start;
+ overflow-y: scroll;
+
+ &::-webkit-scrollbar {
+ display: none;
+ }
+
+ .img-box {
+ width: 239px;
+ height: 196px;
+ background-color: #ffffff;
+ box-shadow: 0px 10px 9px 1px rgba(206, 204, 204, 0.5);
+ border-radius: 5px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ margin-right: 20px;
+
+ img {
+ width: 239px;
+ height: 130px;
+ border-radius: 5px 5px 0px 0px;
+ }
+
+ p {
+ font-family: "MicrosoftYaHei";
+ font-size: 18px;
+ font-weight: bold;
+ font-stretch: normal;
+ line-height: 60px;
+ letter-spacing: 0px;
+ color: #333333;
+ }
+ }
+ }
+
+ /*
+ .swiper-button-prev.swiper-button-disabled {
opacity: 0;
cursor: auto;
pointer-events: none;
}
+ .swiper-button-next.swiper-button-disabled {
+ opacity: 1;
+ cursor: auto;
+ pointer-events: none;
+ }
+
.swiper-button-prev {
outline: none;
position: absolute;
@@ -403,6 +509,7 @@ export default {
color: #333333;
}
}
+ */
}
.title {
diff --git a/src/views/homePage/newsDetails.vue b/src/views/homePage/newsDetails.vue
index 386bd63..555b310 100644
--- a/src/views/homePage/newsDetails.vue
+++ b/src/views/homePage/newsDetails.vue
@@ -6,7 +6,11 @@
-
-
+
-
因势而谋书写能源转型发展大文章
@@ -30,7 +34,7 @@
热点新闻
-
+
-
@@ -63,6 +67,7 @@ export default {
data() {
return {
index_num: 0,
+ coll: false,
imgUrl: {
img4: require("../../../static/img/img4.png"),
img5: require("../../../static/img/img5.png"),
@@ -73,7 +78,11 @@ export default {
},
computed: {},
watch: {},
- methods: {},
+ methods: {
+ collection() {
+ this.coll = !this.coll;
+ }
+ },
created() {},
mounted() {}
};
@@ -133,9 +142,17 @@ export default {
height: 494px;
}
- .two {
- width: 28px;
- height: 26px;
+ .colorFalse {
+ font-size: 28px;
+ color: #ccc;
+ position: absolute;
+ right: 0%;
+ bottom: 5%;
+ }
+
+ .colorTrue {
+ font-size: 28px;
+ color: #fec300;
position: absolute;
right: 0%;
bottom: 5%;
diff --git a/src/views/homePage/newsList.vue b/src/views/homePage/newsList.vue
new file mode 100644
index 0000000..7955f85
--- /dev/null
+++ b/src/views/homePage/newsList.vue
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
+

+
+ 因势而谋书写能源转型发展大文章
+
+ 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习《习近平新时代中国特色社会主义思想学习纲要》中关于“掌握马克思主义 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习《习近平新时代中国特色社会主义思想学习纲要》中关于“掌握马克思主义 近日,国家能源局召开党组中心组学习(扩大)会议,专题学习《习近平新时代中国特色社会主义思想学习纲要》中关于“掌握马克思主义
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/informationQuery/informationQuery.vue b/src/views/informationQuery/informationQuery.vue
index 7981d25..ba17dfd 100644
--- a/src/views/informationQuery/informationQuery.vue
+++ b/src/views/informationQuery/informationQuery.vue
@@ -4,8 +4,8 @@
-
@@ -78,6 +99,7 @@
import headerNav from "../../components/headerNav";
/* eslint-disable */
import footerNav from "../../components/footerNav";
+
export default {
components: {
headerNav,
@@ -92,32 +114,61 @@ export default {
imgUrl: {
xa: require("../../../static/img/xa.png")
},
+ searchVal: "",
+ searchValue: [],
sData: [
{
id: 1,
- zuzhi: "劳动经济学会",
- daima: "51100000MJ000035X2",
- type: "社会团体",
- dbr: "王五",
- date: "2019-10-14",
+ organization: "劳动经济学会",
+ credit: "51100000MJ000035X2",
+ type: "团体",
+ representative: "王五",
+ date: "2019-01-14",
zt: 0
},
{
id: 2,
- zuzhi: "劳动经济学会",
- daima: "51100000MJ000035X2",
- type: "社会团体",
- dbr: "王五",
+ organization: "华为",
+ credit: "51100000MJ000035X2",
+ type: "社会",
+ representative: "李四",
+ date: "2019-10-14",
+ zt: 1
+ },
+ {
+ id: 4,
+ organization: "华为",
+ credit: "51100000MJ000035X2",
+ type: "社会",
+ representative: "李四",
+ date: "2019-10-14",
+ zt: 1
+ },
+ {
+ id: 5,
+ organization: "华为",
+ credit: "51100000MJ000035X2",
+ type: "社会",
+ representative: "李四",
+ date: "2019-10-14",
+ zt: 1
+ },
+ {
+ id: 6,
+ organization: "华为",
+ credit: "51100000MJ000035X2",
+ type: "社会",
+ representative: "李四",
date: "2019-10-14",
zt: 1
},
{
id: 3,
- zuzhi: "劳动经济学会",
- daima: "51100000MJ000035X2",
- type: "社会团体",
- dbr: "王五",
- date: "2019-10-14",
+ organization: "小米",
+ credit: "51100000MJ000035X2",
+ type: "手机",
+ representative: "张三",
+ date: "2019-11-14",
zt: 0
}
]
@@ -126,11 +177,60 @@ export default {
computed: {},
watch: {},
methods: {
+ /** 搜索函数 */
+ getSearch() {
+ this.searchValue = [];
+ if (this.searchVal === "") {
+ this.$message.warning("请输入搜索内容");
+ return;
+ }
+ this.sData.forEach((item, index) => {
+ if (
+ item.organization.indexOf(this.searchVal) > -1 ||
+ item.credit.indexOf(this.searchVal) > -1 ||
+ item.type.indexOf(this.searchVal) > -1 ||
+ item.representative.indexOf(this.searchVal) > -1 ||
+ item.date.indexOf(this.searchVal) > -1
+ ) {
+ this.searchValue.push(item);
+ }
+ });
+
+ /*
+ if (this.searchValue != "") {
+ this.searchValue.map(item => {
+ //遍历
+ item.organization = this.brightKeyword(item.organization);
+ item.credit = this.brightKeyword(item.credit);
+ item.type = this.brightKeyword(item.type);
+ item.representative = this.brightKeyword(item.representative);
+ item.date = this.brightKeyword(item.date);
+ }); //到这里search方法结束
+ }
+ */
+ this.searchVal = "";
+ },
+
+ /** 高亮函数 */
+ /*
+ brightKeyword(val) {
+ let keyword = this.searchVal; //获取输入框输入的内容
+ if (val.indexOf(keyword) !== -1) {
+ //判断这个字段中是否包含keyword
+ //如果包含的话,就把这个字段中的那一部分进行替换成html字符
+ return val.replace(keyword, `${keyword}`);
+ } else {
+ return val;
+ }
+ val = "";
+ },*/
+
btn(index) {
let s = this.sub;
s = index;
this.sub = s;
},
+
getData() {}
},
created() {},
diff --git a/static/js/tool.js b/static/js/tool.js
new file mode 100644
index 0000000..747ac02
--- /dev/null
+++ b/static/js/tool.js
@@ -0,0 +1,10 @@
+/** 筛选函数 */
+export function multiFilter (array, filters) {
+ const filterKeys = Object.keys(filters)
+ return array.filter(item => {
+ return filterKeys.every(key => {
+ if (!filters[key].length) return true
+ return !!~filters[key].indexOf(item[key])
+ })
+ })
+}
diff --git a/tests/unit/shuffling.vue b/tests/unit/shuffling.vue
new file mode 100644
index 0000000..ec505dd
--- /dev/null
+++ b/tests/unit/shuffling.vue
@@ -0,0 +1,137 @@
+
+
+
+
+
+

+
中国政府网站
+
+
+
+

+

+
+
+
+
+
+