<template>
	<view class="">
		<view class="headers">
			<u-icon name="camera-fill" color="#2979ff" size="80" @tap="upload()">
			</u-icon>
		</view>
		<u-form :model="form" ref="uForm" label-width="230">
			<u-form-item label="车牌号码">
				<u-input placeholder="填写车牌号码" v-model="form.licenseNo" type="text"></u-input>
			</u-form-item>
			<u-form-item label="联系人">
				<u-input placeholder="填写联系人" v-model="form.contactPerson" type="text"></u-input>
			</u-form-item>
			<u-form-item label="联系电话">
				<u-input placeholder="填写车架号" v-model="form.mobile" type="text"></u-input>
			</u-form-item>
			<u-form-item label="取送车地址">
				<u-input v-model="form.address" type="select" placeholder="选择取送车地址" @click="addressShow=true"></u-input>
			</u-form-item>
			<u-form-item label="详细地址" right-icon="map-fill">
				<u-input placeholder="填写详细地址" v-model="form.detailAddress" type="textarea" @click="mapchoice"></u-input>
			</u-form-item>
		</u-form>
		<view class="infoBottom dis j-c a-c">
			<u-button type="primary" style="width: 90%;font-weight: bold;border-radius: 40px;"
				@click="submit">提交</u-button>
		</view>
		<u-picker v-model="addressShow" mode="region" :params="params" @confirm='conform'
			:defaultRegion='defaultRegion'></u-picker>
	</view>
</template>
<script>
	import store from '@/store';
	export default {
		data() {
			return {
				addressShow: false,
				form: {
					licenseNo: "", //车牌号		
					contactPerson: "", //联系人	
					mobile: "", //电话	
					address: "", //地址
					detailAddress: "", //详细地址	
					id: "",
				},
				defaultRegion: ['山西省', '太原市', '小店区'],
				params: {
					province: true,
					city: true,
					area: true
				},
			}
		},
		onLoad(params) {
			if (!!params) {
				this.form.licenseNo = params.licenseNo;
				this.form.id = params.id;
			}
		},
		methods: {
			async submit() {
				let res = await this.$http.post('/ser/annualAuditOrder/addAnnualAuditOrder', this.form);
				if (res.code == '200') {

				}
			},
			conform(e) {
				this.form.address = e.province.label + '-' + e.city.label + '-' + e.area.label;
			},
			mapchoice() {
				uni.navigateTo({
					url: "/pages/caragent/map"
				})
			}
		}
	}
</script>

<style>
	.headers {
		width: 100%;
		height: auto;
		text-align: right;
	}

	page {
		padding: 36rpx;
		box-sizing: border-box;
	}

	.shanchu {
		width: 100%;
		text-align: center;
		color: #999;
		cursor: pointer;
	}

	/* 底部的样式Start */
	.infoBottom {
		height: 140upx;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 99;
	}
</style>