70 lines
2.0 KiB
Vue
70 lines
2.0 KiB
Vue
<template>
|
|
<view>
|
|
<u-count-down v-if="type==1" :time="stopTime" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
|
|
<view class="">
|
|
<text class="f-36 fw-5" style="color: #FF7527;margin-right: 16rpx;"
|
|
v-if="timeData.days>3">{{timeData.days+'天'}}</text>
|
|
<view v-else class="f-36 fw-5" style="color: #FF7527">
|
|
{{(timeData.days*24)+timeData.hours>10?(timeData.days*24)+timeData.hours:'0'+timeData.hours}}:{{timeData.minutes>10?timeData.minutes:'0'+timeData.minutes}}:{{timeData.seconds>10?timeData.seconds:'0'+timeData.seconds }}
|
|
</view>
|
|
</view>
|
|
</u-count-down>
|
|
<u-count-down v-if="type==2" :time="stopTime" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
|
|
<view class="swiper-item-cont-down flex align-center">
|
|
<text class="f-36 fw-5" style="color: #FF7527;margin-right: 16rpx;"
|
|
v-if="timeData.days>3">{{timeData.days+'天'}}</text>
|
|
<view v-else class="serve-seckill-item flex align-center">
|
|
<view class="swiper-item-cont">
|
|
{{(timeData.days*24)+timeData.hours>10?(timeData.days*24)+timeData.hours:'0'+timeData.hours}}
|
|
</view>
|
|
<text class="swiper-item-text">:</text>
|
|
<view class="swiper-item-cont">
|
|
{{timeData.minutes>10?timeData.minutes:'0'+timeData.minutes}}
|
|
</view>
|
|
<text class="swiper-item-text">:</text>
|
|
<view class="swiper-item-cont">{{timeData.seconds>10?timeData.seconds:'0'+timeData.seconds }}</view>
|
|
</view>
|
|
</view>
|
|
</u-count-down>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "count-down",
|
|
props: ['stopTime', 'type'],
|
|
data() {
|
|
return {
|
|
timeData: {}
|
|
};
|
|
},
|
|
methods: {
|
|
onChange(e) {
|
|
// console.log(e);
|
|
this.timeData = e
|
|
// console.log(this.timeData);
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.serve-seckill-item {
|
|
color: #333;
|
|
font-size: 22rpx;
|
|
|
|
.swiper-item-cont {
|
|
width: 34rpx;
|
|
height: 34rpx;
|
|
font-size: 24rpx;
|
|
text-align: center;
|
|
line-height: 34rpx;
|
|
color: #FF5400;
|
|
background: rgba(255, 129, 62, 0.3);
|
|
}
|
|
|
|
.swiper-item-text {
|
|
margin: 0 9rpx;
|
|
}
|
|
}
|
|
</style> |