recharge.vue 1.7 KB
<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>