priceCard.vue
1.8 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
<template>
<view class="price_list">
<u-scroll-list :indicator="false">
<view v-for="(item, index) in priceList" :key="index" class="scroll_box" >
<view class="price_card" :class="{active: current === index}" @click="current = index">
<text class="col-f f-36 l-h-48">{{ item.title }}</text>
<view style="color: #FFC8A1;" class="f-24 l-h-32">¥<text class="price">{{ item.price }}</text></view>
<text style="color: #bbb;" class="f-24 l-h-32">限6个场地</text>
</view>
</view>
</u-scroll-list>
<view class="col-f f-24 l-h-32 m-top30">*激活门店类型超过<text style="color: #FFC8A1;">2</text>个,每个月享受<text style="color: #FFC8A1;">7</text>折优惠!</view>
</view>
</template>
<script>
export default {
props: {
priceList: {
type: Array,
require: true
}
},
data(){
return {
current: 0
}
}
}
</script>
<style lang="scss" scoped>
.price_list{
padding: 30rpx;
border-bottom: 2rpx solid #666;
.scroll_box{
margin-right: 16rpx;
&:last-child{
margin-right: 0;
}
}
.price_card{
display: flex;
flex-direction: column;
align-items: center;
width: 220rpx;
height: 200rpx;
background: #2C2C2C;
box-sizing: border-box;
padding-top: 10rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid #4C4845;
&.active{
border: 4rpx solid #FFC8A1;
}
.price{
font-weight: 600;
font-size: 60rpx;
line-height: 80rpx;
margin: 2rpx 0 8rpx 0;
}
.oldPrice{
text-decoration: line-through;
color: #bbb;
font-size: 24rpx;
line-height: 32rpx;
margin: 8rpx 0 10rpx 0;
}
.tip{
width: 140rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
font-size: 24rpx;
color: #fff;
background: #F2D4A2;
border-radius: 200rpx;
}
}
}
</style>