<template>
	<view class="home-page">
		<!-- <view class="status_bar">
		</view> -->
		<view class="banner">
			<view class="search-block">
				<image class="icon-search" src="../../static/image/search@3x.png" mode=""></image>
				<text>搜索</text>
			</view>
			<uni-swiper-dot :info="info" :current="current" field="content" :dotsStyles="dotsStyles" :mode="mode">
				<swiper class="swiper-box" @change="change" autoplay='true' interval='7000'>
					<swiper-item v-for="(item ,index) in info" :key="index">
						<view class="swiper-item">
							<image class="swiper-item-img" src="../../static/image/banner@3x.png" mode="widthFix">
							</image>
						</view>
					</swiper-item>
				</swiper>
			</uni-swiper-dot>
		</view>
		<view class="content">
			<!-- <view class="amount-block">
				<view class="order-amount">
					<view class="order-amount--wrapper">
						<text class="order-amount--des">本年订单金额</text>
						<text class="order-amount--num">50.000</text>
					</view>
				</view>
				<view class="order-amount bill-amount">
					<view class="order-amount--wrapper">
						<text class="order-amount--des">本年订单金额</text>
						<text class="order-amount--num">50.000</text>
					</view>
				</view>
			</view> -->
			<view class="notice-block block">
				<image class="icon-notic" src="../../static/image/notice@3x.png" mode=""></image>
				<uni-notice-bar single="true" showGetMore="false" backgroundColor='#feebe6' color="#333"
					:text="noticeContent">
				</uni-notice-bar>
			</view>
			<view class="todo-box block">
				<text class="title">待办</text>
				<view class="cell-list">
					<view class="cell-list-block">
						<image class="icon-address" src="@/static/image/uc_address@3x.png" mode="aspectFit"></image>
						<view class="cell-list-block__content">
							<text class="cell-list-block__title">打款500,000.00 ，请确认用途</text>
							<text class="cell-list-block__desc">3月27日 14:00</text>
						</view>
						<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
					</view>
					<view class="cell-list-block">
						<image class="icon-address" src="@/static/image/uc_setting@3x.png" mode="aspectFit"></image>
						<view class="cell-list-block__content">
							<text class="cell-list-block__title">打款500,000.00 ，请确认用途</text>
							<text class="cell-list-block__desc">3月27日 14:00</text>
						</view>
						<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode="aspectFit"></image>
					</view>
				</view>
			</view>
			<view class="charts-box block">
				<view class="title">
					<text class="title-text">订单执行情况</text>
					<view class="summary">
						<text class="num">40</text>万
					</view>
				</view>
				<qiun-data-charts type="column" :chartData="chartData" :opts="uchartOpts" :ontouch="true"
					background="none" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: [{
					content: '内容 A'
				}, {
					content: '内容 B'
				}, {
					content: '内容 C'
				}],
				current: 0,
				mode: 'round',
				noticeContent: '9.10日，21:00-24:00系统升级，系统停止服务',
				dotsStyles: {
					width: 9,
					bottom: 8,
					color: '#FF1D32',
					backgroundColor: '#E6E6E6',
					border: 'none',
					selectedBackgroundColor: '#FF1D32',
					selectedBorder: 'none'
				},
				uchartOpts: {
					padding: [0, 0, 0, 0],
					color: ['#FDB95A', '#528FF4', '#FF7282','#C38AFF','#FFD600'],
					enableScroll: true,
					xAxis: {
						itemCount: 4,
						disableGrid: true
					},
					yAxis: {
						"dashLength": 20,
					},
					legend: {
						"position": "bottom",
						"float": "left",
						margin: 20
					},
					extra: {
						column: {
							categoryGap: 7
						}
					}
				},
				chartData: {
					"categories": [
						"1618",
						"七代",
						"八代",
						"定制",
						"经典"
					],
					"series": [{
							"name": "购买数量(件)",
							"data": [
								35,
								36,
								31,
								33,
								13,
								34
							]
						},
						{
							"name": "订单金(万)",
							"data": [
								18,
								27,
								21,
								24,
								6,
								28
							]
						},
						{
							"name": "开票(万)",
							"data": [
								28,
								17,
								11,
								14,
								16,
								18
							]
						},
						{
							"name": "发货",
							"data": [
								28,
								17,
								11,
								14,
								16,
								18
							]
						},
						{
							"name": "到货",
							"data": [
								28,
								17,
								11,
								14,
								16,
								18
							]
						}
					]
				},
			}
		},
		methods: {
			change(e) {
				this.current = e.detail.current;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.home-page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #f2f6f7;
		padding-bottom: 100rpx;
	}

	.status_bar {
		height: var(--status-bar-height);
	}

	.banner {
		position: relative;
		width: 100%;
		height: 480rpx;
		overflow: hidden;
	}

	.search-block {
		display: flex;
		align-items: center;
		position: absolute;
		width: calc(100% - 32px);
		height: 30px;
		left: 16px;
		top: var(--status-bar-height);
		z-index: 10;
		background-color: rgba(255, 255, 255, 0.2);
		border-radius: 16px;
		padding-left: 33px;
		font-size: 13px;
		color: rgba(255, 255, 255, 0.6);

		.icon-search {
			position: absolute;
			left: 13px;
			width: 14px;
			height: 14px;
		}
	}

	.swiper-item {
		height: 480rpx;
	}

	/deep/ .uni-swiper__warp {
		height: 100%;

		.swiper-box {
			height: 100%;
		}

		.uni-swiper__dots-item {
			border-radius: 2px;
			width: 9px !important;
			height: 3px !important;
		}

		.uni-swiper__dots-item:first-child {
			border-radius: 2px;
			width: 3px !important;
			height: 3px !important;
		}

		.uni-swiper__dots-item:last-child {
			border-radius: 2px;
			width: 3px !important;
			height: 3px !important;
		}

		.uni-swiper__dots-long {
			width: 9px !important;
		}
	}

	.swiper-item-img {
		width: 100%;
		height: 100%;
	}

	.content {
		flex: 1;
		width: 100%;
		padding: 32rpx 36rpx 24px;
		box-sizing: border-box;
		background: #ffffff;
		border-radius: 32rpx 32rpx 0px 0px;
		margin-top: -80rpx;
	}

	.block {
		background: #ffffff;
		overflow: hidden;

		.title {
			display: inline-block;
			font-size: 14px;
			color: #333;
			font-weight: 600;
			margin-bottom: 24rpx;
		}
	}

	.amount-block {
		display: flex;
		flex-direction: row;
		margin-top: 8px;
		margin-bottom: 8px;
	}

	.order-amount {
		flex: 1;
		background: url('~@/static/image/home_order_bg@3x.png') no-repeat;
		background-size: 100% 100%;
		height: 70px;
		border-radius: 4px;
		padding-top: 8px;
		padding-left: 20px;
		margin-right: 8px;
	}

	.order-amount--wrapper {
		display: flex;
		flex-direction: column;
	}

	.order-amount--des {
		font-size: 14px;
		color: #fff;
		margin-bottom: 2px;
	}

	.order-amount--num {
		font-size: 20px;
		color: #fff;
		font-weight: 500;
	}

	.bill-amount {
		background: url('~@/static/image/home_bill_bg@3x.png') no-repeat;
		background-size: 100% 100%;
		margin-right: 0;

	}

	.notice-block {
		position: relative;
		height: 39px;
		margin-bottom: 16px;
		background: #feebe6;
		border-radius: 40rpx;
	}

	.icon-notic {
		position: absolute;
		left: 8px;
		top: 50%;
		margin-top: -10px;
		z-index: 10;
		width: 20px;
		height: 20px;
	}

	.uni-noticebar {
		margin-bottom: 0;
		height: 39px;
		padding-left: 36px;
	}

	.todo-box {
		margin-bottom: 64rpx;
	}

	.cell-list {
		flex-direction: column;

		.cell-list-block {
			display: flex;
			height: 77px;
			margin-bottom: 24rpx;
			background: #f8f9fa;
			border-radius: 8px;
			padding: 0 32rpx 0 24rpx;
			align-items: center;
		}

		.icon-address {
			width: 88rpx;
			height: 88rpx;
			margin-right: 24rpx;
		}

		.cell-list-block__content {
			display: flex;
			flex: 1;
			flex-direction: column;
		}

		.cell-list-block__title {
			color: #333;
			font-size: 28rpx;
			font-weight: 500;
			flex: 1;
			align-items: center;
		}

		.cell-list-block__desc {
			color: #acacac;
			font-size: 12px;
		}

		.icon-arrow {
			width: 18rpx;
			height: 32rpx;
		}
	}

	.charts-box {
		height: 380px;
		padding-bottom: 40px;

		.title {
			margin-bottom: 32rpx;
			display: flex;
			justify-content: space-between;
			.summary{
				color: #B2B2B2;
				font-size: 36rpx;
				.num{
					color: #333333;
					margin-right: 8rpx;
				}
			}
		}
	}
</style>
