recharge.vue
1.7 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
<template>
<view class="">
<view class="recharge_wrap" v-if="rechargeList.length>0">
<view class="recharge_single" v-for="(item, index) in rechargeList" :key="index">
<view class="layer_between">
<view class="recharge_title">{{ item.type == 1 ? '购买会员' : '添加分类' }}</view>
<view class="recharge_price">¥{{ item.total }}</view>
</view>
<view class="layer_between recharge_tips">
<view class=""></view>
<view class="">{{ item.createtime }}</view>
</view>
</view>
</view>
<!-- 暂无记录 -->
<view class="no_recharge" v-else>暂无充值记录</view>
</view>
</template>
<script>
import App from '../../App.vue';
export default {
data() {
return {
page: 1,
rechargeList: [],
isRecharge: true
};
},
methods: {
// 获取充值列表
getRechargeList() {
let url = '/api/member/money_log';
let params = {
page: this.page
};
App.post(url, params).then(res => {
this.rechargeList = [...this.rechargeList, ...res.list];
if (res.list.length > 0) {
this.page++;
}
});
}
},
onLoad() {
// 获取充值列表
this.getRechargeList();
},
// 下拉加载
onPullDownRefresh() {
this.getRechargeList();
}
};
</script>
<style>
page {
background-color: #f9f9f9;
}
.recharge_single {
padding: 30upx;
background-color: #fff;
border-bottom: 1upx solid #f9f9f9;
}
.recharge_title {
color: #3d444d;
font-size: 28upx;
}
.recharge_price {
color: #ff7000;
font-size: 28upx;
}
.recharge_tips {
color: #8c9198;
font-size: 24upx;
margin-top: 20upx;
}
/* 暂无充值记录 */
.no_recharge {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
}
</style>