<template>
	<view class="container">
		<view class="page">
			<view class="property">
				<view class="user">
					<view class="name">{{userName}} {{userPhone}}</view>
					<view class="add">{{platformName}}</view>
				</view>
				<view class="screening">
					<!-- <view class="title"> -->
						<!-- <view class="picker on"> -->
							<picker @change="bindPickerChange" :value="year" :range="yearList">
								<view class="uni-input">{{yearList[index]}}<image src="../../static/images/icon_up.png" class="icon"></image></view>
							</picker>
						<!-- </view> -->
					<!-- </view> -->
					<view class="content">
						<view class="text">
							<view class="name">合计金额（元）</view>120
						</view>
						<view class="text">
							<view class="name">缴费单位</view>汉江之星物业公司
						</view>
					</view>
					<view class="bottom">2023年度物业费累计：220元</view>
				</view>
				<view class="statistical">
					<qiun-data-charts type="line" :chartData="chartData" :opts="opts" background="none" />
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	let chargeTypeCode = ''
	export default {
		data() {
			return {
				userName: '',
				userPhone: '',
				platformName: '',
				year: '',
				index: 0,
				yearList: ['全部', '2023年', '2022年', '2021年'],
				month: '',
				chartData: {
					categories: ["2023年", "2022年", "2021年"],
					series: [{
						"name": "费用统计",
						"data": [2000, 2050, 1000]
					}]
				},
				opts: {
					color: ["#6A59F2", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					],
					padding: [15, 10, 0, 15],
					enableScroll: false,
					legend: {},
					xAxis: {
						disableGrid: true
					},
					yAxis: {
						gridType: "dash",
						dashLength: 2
					},
					extra: {
						line: {
							type: "curve",
							width: 2,
							activeType: "hollow"
						}
					},
				}
			}
		},
		methods: {
			bindPickerChange: function(e) {
				this.index = e.detail.value
			},
			bindPickerChange1: function(e) {
				this.index1 = e.detail.value
			},
		},
		onLoad(option) {
			this.userName = uni.getStorageSync('user_name')
			this.userPhone = uni.getStorageSync('user_phone')
			this.platformName = uni.getStorageSync('platform_name')
			chargeTypeCode = option.code
			// this.getList()
		}
	}
</script>
<style>
	page {
		background-color: #F8F6F9;
	}
</style>
<style lang="scss" scoped>
	.page {
		padding: 30rpx;
	}

	.property {

		.user {
			background-position: top center;
			background-repeat: no-repeat;
			background-size: cover;
			background-image: url('https://life.cloud.hjxbc.cn/sys/common/static/miniapp/bg_cost.png');
			border-radius: 16rpx;
			padding: 40rpx;

			.name {
				font-size: 32rpx;
				color: #ffffff;
				margin-bottom: 20rpx;
			}

			.add {
				font-size: 28rpx;
				color: #D5DCFF;
			}
		}

		.screening {
			margin: 30rpx 0;
			background-color: #ffffff;
			border-radius: 16rpx;
			padding: 30rpx;

			.title {
				display: flex;

				// .picker {
				// 	display: flex;
				// 	align-items: center;

				// 	.uni-input {
				// 		font-size: 28rpx;
				// 		color: #373737;
				// 	}

				// 	.icon {
				// 		width: 20rpx;
				// 		height: 12rpx;
				// 		margin-left: 15rpx;
				// 	}
				// }
			}
			.uni-input {
				font-size: 28rpx;
				color: #373737;
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
			}

			.icon {
				width: 20rpx;
				height: 12rpx;
				margin-left: 15rpx;
			}

			.content {
				padding: 20rpx 0;
				margin: 30rpx 0;
				border-top: 1px solid #F0F0F2;
				border-bottom: 1px solid #F0F0F2;

				.text {
					display: flex;
					font-size: 28rpx;
					color: #373737;
					margin: 15rpx 0;

					.name {
						width: 230rpx;
						color: #9D9CA6;
					}
				}
			}

			.bottom {
				font-size: 28rpx;
				color: #6A59F2;
			}

		}

		.statistical {
			background-color: #ffffff;
			border-radius: 16rpx;
			padding: 30rpx 10rpx;
		}

	}
</style>