Commit e940944c by 张立顺

轮播调整

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