HistoryList.vue
4.73 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
169
170
171
172
173
174
175
176
177
178
179
180
181
<template>
<v-flex id="HistoryList">
<v-card v-for="(item, index) in list" :key="index" class="infoCards" flat height="6rem" @click.native='$router.push(`/borrowContent?id=${item.id}`)'>
<v-card-title class="infoCardsTitle" >
<div class="infoCardsAvatar">
<img v-if="item.avatar" :src="item.avatar" alt="" />
<i v-if="!item.avatar" class="material-icons icon iconfont icon-face"></i>
</div>
<div class="infoCardsName">{{item.target ? item.target.name : item.targetName}}</div>
<div class="infoCardsTitleButton" :class="setStyle(item.status)">{{item.status}}</div>
<div class="infoCardsCornerMark" v-if="item.status === '已生效'">
<div class="infoCardsCornerMarkString">剩余{{item.timeRemain}}天</div>
</div>
</v-card-title>
<v-card-text class="infoCardsContent" >
<div class="infoCardsContentBlock amount">
<div class="infoCardsContentKey">筹款金额</div>
<div class="infoCardsContentValue">{{item.amount}}元</div>
</div>
<div class="infoCardsContentBlock time">
<div class="infoCardsContentKey">借款时长</div>
<div class="infoCardsContentValue">{{item.duration}}天</div>
</div>
<div class="infoCardsContentBlock rate">
<div class="infoCardsContentKey">年利率</div>
<div class="infoCardsContentValue">{{item.rate * 100}}%</div>
</div>
</v-card-text>
</v-card>
<div v-if="!list.length" class="emptyImg">
<img src="/netiou/listBG.png" alt="">
</div>
</v-flex>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: ()=>([])
},
},
methods: {
setStyle(status) {
switch (status) {
case '未发起':
return 'notInitiated'
break
case '待确认':
return 'toBeConfirmed'
break
case '已驳回':
return 'dismissed'
break
default:
return 'toBeConfirmed'
break
}
}
}
}
</script>
<style lang="scss" scoped>
#HistoryList {
width: 100vw;
padding: 0 4vw;
overflow: auto;
height: 50vh;
margin-top: 1.5rem;
.infoCards {
background-color: #fff;
color: #000;
border-radius: 2px;
margin-bottom: 1rem;
position: relative;
overflow:hidden;
.infoCardsTitle {
padding:0.5rem 1.3rem 0.2rem 1.3rem;
.infoCardsAvatar {
width: 2.5rem;
height: 2.5rem;
border-radius: 1.3rem;
overflow:hidden;
img {
width: 100%;
vertical-align: bottom;
}
.icon {
color: $avatar-grey;
font-size: 2.5rem;
}
}
.infoCardsName {
margin-left: 0.8rem;
font-size: 16px;
}
.infoCardsTitleButton {
width: 3.2rem;
height: 1.2rem;
line-height: 1.35rem;
font-size: 10px;
text-align: center;
background-image: linear-gradient(-229deg, #DAB269 37%, #E7C78C 87%);
border-radius: 32px;
margin-left: 0.9rem;
&.notInitiated {
background-image: linear-gradient(-229deg, #444 37%, #aaa 87%);
color: #fff;
}
&.dismissed {
background-image: linear-gradient(-229deg, #ff3434 37%, #ff6060 87%);
color: #fff;
}
}
.infoCardsCornerMark {
font-size: 10px;
width: 6rem;
height: 2.8rem;
background-image: linear-gradient(-229deg, #DAB269 37%, #E7C78C 87%);
border-radius: 26px;
position: absolute;
top: -1.6rem;
right: -1rem;
z-index: 1;
.infoCardsCornerMarkString {
position: absolute;
bottom: 0;
left: 1rem;
}
}
}
.infoCardsContent {
width: 100%;
padding: 0;
.infoCardsContentBlock {
width: 33%;
display: inline-block;
text-align: center;
.infoCardsContentKey {
font-size: 0.8rem;
color: #898989;
}
.infoCardsContentValue {
font-size: 0.8rem;
color: $gold;
margin: auto;
}
}
}
}
}
.emptyImg {
background-color: $background-black;
width: 100%;
height: 50vh;
padding: 2.4rem 0 0 0;
img {
width: 8.2rem;
display: block;
margin: auto;
}
}
</style>