<template>
	<view class="details_main">
		<view>
			<ren-dropdown-filter :filterData='filterData' :defaultIndex='defaultIndex' @ed='ed' @dateChange='dateChange'
				>
			</ren-dropdown-filter>

		</view>
		
		<view class="cost_all">
			<view class="date_range">
				{{start_date}}-{{end_date}}
			</view>
			<view class="balance">
				<view class="disburse balance_t">
					<view>支出</view>
					<view>{{expenditure}}</view>
				</view>
				<view class="top_up balance_t">
					<view>充值</view>
					<view>{{recharge}}</view>
				</view>
			</view>

		</view>
		
		<view class="mingxi_xq">
			<view class="mingxi">
				<view class="mingxi_time">
					<text>7月18日 周一</text>
					<text class="mingxi_yuer">-10</text>
				</view>
				<view >
					<text>扣费</text>
					<text class="mingxi_yuer2">余额：300.00</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue'
	import {getgetbalanceinfo} from '@/api/api.js'
	export default {
		components: {
			// RenDropdownFilter
		},
		data() {
			return {
				start_date: '2022/06/19',
				end_date: '2022/07/19',
				Date: false,
				value1:1,
				value2:0,
				patient_id: 15652,
				org_id:10265,
				expenditure:null,//支出
				recharge:null,//充值
				list:[],//流水
				filterData: [
					[{
						text: '一周',
						value: '0'
					}, {
						text: '一个月',
						value: 1
					}, {
						text: '三个月',
						value: 2
					}, {
						text: '六个月',
						value: 3
					}, {
						text: '一年',
						value: 4
					}],
					[{
						text: '全部',
						value: ''
					}, {
						text: '充值',
						value: 1
					}, {
						text: '扣费',
						value: 2
					}, {
						text: '退款',
						value: 3
					}, {
						text: '退费',
						value: 4
					}]
				],
				moeny:[{
						text: '全部',
						value: 0
					}, {
						text: '充值',
						value: 1
					}, {
						text: '扣费',
						value: 2
					}, {
						text: '退款',
						value: 3
					}, {
						text: '退费',
						value: 4
					}],
					
				
				defaultIndex: [0, 0]
			}
		},
		onLoad() {
			this.getbalanceinfos()
		},
		methods: {
			async getbalanceinfos(){
				let params={
					patient_id: 15652,
					org_id:10265,
					start_time:'2023-02-01',
					end_time:'2023-02-28'
				}
				let res=await getgetbalanceinfo(params)
				console.log('xxxxx',res.data.data);
				this.expenditure = res.data.data.expenditure
				this.recharge = res.data.data.recharge
				this.list = res.data.data.list
			},
			ed(res) {
				console.log(res)
			},
			dateChange(d) {
				uni.showToast({
					icon: 'none',
					title: d
				})
			}
		}
	};
</script>

<style lang="scss">
	@import url(./advance.css);

	.text {
		font-size: 12px;
		color: #666;
		margin-top: 5px;
	}

	.uni-px-5 {
		padding-left: 10px;
		padding-right: 10px;
	}

	.uni-pb-5 {
		padding-bottom: 10px;
	}
</style>
