Commit 8818c350 authored by beisir's avatar beisir

feat:列表页头像轮播修改

parent 60556034
<template>
<div class="avator-swiper" @click="onSlidePrevChange">
<swiper ref="mySwiper" :options="swiperOptions" class="avator-swiper_container">
<!-- @slide-change="slideChange"
@set-translate="setTranslate" -->
<swiper-slide v-for="(item, index) in avatorData" :key="index" class="avator-swiper_item">
<div class="avator-swiper_item">
<img :src="item" />
......@@ -10,7 +8,7 @@
</swiper-slide>
</swiper>
<div class="avator-swiper_right">
<cr-image class="avator-swiper_item" :src="leftImgPath" />
<cr-image class="avator-swiper_item" :src="rightImgPath" />
</div>
</div>
</template>
......@@ -18,7 +16,7 @@
import { swiper, swiperSlide } from 'vue-awesome-swiper';
import 'swiper/dist/css/swiper.css';
export default {
name: 'AvatorSwiper',
name: 'GroupSwiper',
components: {
swiper,
swiperSlide
......@@ -34,8 +32,6 @@ export default {
data() {
const vm = this;
return {
activeIndex: 0,
leftImgPath: '',
rightImgPath: '',
swiperOptions: {
loop: true,
......@@ -47,28 +43,23 @@ export default {
watchSlidesProgress: true,
allowTouchMove: false,
autoplay: false,
// autoplay: {
// delay: 900,
// stopOnLastSlide: false,
// disableOnInteraction: false
// }
on: {
init: function() {
let slideLeft = this.slides.eq(this.activeIndex - 3);
const slideLeft = this.slides.eq(this.activeIndex - 3);
slideLeft.addClass('ani-left');
},
transitionStart: function() {
let slideLeft = this.slides.eq(this.activeIndex - 3);
let slideRight = this.slides.eq(this.activeIndex + 4);
const activeIndex = this.activeIndex;
const slideLeft = this.slides.eq(activeIndex - 3);
const slideRight = this.slides.eq(activeIndex + 4);
slideLeft.addClass('ani-left');
slideRight.addClass('ani-right');
vm.leftImgPath = slideRight.find('img').attr('src');
vm.rightImgPath = slideRight.find('img').attr('src');
},
transitionEnd: function() {
for (let i = 0; i < this.slides.length; i++) {
let slide = this.slides.eq(i);
slide.removeClass('ani-left');
slide.removeClass('ani-right');
slide.removeClass('ani-left ani-right');
}
}
}
......@@ -85,6 +76,9 @@ export default {
this.onSlidePrevChange();
}
},
mounted() {
console.log(this.swiper);
},
methods: {
onSlidePrevChange() {
this.swiper.slidePrev();
......@@ -121,7 +115,7 @@ export default {
margin: 0 auto !important;
position: relative;
&_right {
height: 25px;
height: 100%;
width: 25px;
position: absolute;
right: 3px;
......@@ -129,16 +123,12 @@ export default {
}
&_item {
transition: transform 0.2s linear;
height: 32px;
padding-top: 2px;
img {
height: 25px;
width: 25px;
border-radius: 50%;
}
&.active {
transform: scale(1.2);
}
}
}
</style>
......@@ -43,7 +43,7 @@ const commonParams = {
loading: false,
finished: false,
page: 1,
pageSize: 10,
pageSize: 5,
list: []
};
export default {
......
......@@ -15,10 +15,12 @@
</div>
</div>
<p class="tips">
您可在“我的-我的订单”中查看详情
拼团成功即可退款0元拿,拼团失败立即退款
</p>
<div class="actions">
<cr-button shape="circle" type="default" @click="goHome(payStatus)">我的拼团</cr-button>
<cr-button shape="circle" type="default" @click="goOrderList(payStatus)"
>我的拼团</cr-button
>
<cr-button
shape="circle"
class="actions__back"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment