<template>
	<view class="work-container">
		<!-- 轮播图 -->
		<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
			<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
				<swiper-item v-for="(item, index) in data" :key="index">
					<view class="swiper-item" @click="clickBannerItem(item)">
						<image :src="item.image" mode="aspectFill" :draggable="false" />
					</view>
				</swiper-item>
			</swiper>
		</uni-swiper-dot>

		<!-- 宫格组件 -->
		<uni-section class="uni-section" title="系统管理" type="line" @click="certification">
			<template v-slot:right>
				{{certificationStatus}}
			</template>
		</uni-section>
		<!-- <uni-section class="uni-section" title="系统管理" type="line"></uni-section> -->
		<view class="grid-body">
			<uni-grid :column="4" :showBorder="false">
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(0)">
						<uni-icons type="compose" size="30" color="#327DD7"></uni-icons>
						<text class="text">代办案件</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(1)">
						<uni-icons type="staff-filled" size="30" color="#327DD7"></uni-icons>
						<text class="text">代办案件</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(2)">
						<uni-icons type="color" size="30" color="#327DD7"></uni-icons>
						<text class="text">代理立案</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(3)">
						<uni-icons type="settings-filled" size="30" color="#327DD7"></uni-icons>
						<text class="text">代理案件进展</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(4)">
						<uni-icons type="heart-filled" size="30" color="#327DD7"></uni-icons>
						<text class="text">证据交换</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(5)">
						<uni-icons type="bars" size="30" color="#327DD7"></uni-icons>
						<text class="text">互联网庭</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(6)">
						<uni-icons type="gear-filled" size="30" color="#327DD7"></uni-icons>
						<text class="text">在线撤诉</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(7)">
						<uni-icons type="chat-filled" size="30" color="#327DD7"></uni-icons>
						<text class="text">笔录签字</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(8)">
						<uni-icons type="wallet-filled" size="30" color="#327DD7"></uni-icons>
						<text class="text">仲裁文书</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @tap="changeGrid(9)">
						<uni-icons type="wallet-filled" size="30" color="#327DD7"></uni-icons>
						<text class="text">法规政策</text>
					</view>
				</uni-grid-item>
			</uni-grid>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				swiperDotIndex: 0,
				data: [{
						image: 'https://img.tukuppt.com/bg_grid/00/09/96/qWJxN1umma.jpg!/fh/350'
					},
					{
						image: 'https://img.tukuppt.com/bg_grid/00/18/92/JBheZs7ZVK.jpg!/fh/350'
					},
					{
						image: 'https://img.tukuppt.com/bg_grid/00/81/07/DGEl4suqeV.jpg!/fh/350'
					}
				],
				certificationStatus: "未认证"
			}
		},
		methods: {
			clickBannerItem(item) {
				console.info(item)
			},
			changeSwiper(e) {
				this.current = e.detail.current
			},
			changeGrid(e) {
				this.$modal.showToast('模块建设中~')
				switch (e) {
					case 0:
						uni.navigateTo({
							url: ('/pages/handlecase/index')
						})
						break;
					default:
						break;
				}
			},
			// 点击实名认证
			certification() {
				uni.navigateTo({
					url: ('/pages/certification/index')
				})
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff;
		min-height: 100%;
		height: auto;
	}

	view {
		font-size: 14px;
		line-height: inherit;
	}

	/* #endif */

	.text {
		text-align: center;
		font-size: 26rpx;
		margin-top: 10rpx;
	}

	.grid-item-box {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
		;
	}

	.swiper {
		height: 300rpx;
	}

	.swiper-box {
		height: 150px;
	}

	.swiper-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: #fff;
		height: 300rpx;
		line-height: 300rpx;
	}

	.grid-body {
		// background-image: url('https://img.tukuppt.com/bg_grid/00/18/52/aEicoC2qMI.jpg!/fh/350');
		background-repeat: no-repeat;
		background-size: cover;
		height: 900rpx;
		// color: #fff;
		opacity: 0.9;
	}

	.uni-section {
		background-color: #b90404 !important;
		color: #fff;
	}

	/deep/ .uni-section__content-title {
		color: #fff !important;
	}

	@media screen and (min-width: 500px) {
		.uni-swiper-dot-box {
			width: 400px;
			/* #ifndef APP-NVUE */
			margin: 0 auto;
			/* #endif */
			margin-top: 8px;
		}

		.image {
			width: 100%;
		}
	}
</style>