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
<template>
<div class="all-income">
<template v-if="incomeList.length > 0">
<div v-for="item in incomeList" :key="item.id" class="list-item">
<span style="color:#333333">{{ item.yearMonth }}</span>
<span>{{ item.income }}</span>
</div>
</template>
<p v-else class="no-data">
暂无数据~
</p>
</div>
</template>
<script>
import { showIncomeRecord } from "@/api/wallet";
export default {
name: "AllIncome",
data() {
return {
incomeList: []
};
},
mounted() {
this.getAllRecord();
},
methods: {
getAllRecord() {
const params = {
userId: JSON.parse(localStorage.getItem("user")).userId
};
showIncomeRecord(params).then(res => {
if (res.code === 0) {
this.incomeList = res.data;
}
});
}
}
};
</script>
<style lang="scss" scoped>
.all-income {
box-sizing: border-box;
padding: 10px 16px;
}
.list-item {
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
height: 50px;
margin-bottom: 10px;
padding: 0 15px;
font-size: 16px;
background-color: #ffffff;
}
.no-data {
text-align: center;
font-size: 12px;
}
</style>