-
跳转页面
+
+
+ -
+
+

+
+
+ 建党百年 信息报国——信息科学与技术学院备份
+
+
+
+ -
+
+

+
+
+ 建党百年 信息报国——信息科学与技术学院备份
+
+
+ -
+
+
+

+
+
+ 建党百年 信息报国——信息科学与技术学院备份
+
+
+ -
+
+
+

+
+
+ 建党百年 信息报国——信息科学与技术学院备份
+
+
+ -
+
+
+

+
+
+ 建党百年 信息报国——信息科学与技术学院备份
+
+
+ -
+
+
+

+
+
+ 建党百年 信息报国——信息科学与技术学院备份
+
+
+
+
+
+
+
+
+
+
+
+
@@ -42,76 +88,200 @@
export default {
data() {
return {
- activeIndex: ['1'], //默认展开第一块
- data2: [{
- id: 1,
- label: '一级 1',
- children: [{
- id: 4,
- label: '二级 1-1',
- children: [{
- id: 9,
- label: '三级 1-1-1'
- }, {
- id: 10,
- label: '三级 1-1-2'
- }]
- }]
- }, {
- id: 2,
- label: '一级 2',
- children: [{
- id: 5,
- label: '二级 2-1'
- }, {
- id: 6,
- label: '二级 2-2',
- disabled: true //通过disabled设置禁用状态
- }]
- }, {
- id: 3,
- label: '一级 3',
- children: [{
- id: 7,
- label: '二级 3-1'
- }, {
- id: 8,
- label: '二级 3-2'
- }]
- }],
- defaultProps: {
- children: 'children',
- label: 'label'
- }
- }
+ default: {
+//默认值
+ classArray: ["one", "two", "three", "four", "five", "six"],
+ leftSlider: true,
+ },
+ bannerWrap: null,
+ time: null,
+ lisArray: null, //卡片的集合
+ classlist: null,
+ leftBtn: null,
+ rightBtn: null,
+ };
},
methods: {
- handleChange(val) {
- console.log(val);
+ constructor() {
+ this.bannerWrap = document.getElementsByClassName("banner-card")[0];
+ let lis = this.bannerWrap.getElementsByTagName("li");
+// 将类数组转化为数组
+ this.lisArray = Array.from(lis);
+ this.classlist = this.default.classArray;
+//获取左右按钮
+ this.leftBtn = document.getElementsByClassName("left-btn")[0];
+ this.rightBtn = document.getElementsByClassName("right-btn")[0];
+
+ this.move(this.classlist);
+ // this.timer();
+ this.listenMouseEvent();
+ this.listenMouseClickBtnEvent();
},
- //跳转下一页面
- goNextPage() {
- this.$router.push({ name: 'tableTest' })
+//移动
+ move(list) {
+ this.lisArray.forEach((value, index) => {
+ value.setAttribute("class", list[index]); //给每一个li添加对应的类名
+ });
+ },
+// 向左运动
+ leftMove() {
+ let popValue = this.classlist.pop(); //删除并返回数组的最后一个
+ this.classlist.unshift(popValue); //把刚才删除的最后一个添加到数组开头
+ this.move(this.classlist); //调用移动方法,每一个li会根据新数组的位置进行移动,从而实现轮播的效果
+ },
+// 向右运动
+ rightMove() {
+ let shiftValue = this.classlist.shift(); //删除并返回数组的第一个
+ this.classlist.push(shiftValue); //把刚才删除的第一个push到数组末尾
+ this.move(this.classlist);
+ },
+// 定时器自动切换
+ timer() {
+ this.time = setInterval(this.leftMove.bind(this), 1000);
+ },
+// 鼠标移入移出事件
+ listenMouseEvent() {
+ this.bannerWrap.addEventListener("mouseover", () => {
+ clearInterval(this.time);
+ this.leftBtn.style.cssText = `left: 6rem; opacity: 1`;
+ this.rightBtn.style.cssText = `right: 6rem; opacity: 1`;
+ });
+ this.bannerWrap.addEventListener("mouseout", () => {
+ // this.timer();
+ this.leftBtn.style.cssText = `left: 2rem; opacity: 0`;
+ this.rightBtn.style.cssText = `right: 2rem; opacity: 0`;
+ });
+ },
+// 点击左右按钮事件
+ listenMouseClickBtnEvent() {
+ this.leftBtn.addEventListener("click", () => {
+ this.leftMove();
+ });
+ this.rightBtn.addEventListener("click", () => {
+ this.rightMove();
+ });
+ },
+ },
+ mounted() {
+ this.constructor();
+ },
+};
+
+
+
diff --git a/src/views/footer/index.vue b/src/views/footer/index.vue
index e54a3bd..485909c 100644
--- a/src/views/footer/index.vue
+++ b/src/views/footer/index.vue
@@ -43,6 +43,7 @@ export default {
diff --git a/src/views/index/index.vue b/src/views/index/index.vue
index 3c28b88..158f86f 100644
--- a/src/views/index/index.vue
+++ b/src/views/index/index.vue
@@ -288,27 +288,21 @@
- 科学研究
+ 党群工作
-
Scientific research trends
+
Party Building Activities
+
-
-
-
-

-
-
-
-
-
+
+
{{ $t('message.more') }}
@@ -317,7 +311,7 @@