<template>
	<view class="total-page page-env-160 page-box">
		<Nav :title="'工作台导航'" :back="false" :is_fixed="true" :opacity="scrollTop" :justify="'left'" :color="'#fff'">
			<view class="p-20">
				<IndexPersonal ref="memberObj" @setMemberData="setMemberData"></IndexPersonal>
				<!-- <IndexColumn ref="columnObj" :memberData="memberData" :model-time="modelTime"></IndexColumn> -->
			</view>
		</Nav>
		<view class="p-20">
			<view class="personal m-lr10 row-justify-sb center">
				<text class="sys-weight-600">我的待办</text>
				<view class="row-justify-sb center">
					<view class="personal_text">
						<uni-datetime-picker type="date">
							<view class="personal sys-background-fff size-24 sys-weight-600 p-lr30 r-40">{{indexTime}}
							</view>
						</uni-datetime-picker>
					</view>
				</view>
			</view>
		</view>
		<TaskItem :type="5" :taskList="backlogList" @heartBut="heartBut"></TaskItem>
		<Tab class="tabs_height" :tab-index="0"></Tab>
	</view>

</template>
<script>
	import TaskItem from "@/common/task/task-item.vue"
	import PieChart from "@/common/chart/pie_chart.vue"
	import CircleChart from "@/common/chart/circle_chart.vue"
	// 个人信息
	import IndexColumn from "./module/index_column.vue"
	// 顶部栏目
	import IndexPersonal from "./module/index_personal.vue"
	import {
		getDateBacklogStatistics,
		getDayBacklogList
	} from "@/api/task";
	import {
		date
	} from "@/uni_modules/uv-ui-tools/libs/function/test";

	export default {
		components: {
			TaskItem,
			PieChart,
			CircleChart,
			IndexColumn,
			IndexPersonal
		},
		data() {
			return {
				modelTime: this.$tools.getDate('-'),
				indexTime: this.$tools.getDate('-'),
				is_admin: false,
				scrollTop: 0,
				topNavHeight: 0,
				chartList: [{
					name: "超期",
					color: '#DE5847',
					value: "0"
				}, {
					name: "滞后",
					color: '#EF8F27',
					value: "0"
				}, {
					name: "正常",
					color: '#3ABF7D',
					value: "0"
				}, ],
				memberData: {
					draftNum: 0,
					creditNum: 0,
					noticeNum: 0,
					take_num: 0,
					unreadNum: 0,
				},
				statisticsData: {
					endNum: 0,
					exceedDate: 0,
					lagDate: 0,
					totalNum: 0,
				},
				backlogList: [],
				weekData: [],
				weekNum: 1,
				dayNum: 0,
				day: '',
				month: '',
				page: 1,
				isAjax: false,
				total: null
			}
		},
		watch: {},
		onLoad() {},
		onShow() {},
		onPageScroll(res) {
			this.scrollTop = res.scrollTop / 120
		},
		mounted() {
			this.backlogListData()
		},
		onReachBottom() {},
		methods: {
			heartBut(data) {
				if (data) {
					this.backlogList.forEach((i, k) => {
						if (i.id === data.id) {
							i.live = !i.live
						}
					})
					console.log(this.backlogList, '1111111111111');
				}
			},
			backlogListData() {
				let data = uni.getStorageSync('backlogList')
				if (data) {
					this.backlogList = data
				} else {
					this.backlogList = [{
							img: 'https://copyright.bdstatic.com/vcg/creative/d6c6a351be227d5d3b3e8c1f96f56e50.jpg@h_1280',
							proportion: '37',
							name: 'Downtown Office Tower -Prime Location',
							live: false,
							percentage: '3.1',
							description: 'Metro Properties LLC',
							amount: '5.0',
							trend: '7.5',
							risk: 'LTV 37%',
							time: '2024-001',
							id: 1,
						},
						{
							img: 'https://pic.rmb.bdstatic.com/bjh/3ea195479f8a/250303/f53064611fee7c092312f3b6ea8e439d.jpeg',
							proportion: '71',
							name: 'Tower -Prime Location',
							live: false,
							percentage: '5.1',
							description: 'Healthcare Properties Inc',
							amount: '5.0',
							trend: '7.5',
							risk: 'LTV 37%',
							time: '2024-001',
							id: 2,
						}
					]
					uni.setStorageSync('backlogList', this.backlogList)
				}
			}
		},
	}
</script>
<style lang="scss" scoped>
	.personal {
		height: 55rpx;
		line-height: 55rpx;
	}

	.pie_chart {
		width: 135px
	}

	.circle_chart {
		width: 135px;
		padding-top: 20rpx;
	}

	.chart_dot {
		width: 16rpx;
		height: 16rpx;
		border-radius: 50%;
	}
</style>