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
<template>
<div class="card-item">
<img src="../assets/images/card-item-bg.png" class="bg"/>
<div class="card-item-content">
<div class="card-item-table">
<div class="card-item-cell price" v-if="data.voucherType === '2'">
<div class="label">免费</div>
<div class="des">价值{{data.cost}}元</div>
</div>
<div class="card-item-cell price" v-else>
<div class="label">{{data.cost}}<span class="unit">元</span></div>
<div class="des">{{data.voucherType === '1' ? '提醒券' : data.voucherType === '2' ? '健康券' : data.voucherType === '3' ? '代金券' : ''}}</div>
</div>
<div class="card-item-cell info">
<div class="title">{{data.voucherName}}</div>
<p>类型:{{data.categoryName}}</p>
<p>机构:{{data.deptName}}</p>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'CardItem',
data () {
return {
}
},
props: ['data'],
created () {
},
mounted: function () {
},
computed: {
},
methods: {
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.card-item {
position: relative;
margin-bottom: 0.6em;
}
.card-item > .bg {
width: 100%;
}
.card-item > .card-item-content{
position: absolute;
right: 0;
left:0;
top:0;
bottom: 0;
}
.card-item > .card-item-content > .card-item-table {
display: table;
width: 100%;
height: 100%;
font-size: 1em;
}
.card-item > .card-item-content > .card-item-table > .card-item-cell {
display: table-cell;
vertical-align: middle;
}
.card-item > .card-item-content > .card-item-table > .price{
width: 30%;
color:#43d1be;
text-align:center;
}
.card-item > .card-item-content > .card-item-table > .price .label {
font-size: 2em;
font-weight: bold;
color:#43d1be;
padding: 0;
}
.card-item > .card-item-content > .card-item-table > .price .label > .unit {
font-size:40%;
font-weight:normal;
}
.card-item > .card-item-content > .card-item-table > .price > .des {
font-size: 1em;
margin-top: 8px;
}
.card-item > .card-item-content > .card-item-table > .info {
width:70%;
color:#35444f;
padding-left:1em;
position:relative;
font-size: 0.9em;
}
.card-item > .card-item-content > .card-item-table > .info p {
margin-bottom: 0;
/* display: inline-block;
white-space: nowrap;
overflow: hidden;
width: 13em; */
}
.card-item > .card-item-content > .card-item-table > .info .title{
font-size: 1.3em;
font-weight:bold;
/* margin-bottom:0.5em; */
margin-bottom: 0;
white-space: nowrap;
max-width: 13.2em;
overflow: hidden;
}
</style>