index.vue
4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<template>
<div class="spike">
<div class="spike-card" v-if="productData.products && productData.products.length>0">
<div class="spike-card-top">
<h2 class="spike-card-top-title">
<!-- #ifdef MP-WEIXIN -->
<img class="title-img" src="../../../static/images/spike/img-title.png" alt="秒杀专区" mode="widthFix"/>
<!-- #endif -->
<!-- #ifdef H5 || APP-PLUS -->
<image class="title-img" src="../../../static/images/spike/img-title.png" alt="秒杀专区" mode="widthFix"/>
<!-- #endif -->
</h2>
<div class="spike-card-top-time" v-if="state===2">
活动已结束
</div>
<div class="spike-card-top-time" v-if="state !==2 && count.length">
距离{{count[0]}}还有 <div class="span">{{count[1]}}:{{count[2]}}:{{count[3]}}</div>
</div>
<a class="btn-more" @click="jumpSeckills(productData)">更多<i class="iconfont icon-arrow-right"></i></a>
</div>
<div class="spike-card-list">
<div class="spike-card-item" v-for='item in productData.products.slice(0,4)' :key='item.productId' @click="jumpProductDetail(item)">
<div class="spike-card-item-img">
<img :src="item.image" alt="">
</div>
<div class="spike-card-item-info">
<h3 class="name">
{{item.productName}}
</h3>
<div class="stock">
还剩{{item.stockNumber}}件
</div>
<div class="price-warp">
<div class="price">
¥ {{item.price}}
</div>
<!-- <div class="original-price">
¥ {{item.originalPrice}}
</div> -->
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {commonMixin} from '../mixin'
export default {
mixins: [commonMixin]
}
</script>
<style lang="scss" scoped>
.spike{
background: #F8F8F8;
padding: 20upx;
&-card{
height: 430upx;
background: #FFFFFF;
border-radius: 20upx;
&-top{
position: relative;
padding: 32upx 0 22upx;
display: flex;
&-title{
padding: 9upx 20upx 9upx 30upx;
.title-img{
width: 204upx;
display: block;
}
}
&-time{
padding: 0 18upx;
height: 50upx;
background: linear-gradient(90deg, #C83732 0%, #E25C44 100%);
box-shadow: 0px 6upx 12upx rgba(233, 0, 0, 0.3);
opacity: 1;
border-radius: 26upx;
font-size: 24upx;
line-height: 50upx;
color: #fff;
text-align: center;
.span{
display: inline;
}
}
.btn-more{
position: absolute;
right: 8upx;
top: 40upx;
line-height: 33upx;
padding-right: 25upx;
font-size: 24upx;
color: #333;
.iconfont{
content: '';
font-size: 26upx;
position: absolute;
right: 0;
top: 0;
}
}
}
&-list{}
&-item{
width: 50%;
border-top: 1px solid #F3F4F5;
border-left: 1px solid #F3F4F5;
float: left;
align-items: center;
box-sizing: border-box;
&:nth-child(2n+1){
border-left: 0px;
}
&-img{
width: 162upx;
height: 162upx;
margin-right: 10upx;
float: left;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
}
&-info{
height: 100%;
margin-left: 172upx;
width: 168upx;
.name{
font-size: 24upx;
line-height: 40upx;
color: #333333;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.stock{
padding: 0 8upx;
height: 40upx;
border: 2upx solid #E4E5E6;
line-height: 40upx;
margin: 10upx 0;
display: inline-block;
font-size: 20upx;
color: #C5AA7B;
}
.price{
font-size: 32upx;
font-weight: bold;
line-height: 44upx;
color: #C83732;
padding-right: 10upx;
display: inline-block;
}
.original-price{
font-size: 20upx;
line-height: 28upx;
color: #CCCCCC;
display: inline-block;
}
}
}
}
}
</style>