<template>
	<view class="navs">
		<view class="navBgm">
			<img class="left" src="https://www.jiubaotongxue.love/image/nav10.png" alt=""  @click="demos"/>
		绑定车辆
		</view>
	</view>
	<view class="addchepai">
		<chepai @numString="numString" :chuanzi='chuanzi'></chepai>
	</view>
	<view class="explain" v-if="isShows===0">
	
		<view class="explain-box" scroll-y="true">
	
			<view class="explain-box-title">
				温馨提示
			</view>
			<scroll-view class="explain-box-body">
				<text class="txt">
					{{addSuccess}}
				</text>
			</scroll-view>
			<view class="explain-btn" @click="btns">
				确定
			</view>
		</view>
	
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import {onLoad} from '@dcloudio/uni-app'
	import {addChepai}from '../../stor/addChepai/addChepai.js'
import { storeToRefs } from 'pinia';
	
	const ac =addChepai()
	const titles = ref('添加车牌')
	const bgcolor = ref('#fff')
	const color = ref('#000')
	const chepais = ref(null)
	const isShows = ref(1)
	const {addSuccess} =storeToRefs(ac)
		const chuanzi = ref([{
				id: 1,
				as: ""
			},
			{
				id: 2,
				as: ""
			},
			{
				id: 3,
				as: ""
			},
			{
				id: 4,
				as: ""
			},
			{
				id: 5,
				as: ""
			},
			{
				id: 6,
				as: ""
			},
			{
				id: 7,
				as: ""
			},
			{
				id: 8,
				as: ""
			}
		])
	const numString = (val)=>{
		isShows.value=0
		chepais.value =val
		console.log(chepais.value);
		ac.gerCarRes(val)
	}
	const btns = ()=>{
		uni.navigateBack()
	}
	const demos = ()=>{
		uni.navigateBack()
	}
</script>

<style lang="scss">
	.navs{
		width: 750rpx;
		height: 364rpx;
		position: fixed;
		top: 0rpx;
		background-image: url("https://www.jiubaotongxue.love/image/demo21.png");
		z-index: 1;
		.navBgm{
			width: 100%;
			height: 100rpx;
			// background-color: red;
			margin-top: 77rpx;
			text-align: center;
			line-height: 100rpx;
			position: relative;
			font-weight: 500;
			font-size: 36rpx;
			color: #000000;

			.left{
				position: absolute;
				z-index: 100;
				top: 50%;
				left: 30rpx;
				transform: translateY(-50%);
				width: 50rpx;
				height: 50rpx;
			}
		}
	}
	.addchepai{
		width: 100%;
		height: 100%;
		position: absolute;
	}
	.explain {
		position: fixed;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.2);
		z-index: 10;
	
		.explain-box {
			width: 630rpx;
			height: 350rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
	
			.explain-box-title {
				width: 100%;
				height: 100rpx;
				line-height: 100rpx;
				text-align: center;
				font-size:32rpx;
				box-sizing: border-box;
				padding-top: 30rpx;
				font-weight: 700;
				
			}
	
			.explain-box-body {
				width: 80%;
				height: 100rpx;
				margin-left: 50%;
				transform: translateX(-50%);
				text-align: center;
				line-height: 100rpx;
				box-sizing: border-box;
				padding-top: 10rpx;
	
				.txt {
					display: block;
					width: 100%;
					font-size:32rpx;
					word-wrap: break-word;
					color: #666;
				}
			}
			.explain-btn{
				width: 100%;
				height: 108rpx;
				border-top:1rpx solid #ccc;
				text-align: center;
				position: relative;
				margin-left: 50%;
				transform: translateX(-50%);
				line-height: 108rpx;
				margin-top: 40rpx;
				color: #1378F7;
			}
		}
	}

</style>
