<template>
	<div>
		<custom-header :back="false" title="申办校验"></custom-header>
		<div style="padding: 20rpx 0">
			<u-button type="primary">月落</u-button>
			<u-upload :customBtn="true" action="#" ref='uploadRef' :auto-upload="false" max-count='1' :max-size="2 * 1024 * 1024">
				<template v-slot:addBtn>
					<u-image width="75rpx" height="90rpx"
						src="http://192.168.100.63:8087/default-bucket//image/applyCard/renxiang.png"></u-image>
				</template>

			</u-upload>
			<!-- 			<form-builder-vue :formData="formData" :config="config" @submit="submit"
				@bindPickerChange='bindPickerChange'></form-builder-vue> -->

		</div>
	</div>
</template>
<script setup lang='ts'>
	import CustomHeader from '@/components/CustomHeader.vue';
	import formBuilderVue from '@/components/form-builder/form-builder-vue3'
	import {
		reactive,
		ref
	} from 'vue'
	import {
		onLoad
	} from '@dcloudio/uni-app'
	// import {
	// 	request
	// } from '../../static/js/network/request'
	//获取页面配置
	let uploadRef = ref(null)
	onLoad((opin) => {
		// 获取页面配置
		// request('ac8756cc31eb4816b8eaeb71907ff9c1', {
		// 	data: {
		// 		qdOrderNo: 'qddd123456'
		// 	}
		// }).then((res) => {
		// 	let data = JSON.parse(res.bizContent)
		// 	// 处理数据
		// 	let tableConfig = JSON.parse(data.config.tableConfig)
		// 	tableConfig.forEach(item => {
		// 		if (item.type === "4") {
		// 			let itemData = item.itemData
		// 			if (itemData) {
		// 				item.itemData = JSON.parse(itemData)
		// 			}
		// 		}
		// 	})

		// 	formData.value = tableConfig
		// 	console.log('输出内容', formData.value, data)
		// 	jumpPage.value = data.jumpPage

		// })
	})
	const jumpPage = ref('')
	let config = ({
		titleWidth: 160,
		submitName: '下一步'
	})

	let formData = ref([{
		'title': '车牌号',
		'titleShow': true,
		'type': 9,
		'vertical': 2,
		'value': 'vehiclePlate',
		'itemKey': 'name',
		'required': false,
		'itemData': []
	}, {
		'title': '车牌颜色',
		'titleShow': true,
		'type': 13,
		'vertical': 2,
		'value': 'vehicleColor',
		'itemKey': 'name',
		'required': false,
		'itemData': []
	}, {
		'title': '手机号',
		'titleShow': true,
		'type': 2,
		'inputType': 'tel',
		'value': 'tel',
		'required': false,
		'maxlength': 11
	}, {
		'title': '车辆类型',
		'titleShow': true,
		'type': 4,
		'required': false,
		'value': 'vehicleKind',
		'itemKey': 'name',
		'itemData': []
	}])

	// //车辆颜色 Index('车牌颜色', formData)
	// getLicensePlateColor(2, (res: any) => {
	// 	formData[Index('车牌颜色', formData)].itemData = res
	// })

	// //车型
	// getLicensePlateColor(3, (res: any) => {
	// 	formData[Index('车辆类型', formData)].itemData = res
	// })
	const bindPickerChange = () => {
		console.log(formData.value)
	}
	//提交
	function submit(item: any) {
		// uni.navigateTo({
		// 	url: jumpPage.value||"pages/userInfoUploading/userInfoUploading",
		// 	animationType: 'pop-in',
		// 	animationDuration: 500
		// })
		uni.navigateTo({
			url: "/pages/mailingAddress/mailingAddress",
			animationType: 'pop-in',
			animationDuration: 500
		})
	}
</script>
<style lang='scss' scoped>
	.slot-btn {
		width: 329rpx;
		height: 140rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background: rgb(244, 245, 246);
		border-radius: 10rpx;
	}

	.slot-btn__hover {
		background-color: rgb(235, 236, 238);
	}
</style>