Commit 12f90e11 authored by 刘文虎's avatar 刘文虎
parents 4cf9066d 6721336c
Pipeline #3258 canceled with stages
...@@ -4,25 +4,39 @@ ...@@ -4,25 +4,39 @@
hover-class="u-hover-class" hover-class="u-hover-class"
@click.stop="$u.throttle(handleClickCard, 500)" @click.stop="$u.throttle(handleClickCard, 500)"
> >
<swiper <view class="swiper-view">
class="swiper" <swiper
:indicator-dots="true" class="swiper"
indicator-color="rgba(2, 160, 116, 0.45)" :indicator-dots="false"
indicator-active-color="rgba(2, 160, 116, 1)" :current="current"
style="height: 420rpx" style="height: 420rpx"
> @change="handleChange"
<swiper-item> >
<Card <swiper-item>
ref="card" <Card
:info="info" ref="card"
@save="handleCanvas" :info="info"
@update="handleUpdate" @save="handleCanvas"
/> @update="handleUpdate"
</swiper-item> />
<swiper-item> </swiper-item>
<CardBack ref="cardBack" :info="info" @save="handleCanvasBack" /> <swiper-item>
</swiper-item> <CardBack ref="cardBack" :info="info" @save="handleCanvasBack" />
</swiper> </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> </view>
</template> </template>
...@@ -43,7 +57,9 @@ export default { ...@@ -43,7 +57,9 @@ export default {
}, },
}, },
data() { data() {
return {} return {
current: 0,
}
}, },
computed: {}, computed: {},
...@@ -66,6 +82,9 @@ export default { ...@@ -66,6 +82,9 @@ export default {
handleCanvasBack(res) { handleCanvasBack(res) {
this.$refs.card.saveImage() this.$refs.card.saveImage()
}, },
handleChange(event) {
this.current = event.detail.current
},
}, },
} }
</script> </script>
...@@ -77,5 +96,40 @@ export default { ...@@ -77,5 +96,40 @@ export default {
background-color: #ffffff; background-color: #ffffff;
position: relative; position: relative;
overflow: hidden; 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> </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