<template>
	<view class="page">
		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
			<view class="content">
				<view class="top-box" @click="gopath('/pages/declaration/declarationList?type='+OrderType)">
					<view>上报历史</view>
					<view class="top-box-img">
						<image src="../../static/right2.png"></image>
					</view>
				</view>
				<view class="titleall-left">
					<view class="titleall-left-line"></view>我要上报
				</view>
				<view class="message-list" v-if="OrderType==1">
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">行政区划</view>
								<view class="serve-right">
									<picker @change="e=> bindPickerChange1(e,3)" :value="index" :range="array3">
										<view :class="community.adminArea?'uni-input1':'uni-input2'">{{community.adminArea?community.adminArea:'请选择'}}
										</view>
									</picker>
									<image src="../../static/down3.png"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">地名类别</view>
								<view class="serve-right">
									<picker @change="e=> bindPickerChange1(e,1)" :value="index" :range="array1">
										<view :class="community.placeNameCategory?'uni-input1':'uni-input2'">
											{{community.placeNameCategory?community.placeNameCategory:'请选择'}}
										</view>
									</picker>
									<image src="../../static/down3.png"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">类型</view>
								<view class="serve-right">
									<picker @change="e=> bindPickerChange1(e,2)" :value="index" :range="array2">
										<view :class="community.types?'uni-input1':'uni-input2'">{{community.types?community.types:'请选择'}}
										</view>
									</picker>
									<image src="../../static/down3.png"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">小区名称</view>
								<view>
									<input id="communityName" @input="oninput" v-module="community.communityName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">曾用名称</view>
								<view>
									<input id="originalName" @input="oninput" v-module="community.originalName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">历史地名</view>
								<view>
									<input id="historyName" @input="oninput" v-module="community.historyName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">总建筑面积</view>
								<view>
									<input id="totalArea" @input="oninput" v-module="community.totalArea"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">村社区</view>
								<view>
									<input id="villageCommunity" @input="oninput" v-module="community.villageCommunity"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">幢数</view>
								<view>
									<input id="buildingCount" @input="oninput" v-module="community.buildingCount"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">详细地址</view>
								<view class="serve-right" @tap="openaddress(1)">
									<view :class="community.address?'uni-input1':'uni-input2'">{{community.address?community.address:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">有效起始时间</view>
								<view class="serve-right" @tap="opentime(1)">
									<view :class="community.validStartDate?'uni-input1':'uni-input2'">{{community.validStartDate?community.validStartDate:'请选择'}}
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">有效终止日期</view>
								<view class="serve-right" @tap="opentime(2)">
									<view :class="community.validEndDate?'uni-input1':'uni-input2'">{{community.validEndDate?community.validEndDate:'请选择'}}
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">总户数</view>
								<view>
									<input id="totalUnits" @input="oninput" v-module="community.totalUnits"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">开发商</view>
								<view>
									<input id="developer" @input="oninput" v-module="community.developer"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">罗马字母拼写</view>
								<view>
									<input id="romanLettersSpell" @input="oninput"
										v-module="community.romanLettersSpell" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">设立时间</view>
								<view class="serve-right" @tap="opentime(3)">
									<view :class="community.establishTime?'uni-input1':'uni-input2'">{{community.establishTime?community.establishTime:'请选择'}}
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">地名来历</view>
								<view>
									<input id="originOfPlaceNames" @input="oninput"
										v-module="community.originOfPlaceNames" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">地名含义</view>
								<view>
									<input id="meaningOfPlaceNames" @input="oninput"
										v-module="community.meaningOfPlaceNames" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">历史沿革</view>
								<view>
									<input id="historicalEvolution" @input="oninput"
										v-module="community.historicalEvolution" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">邮政编码</view>
								<view>
									<input id="postalCode" @input="oninput" v-module="community.postalCode"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">所在</view>
								<view>
									<input id="administrativeRegion" @input="oninput"
										v-module="community.administrativeRegion" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>

				</view>
				<view class="message-list" v-else-if="OrderType==2">
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">行政区划</view>
								<view class="serve-right">
									<picker @change="e=> bindPickerChange1(e,4)" :value="index" :range="array3">
										<view :class="street.adminAre?'uni-input1':'uni-input2'">{{street.adminArea?street.adminArea:'请选择'}}
										</view>
									</picker>
									<image src="../../static/down3.png"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">名称</view>
								<view>
									<input id="standardName" @input="oninput1" v-module="street.standardName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">曾用名称</view>
								<view>
									<input id="originalName" @input="oninput1" v-module="street.originalName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">地名历史</view>
								<view>
									<input id="nameHistory" @input="oninput1" v-module="street.nameHistory"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">地名含义</view>
								<view>
									<input id="nameMeaning" @input="oninput1" v-module="street.nameMeaning"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">长度</view>
								<view>
									<input id="length" @input="oninput1" v-module="street.length" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">宽度</view>
								<view>
									<input id="width" @input="oninput1" v-module="street.width" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">街道\乡镇</view>
								<view>
									<input id="streetRegistration" @input="oninput1"
										v-module="street.streetRegistration" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">有效起始时间</view>
								<view class="serve-right" @tap="opentime(4)">
									<view :class="street.validStartDate?'uni-input1':'uni-input2'">{{street.validStartDate?street.validStartDate:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">有效终止日期</view>
								<view class="serve-right" @tap="opentime(5)">
									<view :class="street.validEndDate?'uni-input1':'uni-input2'">{{street.validEndDate?street.validEndDate:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">开始位置</view>
								<view class="serve-right" @tap="openaddress(2)">
									<view :class="street.startLocation?'uni-input1':'uni-input2'">{{street.startLocation?street.startLocation:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">结束位置</view>
								<view class="serve-right" @tap="openaddress(3)">
									<view :class="street.endLocation?'uni-input1':'uni-input2'">{{street.endLocation?street.endLocation:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="message-list" v-else-if="OrderType==3">
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">行政区划</view>
								<view class="serve-right">
									<picker @change="e=> bindPickerChange1(e,5)" :value="index" :range="array3">
										<view :class="build.adminArea?'uni-input1':'uni-input2'">{{build.adminArea?build.adminArea:'请选择'}}
										</view>
									</picker>
									<image src="../../static/down3.png"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">名称</view>
								<view>
									<input id="tallBuildName" @input="oninput2" v-module="build.tallBuildName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">曾用名称</view>
								<view>
									<input id="originalName" @input="oninput2" v-module="build.originalName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">层数</view>
								<view>
									<input id="layerNumber" @input="oninput2" v-module="build.layerNumber"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">占地面积</view>
								<view>
									<input id="occupiesArea" @input="oninput2" v-module="build.occupiesArea"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">详细地址</view>
								<view class="serve-right" @tap="openaddress(4)">
									<view :class="build.locationPoint?'uni-input1':'uni-input2'">{{build.locationPoint?build.locationPoint:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">有效起始时间</view>
								<view class="serve-right" @tap="opentime(6)">
									<view :class="build.validStartDate?'uni-input1':'uni-input2'">{{build.validStartDate?build.validStartDate:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">有效终止日期</view>
								<view class="serve-right" @tap="opentime(7)">
									<view :class="build.validEndDate?'uni-input1':'uni-input2'">{{build.validEndDate?build.validEndDate:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">开发商</view>
								<view>
									<input id="developer" @input="oninput2" v-module="build.developer" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">描述</view>
								<view>
									<input id="describeContent" @input="oninput2" v-module="build.describeContent"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>

				</view>
				<view class="message-list" v-else-if="OrderType==4">
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">地名</view>
								<view>
									<input id="addressName" @input="oninput3" v-module="applicatio.addressName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">申请人姓名</view>
								<view>
									<input id="applicationName" @input="oninput3" v-module="applicatio.applicationName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">申请人电话</view>
								<view>
									<input id="applicationPhone" @input="oninput3"
										v-module="applicatio.applicationPhone" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>

					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">详细地址</view>
								<view class="serve-right" @tap="openaddress(5)">
									<view :class="applicatio.address?'uni-input1':'uni-input2'">{{applicatio.address?applicatio.address:'请选择'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">备注</view>
								<view>
									<input id="remark" @input="oninput3" v-module="applicatio.remark" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="message-list" v-else-if="OrderType==5">
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">申报类型</view>
								<view class="serve-right">
									<picker @change="e=> bindPickerChange1(e,6)" :value="index" :range="array4">
										<view :class="array4type?'uni-input1':'uni-input2'">{{array4type?array4type:'请选择'}}
										</view>
									</picker>
									<image src="../../static/down3.png"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box" v-if="array4type == '单个申报'">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">类型</view>
								<view class="serve-right">
									<picker @change="e=> bindPickerChange1(e,7)" :value="index" :range="array5">
										<view :class="doorplate.gridman?'uni-input1':'uni-input2'">{{doorplate.gridman?doorplate.gridman:'请选择'}}
										</view>
									</picker>
									<image src="../../static/down3.png"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">小区名称</view>
								<view>
									<input id="communityName" @input="oninput4" v-module="doorplate.communityName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">门牌号</view>
								<view>
									<input id="formerName" @input="oninput4" v-module="doorplate.formerName"
										placeholder="请输入" style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
					<view class="info-box">
						<view class="info-box-list">
							<view class="serve">
								<view class="serve-title">门牌地址</view>
								<view>
									<input id="historicalPlaceNames" @input="oninput4"
										v-module="doorplate.historicalPlaceNames" placeholder="请输入"
										style="text-align: right;"
										 placeholder-style="color: #909090;font-size: 26rpx;" />
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="OrderType==5 && array4type == '批量申报'" class="message-list">
					<view class="info-box">
						<view class="info-box-list">
							<view class="info-box-width" style="width: 100%;">
								<view class="info-box-small">门牌文件</view>
								<view style="margin-top: 20rpx;width: 100%;">
									<sczl @onchangfileJsonfile="onchangfileJsonfile"></sczl>
								</view>
								<!-- <view class="info-box-list-img"><image src="../../static/img.png"></image></view> -->
							</view>
						</view>
					</view>
				</view>
				<view v-if="OrderType==3" class="message-list">
					<view class="info-box">
						<view class="info-box-list">
							<view class="info-box-width" style="width: 100%;">
								<view class="info-box-small">资料附件（建筑物平面dwg格式、国土地）</view>
								<view style="margin-top: 20rpx;width: 100%;">
									<sczl @onchangfileJsonfile="onchangfileJsonfile"></sczl>
								</view>
								<!-- <view class="info-box-list-img"><image src="../../static/img.png"></image></view> -->
							</view>
						</view>
					</view>
				</view>
				<view class="page-footer">
					<view class="footer-buy">
						<view class="cart-add" @click="mapdoorplatesuccess">
							<image src="../../static/btn5.png"></image>
							<text>立即上报</text>
						</view>
					</view>
				</view>

			</view>
		</view>
		<uni-calendar ref="calendar" :insert="false" @confirm="confirm" />
	</view>
</template>

<script>
	import service from '@/service/service.js'
	import BASE_URL from "@/common/config.js"
	import sczl from "@/components/sczl.vue"
	export default {
		data() {
			return {
				BASE_URL,
				fileList: [],
				OrderType: 0,
				nvConfig: {
					title: "路门牌上报",
					bgColor: "#ffffff",
					color: "#000000",
					fixedAssist: {
						hide: true,
					},
				},
				time: null,
				doorplate: {
					applyId: uni.getStorageSync('USERS_KEY').userId,
					createdUser: uni.getStorageSync('USERS_KEY').userId,
					communityName: null, //小区名称
					gridman:null,//门牌类型
					formerName: null, //曾用名
					historicalPlaceNames: null, //历史地名
					doorNumberFile: null, //门牌文件
					status: '待审核', //审核状态
					submissionTime:new Date().getTime(),//时间
				},
				applicatio: {
					applyId: uni.getStorageSync('USERS_KEY').userId,
					createdUser: uni.getStorageSync('USERS_KEY').userId,
					addressName: null, //地名
					address: null, //地名地址
					applicationName: null, //申请人姓名
					applicationPhone: null, //申请人电话
					map: null, //经纬度
					remark: null, //备注
					auditStatus: '待审核', //审核状态
				},
				build: {
					applyId: uni.getStorageSync('USERS_KEY').userId,
					createdUser: uni.getStorageSync('USERS_KEY').userId,
					adminArea: null, //行政区划					
					tallBuildName: null, //名称
					originalName: null, //曾用名称
					layerNumber: null, //层数
					developer: null, //占地面积				
					describeContent: null, //描述
					validStartDate: null, //有效起始日期
					validEndDate: null, //有效终止日期					
					locationPoint: null, //地理位置
					status: '待审核', //审核状态
					imageData:null
				},
				street: {
					applyId: uni.getStorageSync('USERS_KEY').userId,
					createdUser: uni.getStorageSync('USERS_KEY').userId,
					adminArea: null, //行政区划					
					standardName: null, //名称
					originalName: null, //曾用名称
					nameHistory: null, //历史地名
					nameMeaning: null, //地名含义				
					length: null, //长度
					width: null, //宽度
					streetRegistration: null, //街道\乡镇
					validStartDate: null, //有效起始日期
					validEndDate: null, //有效终止日期					
					startLocation: null, //开始位置
					endLocation: null, //结束位置
					status: '待审核', //审核状态
				},
				community: {
					applyId: uni.getStorageSync('USERS_KEY').userId,
					createdUser: uni.getStorageSync('USERS_KEY').userId,
					placeNameCategory: null, //地名类别
					types: null, //类型
					adminArea: null, //行政区划
					communityName: null, //小区名称
					originalName: null, //曾用名称
					historyName: null, //历史地名
					totalArea: null, //总建筑面积
					villageCommunity: null, //村社区
					buildingCount: null, //幢数
					address: null, //地址
					locationPoint: null, //经纬度
					validStartDate: null, //有效起始日期
					validEndDate: null, //有效终止日期
					totalUnits: null, //总户数
					developer: null, //开发商
					status: '待审核', //审核状态
					romanLettersSpell: null, //罗马字母拼写
					establishTime: null, //设立时间
					originOfPlaceNames: null, //地名来历
					meaningOfPlaceNames: null, //地名含义
					historicalEvolution: null, //历史沿革
					postalCode: null, //邮政编码
					administrativeRegion: null, //所在
				},
				from: {
					createdUser: uni.getStorageSync('USERS_KEY').userId,
					status: '待处理',
					name: '',
					road_status: '',
					latitude: '',
					longitude: '',
					address: '',
					phone: '',
					inspectionImage: ''
				},
				array1: ['农村牧场点', '工矿点', '农村居民点', '城镇居民点'],
				array2: ['农林牧场', '工矿点', '农村', '城镇'],
				array3: getApp().globalData.list1,
				array4: ['单个申报','批量申报'],
				array5: ['临街门牌', '大门牌', '楼栋牌', '单元牌', '户牌'],
				array4type:null,
			};
		},
		onPageScroll(e) {
			this.$refs.nv.pageScroll(e)
		},
		components:{sczl},
		computed: {
			pageTop() {
				return parseInt(88 * uni.getSystemInfoSync().windowWidth / 750) + uni.getSystemInfoSync().statusBarHeight
			}
		},
		onLoad(params) {
			this.OrderType = params.type;
			if (this.OrderType == 1) {
				this.nvConfig.title = '居民小区上报'
			} else if (this.OrderType == 2) {
				this.nvConfig.title = '街路巷申报'
			} else if (this.OrderType == 3) {
				this.nvConfig.title = '建筑名称备案'
			} else if (this.OrderType == 4) {
				this.nvConfig.title = '地名命名申报'
			} else if (this.OrderType == 5) {
				this.nvConfig.title = '门楼牌需求申报'
			}
		},
		methods: {
			onchangfileJsonfile(e) {
				console.log('e',e);
				this.filelist = e
				console.log('this.filelist',this.filelist);
			},
			oninput(e) {
				this.community[e.target.id] = e.target.value
			},
			oninput1(e) {
				this.street[e.target.id] = e.target.value
			},
			oninput2(e) {
				this.build[e.target.id] = e.target.value
			},
			oninput3(e) {
				this.applicatio[e.target.id] = e.target.value
			},
			oninput4(e) {
				this.doorplate[e.target.id] = e.target.value
			},
			opentime(e) {
				this.$refs.calendar.open();
				this.time = e
			},
			confirm(e) {
				console.log(e);
				if (this.time == 1) {
					// this.community.validStartDate = e.fulldate
					this.$set(this.community, 'validStartDate', e.fulldate)
				} else if (this.time == 2) {
					this.community.validEndDate = e.fulldate
				} else if (this.time == 3) {
					this.community.establishTime = e.fulldate
				} else if (this.time == 4) {
					this.street.validStartDate = e.fulldate
				} else if (this.time == 5) {
					this.street.validEndDate = e.fulldate
				} else if (this.time == 6) {
					this.build.validStartDate = e.fulldate
				} else if (this.time == 7) {
					this.build.validEndDate = e.fulldate
				}
				console.log(this.community);
			},
			gopath(e) {
				uni.navigateTo({
					url: e
				})
			},
			async afterRead(event) {
				for (let i = 0; i < event.file.length; i++) {
					var res = await this.uploadImg(event.file[i].url)
					// console.log(res)
					res = JSON.parse(res.data)
					this.fileList.push({
						name: res.fileName,
						fileId: res.newFileName,
						url: this.BASE_URL + res.fileName
					})
				}
			},
			uploadImg(url) {
				return new Promise((r, e) => {
					uni.uploadFile({
						url: this.BASE_URL + "/common/upload",
						filePath: url,
						name: "file",
						success: (d) => r(d)
					})
				})
			},
			deletePic(event) {
				this.fileList.splice(event.index, 1)
			},
			bindPickerChange1: function(e, e1) {
				console.log('picker发送选择改变，携带值为', e, e1,this.array3[e.detail.value])
				if (e1 == 1) {
					this.community.placeNameCategory = this.array1[e.detail.value]
				} else if (e1 == 2) {
					this.community.types = this.array2[e.detail.value]
				} else if (e1 == 3) {
					this.community.adminArea = this.array3[e.detail.value]
				} else if (e1 == 4) {
					this.street.adminArea = this.array3[e.detail.value]
				} else if (e1 == 5) {
					this.build.adminArea = this.array3[e.detail.value]
				}else if (e1 == 6) {
					this.array4type = this.array4[e.detail.value]
				}else if (e1 == 7) {
					this.doorplate.gridman = this.array5[e.detail.value]
				}
			},
			mapdoorplatesuccess() {
				if (this.OrderType == 1) {
					console.log('this.community', this.community)
					// return
					this.API.addCommunity(this.community).then(res => {
						console.log(res);
						if (res.code == 200) {
							uni.showToast({
								icon: 'success',
								title: "添加成功",
							})
							setTimeout(() => {
								uni.redirectTo({
									url: '/pages/mapdoorplatesuccess/mapdoorplatesuccess',
								})
							}, 800)

						}
					})
					return
				} else if (this.OrderType == 2) {
					console.log('this.street', this.street)
					// return
					this.API.addstreet(this.street).then(res => {
						console.log(res);
						if (res.code == 200) {
							uni.showToast({
								icon: 'success',
								title: "添加成功",
							})
							setTimeout(() => {
								uni.redirectTo({
									url: '/pages/mapdoorplatesuccess/mapdoorplatesuccess',
								})
							}, 800)

						}
					})
					return
				} else if (this.OrderType == 3) {
					console.log('this.filelist', this.filelist)
					let box1 = ''
					for (let i = 0; i < this.filelist.length; i++) {
						console.log('this.filelist[i]',this.filelist[i])
						if(i == 0) {
							box1 = this.filelist[i].url
						} else {
							box1 =box1+','+ this.filelist[i].url
						}
					}
					console.log('box1',box1)
					this.build.imageData = box1
					console.log('this.build', this.build)
					// return
					this.API.addbuild(this.build).then(res => {
						console.log(res);
						if (res.code == 200) {
							uni.showToast({
								icon: 'success',
								title: "添加成功",
							})
							setTimeout(() => {
								uni.redirectTo({
									url: '/pages/mapdoorplatesuccess/mapdoorplatesuccess',
								})
							}, 800)

						}
					})
					return
				} else if (this.OrderType == 4) {
					console.log('this.applicatio', this.applicatio)
					// return
					this.API.addapplication(this.applicatio).then(res => {
						console.log(res);
						if (res.code == 200) {
							uni.showToast({
								icon: 'success',
								title: "添加成功",
							})
							setTimeout(() => {
								uni.redirectTo({
									url: '/pages/mapdoorplatesuccess/mapdoorplatesuccess',
								})
							}, 800)

						}
					})
					return
				} else if (this.OrderType == 5) {
					
					if(this.array4type == '批量申报') {
						console.log('this.filelist', this.filelist)
						let box1 = ''
						for (let i = 0; i < this.filelist.length; i++) {
							console.log('this.filelist[i]',this.filelist[i])
							if(i == 0) {
								box1 = this.filelist[i].url
							} else {
								box1 =box1+','+ this.filelist[i].url
							}
						}
						console.log('box1',box1)
						this.doorplate.doorNumberFile = box1
					}

					// return
					this.API.adddoorplate(this.doorplate).then(res => {
						console.log(res);
						if (res.code == 200) {
							uni.showToast({
								icon: 'success',
								title: "添加成功",
							})
							setTimeout(() => {
								uni.redirectTo({
									url: '/pages/mapdoorplatesuccess/mapdoorplatesuccess',
								})
							}, 800)

						}
					})
					return
				}


			},
			openaddress(e) {
				let that = this
				// 用户已经同意小程序使用录音功能，后续调用 wx.startRecord 接口不会弹窗询问
				wx.chooseLocation({
					success: function(res) {
						console.log(res);
						// that.from.latitude = res.latitude
						if (e == 1) {
							that.community.locationPoint = res.longitude + ',' + res.latitude
							that.community.address = res.address
						} else if (e == 2) {
							that.street.startLocation = res.longitude + ',' + res.latitude
						} else if (e == 3) {
							that.street.endLocation = res.longitude + ',' + res.latitude
						} else if (e == 4) {
							that.build.locationPoint = res.longitude + ',' + res.latitude
						} else if (e == 5) {
							that.applicatio.map = res.longitude + ',' + res.latitude
							that.applicatio.address = res.address
						}
						// that.arr1.plot=res.name
					},
					fail(err) {
						console.log(err)
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.uni-input1 {
		color:#3d3d3d;
		// font-weight: bold;
	
	}
	.uni-input2 {
		color: #909090;
	
	}
	input {
		color: #3d3d3d;
		font-size: 26rpx;
	}
	.listBox {
		position: relative;
		z-index: 1;
	}

	.content {
		width: 100%;
		padding-bottom: 120rpx;
	}

	.titleall-left {
		font-size: 28rpx;
		font-weight: bold;
		display: flex;
		align-items: center;
		margin: 30rpx;

		.titleall-left-line {
			width: 10rpx;
			height: 25rpx;
			border-radius: 18rpx;
			background-color: #547DFF;
			margin-right: 20rpx;
			box-shadow: inset 0rpx 4rpx 9rpx 0rpx rgba(255, 255, 255, 0.34), 5rpx 7rpx 9rpx 0rpx rgba(80, 161, 255, 0.33);
		}
	}

	.top-box {
		display: flex;
		justify-content: space-between;
		margin: 30rpx;
		font-size: 28rpx;
		font-weight: bold;
		background-color: #fff;
		border-radius: 21rpx;
		padding: 30rpx;

		.top-box-img {
			image {
				width: 40rpx;
				height: 40rpx;
			}
		}
	}

	.titleall-box {
		display: flex;
		justify-content: space-between;
		padding: 40rpx 20rpx 20rpx 0;

		.titleall-left {
			font-size: 32rpx;
			font-weight: bold;
			display: flex;
			align-items: center;

			.titleall-left-line {
				width: 14rpx;
				height: 36rpx;
				border-radius: 0 10rpx 10rpx 0;
				background-color: #667FFF;
				box-shadow: 0 0 10rpx 5rpx #d1d9ff;
				margin-right: 20rpx;
			}

			text {
				font-size: 28rpx;
				color: #999999;
			}
		}
	}

	.message-list {
		// background-color: #FFFFFF;
		// border-radius: 20rpx;
		font-size: 25rpx;
		margin: 25rpx;

		.info-box {
			padding: 0 40rpx;
			background: #FFFFFF;
			border-radius: 21rpx;
			margin-bottom: 15rpx;

			.info-box-list {
				display: flex;
				align-items: center;
				border-bottom: 2rpx solid #ececec;
				padding-top: 20rpx;
				padding-bottom: 20rpx;

				.width100 {
					width: 100% !important;
				}

				.info-box-width {
					width: 50%;
					font-size: 30rpx;
					font-weight: bold;

					.info-box-small {
						font-size: 26rpx;
						color: #a8a8a8;
						font-weight: 500;
						margin-top: 10rpx;
					}

					.info-box-list-img {
						margin-top: 30rpx;

						image {
							width: 180rpx;
							height: 180rpx;
							border-radius: 20rpx;
						}
					}

					.input-text {
						font-size: 30rpx;
					}

					.inputtext {
						color: #3d3d3d;
					}

					.textarea {
						background-color: #F7F7F7;
						border-radius: 20rpx;
						width: 100%;
						margin-top: 20rpx;
						padding: 20rpx;
						font-size: 28rpx;
						font-weight: normal;
						min-height: 80rpx;
					}
				}

				.serve {
					display: flex;
					justify-content: space-between;
					align-items: center;
					width: 100%;

					.serve-title {
						font-size: 26rpx;
						color: #909090;
					}

					.serve-right {
						font-size: 26rpx;
						// font-weight: bold;
						display: flex;
						align-items: center;
						justify-content: flex-end;

						text {
							color: #FC4444;
						}

						image {
							width: 20rpx;
							height: 20rpx;
							margin-left: 10rpx;
						}
					}
				}
			}

			.info-box-list:last-child {
				border-bottom: 0;
			}
		}
	}

	/* 底部 */
	.page-footer {
		margin: 30rpx;
		display: flex;
		height: 100rpx;

		.footer-buy {
			height: 100%;
			width: 100%;

			.cart-add {
				display: flex;
				align-items: center;
				justify-content: center;
				margin-top: 60rpx;

				image {
					position: absolute;
					z-index: 0;
					width: 95%;
					height: 83rpx;
					box-shadow: 5rpx 10rpx 20rpx 0 #b7c8ff;
					border-radius: 100rpx;
				}

				text {
					font-size: 30rpx;
					font-weight: bold;
					color: #fff;
					position: absolute;
					z-index: 1;
				}
			}
		}
	}
</style>