<template>
	<view class="content">
		<view class="step">
			<uni-steps :options="[{title: '停车'}, {title: '检查'}, {title: '下单'}]" :active="stepIndex" active-color="rgb(255,0,0)"></uni-steps>
		</view>
		<view class="step-content">
			<!-- 停车 -->
			<view v-if="stepIndex===0" class="step-item step-one">
				<text>请确认车辆是否停到指定位置</text>
				<image src="../../static/img/step-one.png" mode="aspectFit"></image>
				
			</view>
			<!-- 检查 -->
			<view v-if="stepIndex===1" class="step-item step-two">
				<view class="item top">
					<text>-请完成以下操作-</text>
					<image src="../../static/img/cztis.png" mode="aspectFit"></image>
					<view class="care">
						注意：洗车过程中禁止移动车辆和上下车
					</view>
				</view>
				<view class="item bottom">
					<text>超高加装件不能清洗</text>
					<image src="../../static/img/zyts.png" mode="aspectFit"></image>
				</view>
			</view>
			<!-- 下单 -->
			<view v-if="stepIndex===2" class="step-item step-three">
				<view class="choose">
					<view class="title">
						请选择服务模式
					</view>
					<view class="list">
						<view :class="['item', serverIndex==index ?'avtive':'']" @click="chooseItem(index)" v-for="(item,index) in itemList" :key="index">
							<text>{{item.name}}</text>
							<text class="price">{{item.price}}</text>
						</view>
					</view>
				</view>
				<view class="choose-content">
					<view class="choose-item">
						<view class="item">
							<text>优惠卷</text>
							<view class="right">
								<u-icon name="gift" color="rgb(255,0,0)" size="32"></u-icon>
								<text class="coopon">9.8元洗车券（￥-9.8）</text>
								<u-icon name="arrow-right" color="rgb(255,0,0)" size="32"></u-icon>
							</view>
						</view>
						<view class="item phone">
							<text>手机号码</text>
							<view class="right">
								<text >18792703003</text>
							</view>
						</view>
					</view>
					<view class="read">
						<u-radio-group v-model="isRead">
							<u-radio shape="square" :disabled="isRead!='read'" name="read" active-color="red" icon-size="28" label-size="28">
								点击阅读并同意
								<text>无人洗车</text>
								<text>《注意事项及服务协议》</text>
							</u-radio>
						</u-radio-group>
					</view>
				</view>
			</view>
			<view class="step-footer">
				<button @click="nextStep" v-if="stepIndex!=2" type="warn">下一步</button>
				<view v-else class="pay">
					<text>合计：</text>
					<text class="amount">￥10:00</text>
					<view class="">
						<button type="warn">去付款</button>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import uniSteps from '@/components/uni-steps/uni-steps.vue'
	export default {
		components: {
			uniSteps
		},
		data() {
			return {
				stepIndex: 0, // 当前步奏下标
				serverIndex: 0, // 选择服务下标
				itemList: [ // 服务列表
					{
						id: 1,
						name: '极速快洗',
						price: 10
					},
					{
						id: 12,
						name: '精致洗',
						price: 20
					},
					{
						id: 13,
						name: '打蜡洗',
						price: 30
					}
				],
				isRead: '', // 是否同意协议
			}
		},
		onLoad(option) {
			
		},
		methods: {
			// 选择服务项目
			chooseItem(index) {
				this.serverIndex = index
			},
			// 下一步
			nextStep() {
				this.stepIndex = this.stepIndex===0 ? 1 : 2
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	page{
		height: 100%;
	}
	.content{
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		.step{
			padding: 40rpx 0;
		}
		.step-content{
			flex: 1;
			width: 100%;
			display: flex;
			flex-direction: column;
			.step-item{
				width: 100%;
				display: flex;
				flex-direction: column;
				align-items: center;
				flex: 1;
			}
			.step-one{
				text{
					color: #999;
					margin-top: 40rpx;
					margin-bottom: 15%;
				}
				image{
					width: 40%;
					height: 60%;
				}
				
			}
			.step-two{
				background-color: #F8F8F8;
				.item{
					background-color: #fff;
					width: 80%;
					height: 40%;
					display: flex;
					flex-direction: column;
					align-items: center;
					margin-top: 20rpx;
					padding-top: 20rpx;
					image{
						width: 80%;
						flex: 1;
					}
				}
				.top{
					text{
						color: #df928e;
						font-size: 24rpx;
						margin-bottom: 20rpx;
					}
					.care{
						padding: 10rpx 20rpx;
						background-color: #ff805b;
						border-radius: 30rpx;
						color: #fff;
						font-size: 24rpx;
						margin-bottom: 10rpx;
					}
				}
				.bottom{
					text{
						font-size: 24rpx;
						color: #333;
					}
				}
			}
			.step-three{
				.choose{
					width: 100%;
					height: auto;
					padding-bottom: 80rpx;
					display: flex;
					flex-direction: column;
					align-items: center;
					border-bottom: 1px solid #eee;
					.title{
						color: #666;
					}
					.list{
						width: 100%;
						display: flex;
						justify-content: space-around;
						.item{
							width: 28%;
							height: 180rpx;
							display: flex;
							flex-direction: column;
							align-items: center;
							justify-content: center;
							border: 1px solid #eee;
							border-radius: 30rpx;
							margin-top: 30rpx;
							color: #999;
						}
						.avtive{
							color: #333;
							border-color: rgb(255,0,0);
							.price{
								color: rgb(255,0,0);
							}
						}
					}
					
				}
				.choose-content{
					flex: 1;
					width: 100%;
					.choose-item{
						padding-left: 20rpx;
						width: 100%;
					}
					.item{
						width: 100%;
						height: 100rpx;
						display: flex;
						align-items: center;
						justify-content: space-between;
						border-bottom: 1px solid #eee;
						.coopon{
							color: rgb(255,0,0);
						}
					}
					.phone{
						border-bottom: none;
					}
					.read{
						width: 100%;
						border-top: 1px solid #eee;
						padding-top: 40rpx;
						display: flex;
						justify-content: center;
						text{
							color: #999;
						}
						text:last-child{
							color: #ff9ba5;
						}
					}
				}
			}
			.step-footer{
				width: 100%;
				height: 100rpx;
				background-color: #fff;
				.pay{
					padding-top: 20rpx;
					width: 100%;
					height: 100%;
					border-top: 1px solid #eee;
					display: flex;
					align-items: center;
					justify-content: flex-end;
					.amount{
						color: rgb(255,0,0);
						font-size: 36rpx;
						margin-right: 40rpx;
					}
					button{
						width: 200rpx;
					}
				}
			}
		}
		
	}
</style>
