<!-- 管理车辆 -->
<template>
	<view class="content">
		<view class="flex flex-space-between">
			<view>车牌号</view>
			<u--input placeholder="输入车牌号" inputAlign='right' border="none" v-model="carNumber"></u--input>
		</view>
		<view>上传人车合影（车头车牌号可见）</view>
		<u-button type="primary" @click="unloadGroupPhoto()">上传人车合影</u-button>
		<u-button type="primary" @click="submit">提交</u-button>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	import uploadImage from '@/components/ossutil/uploadFile.js';
	var _this;
	export default {
		data() {
			return {
				carNumber: '',
			};
		},
		onLoad(options) {
			_this = this;
			console.log(options)
		},
		methods: {
			unloadGroupPhoto() {
				uni.chooseImage({
					count: 1,
					success: function(res) {
						console.log(JSON.stringify(res.tempFilePaths));
						uploadImage(res.tempFilePaths[0], 'appData/',
							result => {
								// 上传成功
								console.log('图片地址', result)
							}
						)
					}
				});
			},
			submit(){
				let params = {
						type: 'success',
						message: "提交成功",
						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
					}
				this.$refs.uToast.show({...params})
			},
		},
	}
</script>

<style lang="scss" scoped>

</style>
