|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="swiper-container" >
|
|
|
|
|
|
+ <div class="swiper-container">
|
|
<swiper
|
|
<swiper
|
|
ref="listSwiper"
|
|
ref="listSwiper"
|
|
class="swiper-wrapper swiper-wrapper-n"
|
|
class="swiper-wrapper swiper-wrapper-n"
|
|
@@ -10,11 +10,22 @@
|
|
v-for="(item, index) in cards"
|
|
v-for="(item, index) in cards"
|
|
:key="index"
|
|
:key="index"
|
|
>
|
|
>
|
|
- <div @click="$router.push({name:'Scene',query:{id:item.id},params:{link:item.link}})">
|
|
|
|
|
|
+ <div
|
|
|
|
+ @click="
|
|
|
|
+ $router.push({
|
|
|
|
+ name: 'Scene',
|
|
|
|
+ query: { id: item.id },
|
|
|
|
+ params: { link: item.link },
|
|
|
|
+ })
|
|
|
|
+ "
|
|
|
|
+ >
|
|
<img class="logo" :src="`${$cdn}images/scene${item.img}.jpg`" />
|
|
<img class="logo" :src="`${$cdn}images/scene${item.img}.jpg`" />
|
|
- <div class="maskss" ></div>
|
|
|
|
|
|
+ <div class="maskss"></div>
|
|
</div>
|
|
</div>
|
|
</swiper-slide>
|
|
</swiper-slide>
|
|
|
|
+ <div class="swiper-pagination" slot="pagination"></div>
|
|
|
|
+ <div class="swiper-button-next"></div>
|
|
|
|
+ <div class="swiper-button-prev"></div>
|
|
</swiper>
|
|
</swiper>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -29,57 +40,67 @@ export default {
|
|
},
|
|
},
|
|
swiperOption() {
|
|
swiperOption() {
|
|
// let that = this
|
|
// let that = this
|
|
- let getIndex = (range,length,current)=>{
|
|
|
|
- let next =(current + range) > length ? (current + range) - length : (current + range)
|
|
|
|
- let prev =(current - range) < 0 ? (current - range) + length : (current - range)
|
|
|
|
|
|
+ let getIndex = (range, length, current) => {
|
|
|
|
+ let next =
|
|
|
|
+ current + range > length ? current + range - length : current + range;
|
|
|
|
+ let prev =
|
|
|
|
+ current - range < 0 ? current - range + length : current - range;
|
|
|
|
|
|
return {
|
|
return {
|
|
prev,
|
|
prev,
|
|
- next
|
|
|
|
- }
|
|
|
|
|
|
+ next,
|
|
|
|
+ };
|
|
};
|
|
};
|
|
|
|
|
|
- let setClass = (range,length,current,that,cls)=>{
|
|
|
|
- let {prev,next} = getIndex(range,length,current)
|
|
|
|
- let p = that.slides.eq(prev)
|
|
|
|
- let n = that.slides.eq(next)
|
|
|
|
- let cur = that.slides.eq(current)
|
|
|
|
|
|
+ let setClass = (range, length, current, that, cls) => {
|
|
|
|
+ let { prev, next } = getIndex(range, length, current);
|
|
|
|
+ let p = that.slides.eq(prev);
|
|
|
|
+ let n = that.slides.eq(next);
|
|
|
|
+ let cur = that.slides.eq(current);
|
|
|
|
|
|
- p.find('.maskss').removeClass('mask mask1 mask2')
|
|
|
|
- n.find('.maskss').removeClass('mask mask1 mask2')
|
|
|
|
- cur.find('.maskss').removeClass('mask mask1 mask2')
|
|
|
|
|
|
+ p.find(".maskss").removeClass("mask mask1 mask2");
|
|
|
|
+ n.find(".maskss").removeClass("mask mask1 mask2");
|
|
|
|
+ cur.find(".maskss").removeClass("mask mask1 mask2");
|
|
|
|
|
|
- p.find('.maskss').addClass(cls);
|
|
|
|
- n.find('.maskss').addClass(cls);
|
|
|
|
|
|
+ p.find(".maskss").addClass(cls);
|
|
|
|
+ n.find(".maskss").addClass(cls);
|
|
};
|
|
};
|
|
return {
|
|
return {
|
|
watchSlidesProgress: true,
|
|
watchSlidesProgress: true,
|
|
slidesPerView: "auto",
|
|
slidesPerView: "auto",
|
|
centeredSlides: true,
|
|
centeredSlides: true,
|
|
- initialSlide :2,
|
|
|
|
|
|
+ initialSlide: 2,
|
|
// loop: true,
|
|
// loop: true,
|
|
// loopedSlides: 9,
|
|
// loopedSlides: 9,
|
|
|
|
+ navigation: {
|
|
|
|
+ nextEl: ".swiper-button-next",
|
|
|
|
+ prevEl: ".swiper-button-prev",
|
|
|
|
+ },
|
|
|
|
+ pagination: {
|
|
|
|
+ el: ".swiper-pagination",
|
|
|
|
+ clickable: true //允许分页点击跳转
|
|
|
|
+ },
|
|
on: {
|
|
on: {
|
|
- click:function () {
|
|
|
|
- if (this.clickedIndex>=0) {
|
|
|
|
- this.slideTo(this.clickedIndex, 500,()=>{
|
|
|
|
|
|
+ click: function () {
|
|
|
|
+ if (this.clickedIndex >= 0) {
|
|
|
|
+ this.slideTo(this.clickedIndex, 500, () => {
|
|
this.lazy.load();
|
|
this.lazy.load();
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- transitionEnd:function () {
|
|
|
|
- let length = this.slides.length
|
|
|
|
|
|
+ transitionEnd: function () {
|
|
|
|
+ let length = this.slides.length;
|
|
for (let i = 0; i < length; i++) {
|
|
for (let i = 0; i < length; i++) {
|
|
var slide = this.slides.eq(i);
|
|
var slide = this.slides.eq(i);
|
|
- let classNames =slide[0].className
|
|
|
|
- if (classNames.indexOf('active')>-1) {
|
|
|
|
- setClass (1,length,i,this,'mask')
|
|
|
|
- setClass (2,length,i,this,'mask1')
|
|
|
|
- setClass (3,length,i,this,'mask2')
|
|
|
|
|
|
+ let classNames = slide[0].className;
|
|
|
|
+ if (classNames.indexOf("active") > -1) {
|
|
|
|
+ setClass(1, length, i, this, "mask");
|
|
|
|
+ setClass(2, length, i, this, "mask1");
|
|
|
|
+ setClass(3, length, i, this, "mask2");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- progress: function() {
|
|
|
|
|
|
+ progress: function () {
|
|
for (let i = 0; i < this.slides.length; i++) {
|
|
for (let i = 0; i < this.slides.length; i++) {
|
|
var slide = this.slides.eq(i);
|
|
var slide = this.slides.eq(i);
|
|
var slideProgress = this.slides[i].progress;
|
|
var slideProgress = this.slides[i].progress;
|
|
@@ -90,81 +111,82 @@ export default {
|
|
let translate = slideProgress * modify * 140 + "px";
|
|
let translate = slideProgress * modify * 140 + "px";
|
|
let scale = 1 - Math.abs(slideProgress) / 5;
|
|
let scale = 1 - Math.abs(slideProgress) / 5;
|
|
let zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
let zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
-
|
|
|
|
|
|
+
|
|
// let opacity = 1 - Math.min(Math.abs(slideProgress / 2), 1);
|
|
// let opacity = 1 - Math.min(Math.abs(slideProgress / 2), 1);
|
|
-
|
|
|
|
|
|
+
|
|
slide.transform(
|
|
slide.transform(
|
|
"translateX(" + translate + ") scale(" + scale + ")"
|
|
"translateX(" + translate + ") scale(" + scale + ")"
|
|
);
|
|
);
|
|
slide.css({
|
|
slide.css({
|
|
- "zIndex": zIndex,
|
|
|
|
- "opacity": 1,
|
|
|
|
- "pointer-events": 'auto',
|
|
|
|
-
|
|
|
|
|
|
+ zIndex: zIndex,
|
|
|
|
+ opacity: 1,
|
|
|
|
+ "pointer-events": "auto",
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
if (Math.abs(slideProgress) > 3) {
|
|
if (Math.abs(slideProgress) > 3) {
|
|
slide.css({
|
|
slide.css({
|
|
// "opacity":0,
|
|
// "opacity":0,
|
|
- "pointer-events":"none"
|
|
|
|
|
|
+ "pointer-events": "none",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- setTransition: function(transition) {
|
|
|
|
|
|
+ setTransition: function (transition) {
|
|
for (var i = 0; i < this.slides.length; i++) {
|
|
for (var i = 0; i < this.slides.length; i++) {
|
|
var slide = this.slides.eq(i);
|
|
var slide = this.slides.eq(i);
|
|
slide.transition(transition);
|
|
slide.transition(transition);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- props:['list'],
|
|
|
|
|
|
+ props: ["list"],
|
|
data() {
|
|
data() {
|
|
- let cards = [{
|
|
|
|
- img:1,
|
|
|
|
- id:8,
|
|
|
|
- link:'https://www.4dmodel.com/SuperTwoCustom/SuperTwoShaoShan/index.html?m=749',
|
|
|
|
- name:'毛鉴公祠'
|
|
|
|
- },{
|
|
|
|
- img:2,
|
|
|
|
- id:3,
|
|
|
|
- link:'https://www.4dmodel.com/SuperTwoCustom/SuperTwoShaoShan/index.html?m=752',
|
|
|
|
- name:'毛氏宗祠'
|
|
|
|
- },{
|
|
|
|
- img:3,
|
|
|
|
- id:4,
|
|
|
|
- link:'https://www.4dmodel.com/SuperTwoCustom/SuperTwoShaoShan/index.html?m=761',
|
|
|
|
- name:'毛泽东同志故居'
|
|
|
|
- },{
|
|
|
|
- img:4,
|
|
|
|
- id:9,
|
|
|
|
- link:'https://www.4dmodel.com/SuperTwoCustom/SuperTwoShaoShan/index.html?m=750',
|
|
|
|
- name:'毛震公祠'
|
|
|
|
- },{
|
|
|
|
- img:5,
|
|
|
|
- id:5,
|
|
|
|
- link:'https://www.4dmodel.com/SuperTwoCustom/SuperTwoShaoShan/index.html?m=754',
|
|
|
|
- name:'南岸私塾'
|
|
|
|
- },{
|
|
|
|
- img:6,
|
|
|
|
- id:7,
|
|
|
|
- link:'https://www.4dmodel.com/SuperTwoCustom/SuperTwoShaoShan/index.html?m=751',
|
|
|
|
- name:'毛泽东同志纪念馆(专题展区)'
|
|
|
|
- },{
|
|
|
|
- img:7,
|
|
|
|
- id:6,
|
|
|
|
- link:'https://www.4dmodel.com/SuperTwoCustom/SuperTwo755/index.html?m=755',
|
|
|
|
- name:'毛泽东同志纪念馆(生平展区)'
|
|
|
|
- }]
|
|
|
|
|
|
+ let cards = [
|
|
|
|
+ {
|
|
|
|
+ img: 1,
|
|
|
|
+ id: 8,
|
|
|
|
+ link: "http://www.4dmodel.com/SuperTwo/index.html?m=1017",
|
|
|
|
+ name: "万山海战遗址",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ img: 2,
|
|
|
|
+ id: 3,
|
|
|
|
+ link: "http://www.4dmodel.com/SuperTwo582/vtour/tour.html",
|
|
|
|
+ name: "杨匏安陈列馆",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ img: 3,
|
|
|
|
+ id: 4,
|
|
|
|
+ link: "http://www.4dmodel.com/SuperTwo/index.html?m=1016",
|
|
|
|
+ name: "林伟民与中国早期工人运动史迹陈列馆",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ img: 4,
|
|
|
|
+ id: 9,
|
|
|
|
+ link: "http://www.4dmodel.com/SuperTwo/index.html?m=1018",
|
|
|
|
+ name: "中共小濠冲党史教育基地",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ img: 5,
|
|
|
|
+ id: 5,
|
|
|
|
+ link: "http://www.4dmodel.com/SuperTwo/index.html?m=997",
|
|
|
|
+ name: "苏兆征故居陈列馆",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ img: 6,
|
|
|
|
+ id: 7,
|
|
|
|
+ link: "http://www.4dmodel.com/SuperTwo/index.html?m=1015",
|
|
|
|
+ name: "市退役军人事务局",
|
|
|
|
+ }
|
|
|
|
+ ];
|
|
return {
|
|
return {
|
|
- activeDate: "",
|
|
|
|
- showNext: 0,
|
|
|
|
- showPre: 0,
|
|
|
|
- activeIdx:'',
|
|
|
|
- cards
|
|
|
|
|
|
+ // activeDate: "",
|
|
|
|
+ // showNext: 0,
|
|
|
|
+ // showPre: 0,
|
|
|
|
+ // activeIdx:'',
|
|
|
|
+ cards,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -179,8 +201,7 @@ export default {
|
|
directives: {
|
|
directives: {
|
|
swiper: directive,
|
|
swiper: directive,
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
- },
|
|
|
|
|
|
+ mounted() {},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@@ -206,7 +227,7 @@ export default {
|
|
width: 100%;
|
|
width: 100%;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
|
|
}
|
|
}
|
|
-.swiper-slide .maskss{
|
|
|
|
|
|
+.swiper-slide .maskss {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -214,23 +235,23 @@ export default {
|
|
top: 0;
|
|
top: 0;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
-.swiper-slide .mask{
|
|
|
|
- background: #804D28;
|
|
|
|
|
|
+.swiper-slide .mask {
|
|
|
|
+ background: #804d28;
|
|
opacity: 0.5;
|
|
opacity: 0.5;
|
|
}
|
|
}
|
|
|
|
|
|
-.swiper-slide .mask1{
|
|
|
|
|
|
+.swiper-slide .mask1 {
|
|
background: #6e4029;
|
|
background: #6e4029;
|
|
opacity: 0.65;
|
|
opacity: 0.65;
|
|
}
|
|
}
|
|
|
|
|
|
-.swiper-slide .mask2{
|
|
|
|
|
|
+.swiper-slide .mask2 {
|
|
background: #4b2b13;
|
|
background: #4b2b13;
|
|
opacity: 0.65;
|
|
opacity: 0.65;
|
|
}
|
|
}
|
|
@media screen and (max-width: 1600px) {
|
|
@media screen and (max-width: 1600px) {
|
|
- .swiper-slide {
|
|
|
|
- width: 350px;
|
|
|
|
- }
|
|
|
|
|
|
+ .swiper-slide {
|
|
|
|
+ width: 350px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|