<template>
	<view class="running-water">
		<navbar :title="title[status]" leftClick @leftClick="leftClick" />
		
		<view class="tab-box">
			<view class="tab-box1" v-if="agentFlow && agentFlow.total">
				<uv-cell center border :title="item.title"
				v-for="(item, index) in agentFlow.records"
				:value="x[item.type] + item.money" :label="item.createTime" />
			</view>
			<view 
			style="padding: 100rpx 0;"
			v-else>
				<uv-empty 
				mode="history"
				textSize="28rpx"
				iconSize="100rpx"/>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title : ['余额记录','提现记录','佣金记录'],
				agentFlow : {
					total : 0,
					records : [
						{
							type : 0,
							money : 100,
							createTime : '2024-04-02 20:00',
							title : "佣金提现",
						},
						{
							type : 0,
							money : 100,
							createTime : '2024-04-02 20:00',
							title : "佣金提现",
						},
						{
							type : 0,
							money : 100,
							createTime : '2024-04-02 20:00',
							title : "佣金提现",
						},
					]
				},
				x : ['+', '-' , '-' , '+'],
				status : 0,
			}
		},
		onLoad(e) {
			this.status = e.status
		},
		methods: {
			leftClick() {		//返回钱包
				uni.navigateBack(-1)
			},
			getAgentFlow(){		//获取流水记录
				let type = this.status;
				this.$api('getAgentFlow', { type }, res => {
					if(res.code == 200){
						this.agentFlow = res.result
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.running-water{
	width: 750rpx;
	background: #F5F5F5;
	margin: 0 auto;
	min-height: 100vh;
	.tab-box{
		margin: 20rpx;
		background-color: #fff;
		border-radius: 20rpx;
		overflow: hidden;
	}
}
</style>
