Commit e940944c by 张立顺

轮播调整

1 parent 4219771e
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</div> </div>
</div> </div>
</div> </div>
<el-carousel class="swiper-box" ref="slideCarousel" :interval="10000"> <el-carousel class="swiper-box" ref="slideCarousel" :interval="4000" autoplay>
<el-carousel-item v-for="(item, index) in Introduce.booksList" :key="'sw' + index"> <el-carousel-item v-for="(item, index) in Introduce.booksList" :key="'sw' + index">
<div class="swiper-body"> <div class="swiper-body">
<div class="books-item" v-for="(i, idx) in 6" :key="'book' + idx"> <div class="books-item" v-for="(i, idx) in 6" :key="'book' + idx">
...@@ -54,33 +54,33 @@ export default { ...@@ -54,33 +54,33 @@ export default {
} }
}, },
mounted() { mounted() {
//调用方法 // 调用方法
this.slideBanner() this.slideBanner()
}, },
methods: { methods: {
// 滑动切换 // 滑动切换
slideBanner() { slideBanner() {
//选中的轮播图 // 选中的轮播图
var box = document.querySelector('.swiper-box') var box = document.querySelector('.swiper-box')
var startPoint = 0 var startPoint = 0
var stopPoint = 0 var stopPoint = 0
//重置坐标 // 重置坐标
var resetPoint = function () { var resetPoint = function () {
startPoint = 0 startPoint = 0
stopPoint = 0 stopPoint = 0
} }
//手指按下 // 手指按下
box.addEventListener('touchstart', function (e) { box.addEventListener('touchstart', function (e) {
//手指点击位置的X坐标 // 手指点击位置的X坐标
startPoint = e.changedTouches[0].pageX startPoint = e.changedTouches[0].pageX
}) })
//手指滑动 // 手指滑动
box.addEventListener('touchmove', function (e) { box.addEventListener('touchmove', function (e) {
//手指滑动后终点位置X的坐标 // 手指滑动后终点位置X的坐标
stopPoint = e.changedTouches[0].pageX stopPoint = e.changedTouches[0].pageX
}) })
//当手指抬起的时候,判断图片滚动离左右的距离 // 当手指抬起的时候,判断图片滚动离左右的距离
let that = this const that = this
box.addEventListener('touchend', function (e) { box.addEventListener('touchend', function (e) {
console.log('1:' + startPoint) console.log('1:' + startPoint)
console.log('2:' + stopPoint) console.log('2:' + stopPoint)
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
padding: 12px 52px; padding: 12px 52px;
box-sizing: border-box; box-sizing: border-box;
&-title { &-title {
font-weight: 700; font-weight: 700;
font-size: 28px; font-size: 28px;
...@@ -120,10 +121,12 @@ export default { ...@@ -120,10 +121,12 @@ export default {
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
} }
.books-line img { .books-line img {
width: 436px; width: 436px;
height: 6px; height: 6px;
} }
&-content { &-content {
margin-top: 50px; margin-top: 50px;
font-size: 18px; font-size: 18px;
...@@ -132,6 +135,7 @@ export default { ...@@ -132,6 +135,7 @@ export default {
line-height: 40px; line-height: 40px;
} }
} }
.books-box { .books-box {
margin-top: 24px; margin-top: 24px;
width: 492px; width: 492px;
...@@ -140,16 +144,19 @@ export default { ...@@ -140,16 +144,19 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
padding: 28px; padding: 28px;
box-sizing: border-box; box-sizing: border-box;
&-title { &-title {
font-size: 22px; font-size: 22px;
color: #44ffff; color: #44ffff;
letter-spacing: 0; letter-spacing: 0;
line-height: 32px; line-height: 32px;
} }
.qualifications-list { .qualifications-list {
display: flex; display: flex;
gap: 17px; gap: 17px;
margin-top: 20px; margin-top: 20px;
.qualifications-item { .qualifications-item {
width: 134px; width: 134px;
height: 100px; height: 100px;
...@@ -157,21 +164,25 @@ export default { ...@@ -157,21 +164,25 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
padding: 16px 20px; padding: 16px 20px;
box-sizing: border-box; box-sizing: border-box;
.qualifications-title { .qualifications-title {
font-size: 13px; font-size: 13px;
color: #ffffff; color: #ffffff;
} }
.qualifications-num { .qualifications-num {
font-size: 36px; font-size: 36px;
color: #6578ff; color: #6578ff;
line-height: 36px; line-height: 36px;
margin-top: 10px; margin-top: 10px;
font-weight: 700; font-weight: 700;
span { span {
font-weight: 500; font-weight: 500;
font-size: 16px; font-size: 16px;
color: #0ffadf; color: #0ffadf;
margin-left: -10px; margin-left: -10px;
&.f28 { &.f28 {
font-size: 28px; font-size: 28px;
} }
...@@ -179,16 +190,20 @@ export default { ...@@ -179,16 +190,20 @@ export default {
} }
} }
} }
.swiper-box { .swiper-box {
padding-top: 28px; padding-top: 28px;
height: 250px; height: 250px;
/deep/ { /deep/ {
.el-carousel__container { .el-carousel__container {
height: 100%; height: 100%;
} }
.el-carousel__arrow { .el-carousel__arrow {
display: none; display: none;
} }
.el-carousel__button { .el-carousel__button {
width: 24px; width: 24px;
height: 4px; height: 4px;
...@@ -196,16 +211,19 @@ export default { ...@@ -196,16 +211,19 @@ export default {
transform: scaleY(-1) rotate(-180deg); transform: scaleY(-1) rotate(-180deg);
background-image: linear-gradient(90deg, #00c8ff 0%, #0069f2 100%); background-image: linear-gradient(90deg, #00c8ff 0%, #0069f2 100%);
} }
.is-active { .is-active {
.el-carousel__button { .el-carousel__button {
opacity: 1; opacity: 1;
} }
} }
} }
.swiper-body { .swiper-body {
display: flex; display: flex;
gap: 28px 17px; gap: 28px 17px;
flex-wrap: wrap; flex-wrap: wrap;
.books-item { .books-item {
width: 134px; width: 134px;
height: 96px; height: 96px;
...@@ -214,6 +232,7 @@ export default { ...@@ -214,6 +232,7 @@ export default {
position: relative; position: relative;
padding: 8px; padding: 8px;
box-sizing: border-box; box-sizing: border-box;
img { img {
width: 118px; width: 118px;
height: 80px; height: 80px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!