|
|
|
@ -2,30 +2,40 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-04-12 17:33:42
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-04-22 21:02:11
|
|
|
|
|
* @LastEditTime: 2022-04-24 18:20:42
|
|
|
|
|
* @Description: file content
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<view class="seckill" :class="activityStatus === 'startActivity' && 'seckill__start'">
|
|
|
|
|
<view class="seckill--price-box" v-if="activityStatus === 'noStartActivity'">
|
|
|
|
|
<text class="seckill--price-icon">¥</text>
|
|
|
|
|
<text class="seckill--price">{{data.originalPrice}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="seckill--price-box " v-else>
|
|
|
|
|
<text class="seckill--price-icon">¥</text>
|
|
|
|
|
<text class="seckill--price">{{data.activityPrice}}</text>
|
|
|
|
|
<text class="seckill--price-org">¥{{data.originalPrice}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="seckill--timer">
|
|
|
|
|
<view>{{hours}}</view>
|
|
|
|
|
<text>:</text>
|
|
|
|
|
<view>{{minute}}</view>
|
|
|
|
|
<text>:</text>
|
|
|
|
|
<view>{{second}}</view>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="seckill" :class="activityStatus === 'startActivity' && 'seckill__start'">
|
|
|
|
|
<view class="seckill--price-box" v-if="activityStatus === 'noStartActivity'">
|
|
|
|
|
<text class="seckill--price-icon">¥</text>
|
|
|
|
|
<text class="seckill--price">{{data.originalPrice}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="seckill--price-box " v-else>
|
|
|
|
|
<text class="seckill--price-icon">¥</text>
|
|
|
|
|
<text class="seckill--price">{{data.activityPrice}}</text>
|
|
|
|
|
<text class="seckill--price-org">¥{{data.originalPrice}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="seckill--timer-title">
|
|
|
|
|
{{activityStatus === 'startActivity' ? '距结束仅剩' : '即将开始秒杀' }}
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="isDay">{{startDate}}开始</view>
|
|
|
|
|
<view class="seckill--timer">
|
|
|
|
|
<view>{{hours}}</view>
|
|
|
|
|
<text>:</text>
|
|
|
|
|
<view>{{minute}}</view>
|
|
|
|
|
<text>:</text>
|
|
|
|
|
<view>{{second}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title">{{title}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {formatDate} from '@/common/utils';
|
|
|
|
|
export default {
|
|
|
|
|
props : {
|
|
|
|
|
data : {
|
|
|
|
@ -35,6 +45,10 @@ export default {
|
|
|
|
|
activityStatus : {
|
|
|
|
|
type : String,
|
|
|
|
|
default : 'noStartActivity'
|
|
|
|
|
},
|
|
|
|
|
title : {
|
|
|
|
|
type : String,
|
|
|
|
|
default : ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
@ -63,6 +77,14 @@ export default {
|
|
|
|
|
second(){
|
|
|
|
|
let second = parseInt(this.secondNum % 60);
|
|
|
|
|
return second > 9 ? second : `0${second}`;
|
|
|
|
|
},
|
|
|
|
|
isDay(){
|
|
|
|
|
const currentTime = new Date(this.data.currentTime);
|
|
|
|
|
const activityTime = new Date(this.data.activityStartTime);
|
|
|
|
|
return currentTime.getDate() === activityTime.getDate();
|
|
|
|
|
},
|
|
|
|
|
startDate(){
|
|
|
|
|
return formatDate(this.data.activityStartTime, 'm月d日hh:ii')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
@ -113,66 +135,70 @@ export default {
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
|
|
.seckill{
|
|
|
|
|
height: 100rpx;
|
|
|
|
|
height: 110rpx;
|
|
|
|
|
width: 690rpx;
|
|
|
|
|
margin: 20rpx auto;
|
|
|
|
|
background:linear-gradient(180deg, #FFF3EF 0%, #FFFFFF 100%);
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
margin: 20rpx auto 0;
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0 20rpx 0 260rpx;
|
|
|
|
|
&::after{
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
display: block;
|
|
|
|
|
content: '';
|
|
|
|
|
width: 367rpx;
|
|
|
|
|
height: 100rpx;
|
|
|
|
|
background: url('@/static/goods/seckill.png') no-repeat -8rpx -16rpx;
|
|
|
|
|
background-size: 327rpx;
|
|
|
|
|
}
|
|
|
|
|
background-image: url('@/static/goods/seckill.png');
|
|
|
|
|
background-repeat : no-repeat;
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
&__start{
|
|
|
|
|
padding: 0 20rpx 0 234rpx;
|
|
|
|
|
&::after{
|
|
|
|
|
width: 327rpx;
|
|
|
|
|
background: url('@/static/goods/seckill_start.png') no-repeat -8rpx -16rpx;
|
|
|
|
|
background-size: 290rpx;
|
|
|
|
|
}
|
|
|
|
|
padding: 0 20rpx 0 108rpx;
|
|
|
|
|
background-image: url('@/static/goods/seckill_start.png');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
&--price-box{
|
|
|
|
|
padding-top: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
&--price-icon{
|
|
|
|
|
color: $color-yellow4;
|
|
|
|
|
color: $color-grey0;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
&--price{
|
|
|
|
|
color: $color-yellow4;
|
|
|
|
|
font-size: 52rpx;
|
|
|
|
|
color: $color-grey0;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 50rpx;
|
|
|
|
|
}
|
|
|
|
|
&--price-org{
|
|
|
|
|
color: $color-grey4;
|
|
|
|
|
color: $color-grey0;
|
|
|
|
|
text-decoration: line-through;
|
|
|
|
|
margin-left: 15rpx;
|
|
|
|
|
}
|
|
|
|
|
&--timer-title{
|
|
|
|
|
margin: 20rpx 0 10rpx 0;
|
|
|
|
|
color: $color-grey0;
|
|
|
|
|
text-align: right;
|
|
|
|
|
font-size: $font-size-sm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&--timer{
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
view{
|
|
|
|
|
background: #000;
|
|
|
|
|
width: 48rpx;
|
|
|
|
|
height: 48rpx;
|
|
|
|
|
line-height: 48rpx;
|
|
|
|
|
background: #E83710;
|
|
|
|
|
width: 40rpx;
|
|
|
|
|
height: 40rpx;
|
|
|
|
|
line-height: 40rpx;
|
|
|
|
|
color: #fff;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
font-size: $font-size-sm;
|
|
|
|
|
}
|
|
|
|
|
text{
|
|
|
|
|
margin: 0 5rpx;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.title{
|
|
|
|
|
margin: 0 30rpx ;
|
|
|
|
|
background: $color-grey0;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
font-size: $font-size-lg;
|
|
|
|
|
line-height: 48rpx;
|
|
|
|
|
}
|
|
|
|
|
</style>
|