<template>
	<view class="distribution_my_income_list_page">
		<view class="page_content">
			<!-- 标签 -->
			<view class="jc-header-title bg-ff">
				<ty-tab-equally :active.sync="index" :list="nav_list" @click="tabChange" color="#2F97FF"></ty-tab-equally>
			</view>

			<!-- 统计数据 -->
			<view class="margin-top-title-header border-bottom-ed">
				<ty-block-statistics2 :list="statistics"></ty-block-statistics2>
			</view>

			<ty-list-list :status="load_status">
				<view v-for="(item, index) in list" :key="index">
					<view class="padding-left-30 bg-ff">
						<view class="padding-tb-30 padding-right-30 border-bottom-ed flex align-end justify-between">
							<view class="flex align-center flex-one">
								<image class="jc-avatar-70" :src="item.head_img" mode="aspectFill"></image>
								<view class="margin-left-20 flex-one">
									<view class="text-28 text-cut-one">
										<text class="text-nickname">{{item.nick_name}}</text>
										<text class="text-33">下单咨询</text>
									</view>
									<view class="margin-top-5 text-24 text-98">{{item.order_time}}</view>
								</view>
							</view>
							<view class="width-200 text-right">＋¥{{item.pay_money}}</view>
						</view>
					</view>
				</view>
			</ty-list-list>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				index: 0,
				nav_list: ['已到账', '在路上'],
				
				statistics:[{
					name:'收入总数',
					number:0
				},{
					name:'订单数',
					number:0
				}],
				data: {}, //统计数据

				load_status: '',
				list: {},
			}
		},

		onReady() {
			this.loadData();

			this.loadList(1);
		},

		onReachBottom() {
			this.loadList(0);
		},

		methods: {
			//标签栏切换
			tabChange(e) {
				this.loadData();
				this.loadList(1);
			},

			//加载列表
			loadList(first_page) {
				this.rq.getList('fire/api/Expert/expertIncomeList', {
					index: this.index
				}, {
					that: this,
					first_page
				})
			},

			//加载数据
			loadData() {
				this.rq.getData('fire/api/Expert/expertIncomeData', {
					index: this.index
				}).then(res => {
					if (res.code == 0) {
						this.statistics[0].number = res.data.total_money
						this.statistics[1].number = res.data.total_order
					}
				})
			},
		}
	}
</script>

<style scoped>
.distribution_my_income_list_page{
	width: 100vw;
	min-height: 100vh;
	background: #fff;
}
</style>
