<template>
	<view style="padding: 0 32upx;">
		 <van-field
		    :value="name"
		    placeholder="请输入酒店名称"
		    label="酒店名称"
		  />
		<van-field
		   :value="name"
		   placeholder="请输入酒店地址"
		   label="酒店地址"
		 />
		 <van-field
		    :value="name"
		    placeholder="请输入负责人姓名"
		    label="负责人"
		  />
		  <van-field
		     :value="name"
		     placeholder="请输入负责人手机号码"
		     label="手机号码"
		   />
		 <van-field
		    :value="name"
		    placeholder="请输入负责人身份证号码"
		    label="身份证号码"
		  />
		 
		   
		<view>
				<view class="cell-pd">
					<view class="uni-uploader">
						<view class="uni-uploader-body">
							<view class="uni-uploader__files">
								<block v-for="(image,index) in imageList" :key="index">
									<view class="uni-uploader__file">
										<image class="uni-uploader__img" :src="image" :data-src="image" @tap="previewImage"></image>
									</view>
								</block>
								<view class="uni-uploader__input-box deepHeight">
									<view class="uni-uploader__input" @tap="chooseImage"></view>
								</view>
							</view>
						</view>
					</view>
				</view>
				 <view>须上传营业执照和手持身份证照</view>
		</view>
		<view class="submitRemin">申请入驻</view>
		   
	</view>
</template>

<script>
	export default {
		data(){
			return{
				name:'',
				imageList:[]
			}
		},
		methods: {
			chooseImage() {
				if (this.imageList.length === 3) {
					// let isContinue = await this.isFullImg();
					// console.log("是否继续?", isContinue);
					// if (!isContinue) {
					// 	return;
					// }
					return;
				}
				uni.chooseImage({
					sourceType: this.sourceType,
					sizeType: this.sizeType,
					count: this.imageList.length + this.count[this.countIndex] > 3 ? 3 - this.imageList.length : this.count[this.countIndex],
					success: (res) => {
						this.imageList = this.imageList.concat(res.tempFilePaths);
						
						        uni.uploadFile({
						            url: 'https://www.example.com/upload', //仅为示例，非真实的接口地址
						            filePath: tempFilePaths[0],
						            name: 'file',
						            formData: {
						                'user': 'test'
						            },
						            success: (uploadFileRes) => {
						                console.log(uploadFileRes.data);
						            }
						        });
					}
				})
			},
		}
	}
</script>

<style>
	.deepHeight {
		height: 108upx;
		width: 108upx;
	}
</style>
