HistoryList.vue
2.54 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
<template>
<v-card id="HistoryList" flat >
<v-list class="list">
<v-list-tile class="ListItem ListHeader">
<v-list-tile-content class="ListItemCell">{{type === 'borrow' ? '出借人' : '借款人'}}</v-list-tile-content>
<v-list-tile-content class="ListItemCell">借款金额</v-list-tile-content>
<v-list-tile-content class="ListItemCell">时间</v-list-tile-content>
<v-list-tile-content class="ListItemCell">状态</v-list-tile-content>
</v-list-tile>
<v-list-tile class="ListItem" v-for="(item, index) in list" :key="index">
<v-list-tile-content class="ListItemAvatar ListItemCell">
<img v-if="item.avatar" :src="item.avatar" alt="" />
<i v-if="!item.avatar" class="material-icons icon iconfont icon-face"></i>
<span>{{item.name}}</span>
</v-list-tile-content>
<v-list-tile-content class="ListItemCell">{{item.amount}}</v-list-tile-content>
<v-list-tile-content class="ListItemCell">{{item.time}}</v-list-tile-content>
<v-list-tile-content class="ListItemCell">{{item.status}}</v-list-tile-content>
</v-list-tile>
</v-list>
<div v-if="!list.length" class="emptyImg">
<img src="/listBG.png" alt="">
</div>
</v-card>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: ()=>([])
},
type: {
type: String,
default: () => ('borrow')
}
}
}
</script>
<style lang="scss" scoped>
#HistoryList {
width: 100vw;
.list {
background-color: $toolbar-grey;
padding: 0;
.ListHeader {
border-top: 1px solid #979797;
}
.ListItem {
height: 2rem;
border-bottom: 1px solid #979797;
/deep/ .list__tile {
height: 2rem;
color: $light-gold;
padding: 0;
.ListItemCell {
align-items: center;
width: 25%;
}
}
.ListItemAvatar {
flex-direction: row;
height: 2rem;
align-items: center;
span {
height: 2rem;
line-height: 2rem;
margin-left: 0.3rem;
}
img {
height: 80%;
display: block
}
i {
color: $light-gold;
}
}
}
}
.emptyImg {
background-color: $background-black;
width: 100vw;
padding: 2.4rem 0 0 0;
img {
width: 8.2rem;
display: block;
margin: auto;
}
}
}
</style>