Commit 12f90e11 authored by 刘文虎's avatar 刘文虎
parents 4cf9066d 6721336c
Pipeline #3258 canceled with stages
......@@ -4,25 +4,39 @@
hover-class="u-hover-class"
@click.stop="$u.throttle(handleClickCard, 500)"
>
<swiper
class="swiper"
:indicator-dots="true"
indicator-color="rgba(2, 160, 116, 0.45)"
indicator-active-color="rgba(2, 160, 116, 1)"
style="height: 420rpx"
>
<swiper-item>
<Card
ref="card"
:info="info"
@save="handleCanvas"
@update="handleUpdate"
/>
</swiper-item>
<swiper-item>
<CardBack ref="cardBack" :info="info" @save="handleCanvasBack" />
</swiper-item>
</swiper>
<view class="swiper-view">
<swiper
class="swiper"
:indicator-dots="false"
:current="current"
style="height: 420rpx"
@change="handleChange"
>
<swiper-item>
<Card
ref="card"
:info="info"
@save="handleCanvas"
@update="handleUpdate"
/>
</swiper-item>
<swiper-item>
<CardBack ref="cardBack" :info="info" @save="handleCanvasBack" />
</swiper-item>
</swiper>
</view>
<view class="dot-view">
<view
:class="[
index == current
? 'u-indicator-item-round-active'
: 'u-indicator-item-round',
{ second: current == 1 },
]"
v-for="(item, index) in [0, 1]"
:key="index"
></view>
</view>
</view>
</template>
......@@ -43,7 +57,9 @@ export default {
},
},
data() {
return {}
return {
current: 0,
}
},
computed: {},
......@@ -66,6 +82,9 @@ export default {
handleCanvasBack(res) {
this.$refs.card.saveImage()
},
handleChange(event) {
this.current = event.detail.current
},
},
}
</script>
......@@ -77,5 +96,40 @@ export default {
background-color: #ffffff;
position: relative;
overflow: hidden;
.swiper-view {
position: relative;
}
.dot-view {
position: absolute;
top: 364rpx;
left: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
height: 56rpx;
.u-indicator-item-round {
width: 14rpx;
height: 14rpx;
margin: 0 6rpx;
border-radius: 20rpx;
transition: all 0.5s;
background-color: rgba(2, 160, 116, 0.45);
&.second {
background-color: rgba(0, 0, 0, 0.3);
}
}
.u-indicator-item-round-active {
height: 14rpx;
margin: 0 6rpx;
border-radius: 20rpx;
transition: all 0.5s;
width: 34rpx;
background-color: rgba(2, 160, 116, 1);
&.second {
background-color: rgba(255, 255, 255, 0.8);
}
}
}
}
</style>
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