<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='+7)">
					<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">
					<view v-for="(item,index) in textlist" :key="index">
						<view class="info-box" v-if="item.type == '7'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker range-key="name" mode="multiSelector" @columnchange="columnChange"
											@change="e=> bindPickerChange2(e,index)" :range="array1" :value="idx">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '1'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view>
										<u-input placeholder="请输入" border="none" v-model="item.cent"
											inputAlign="right" fontSize="13px" color="#3d3d3d"  placeholderStyle="color: #909090;font-size: 26rpx;"></u-input>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '2'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker @change="e=> bindPickerChange1(e,index,'array3')" :range="array3">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view v-else-if="item.type == '3'">
							<view class="info-box" >
								<view class="info-box-list">
									<view class="serve">
										<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
										<view class="serve-right" @tap="openaddress(index)">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}</view>
											<image src="../../static/down3.png"></image>
										</view>
									</view>
								</view>
							</view>
							<view class="info-box" v-if="item.latitude">
								<view class="info-box-list">
									<view class="serve">
										<view class="serve-title">纬度<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
										<view class="serve-right" @tap="openaddress(index)">
											<view :class="item.latitude?'uni-input1':'uni-input2'">{{item.latitude?item.latitude:'请选择'}}</view>
											<image src="../../static/down3.png"></image>
										</view>
									</view>
								</view>
							</view>
							<view class="info-box" v-if="item.longitude">
								<view class="info-box-list">
									<view class="serve">
										<view class="serve-title">经度<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
										<view class="serve-right" @tap="openaddress(index)">
											<view :class="item.longitude?'uni-input1':'uni-input2'">{{item.longitude?item.longitude:'请选择'}}</view>
											<image src="../../static/down3.png"></image>
										</view>
									</view>
								</view>
							</view>
						</view>

						<view class="info-box" v-else-if="item.type == '4'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right" @tap="opentime(index)">
										<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
										</view>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '5'">
							<view class="info-box-list">
								<view class="info-box-width" style="width: 100%;">
									<view class="info-box-small">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view style="margin-top: 20rpx;">
										<textarea style="border: solid 1px #eee;border-radius: 18rpx;padding: 20rpx;font-weight: 500;font-size: 26rpx;" placeholder-style="color: #909090;font-size: 26rpx;font-weight: 100;" placeholder="请输入" :class="item.cent?'uni-input1':'uni-input2'" v-model="item.cent"></textarea>
										<!-- <u-textarea count :value="item.cent" placeholder="请输入" placeholderStyle="color: #909090;font-size: 26rpx;font-weight: 500;"></u-textarea> -->
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '6'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker @change="e=> bindPickerChange1(e,index,'array2')" :range="array2">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '8'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker @change="e=> bindPickerChange1(e,index,'array4')" :range="array4">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view v-for="(item,index) in newtextlist" :key="index">
						<view class="info-box" v-if="item.type == '7'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker range-key="name" mode="multiSelector" @columnchange="columnChange"
											@change="e=> bindPickerChange2(e,index)" :range="array1" :value="idx">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '1'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view>
										<u-input placeholder="请输入" border="none" v-model="item.cent"
											inputAlign="right" fontSize="13px" color="#3d3d3d"  placeholderStyle="color: #909090;font-size: 26rpx;"></u-input>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '2'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker @change="e=> bindPickerChange1(e,index,'array3')" :range="array3">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view v-else-if="item.type == '3'">
							<view class="info-box" >
								<view class="info-box-list">
									<view class="serve">
										<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
										<view class="serve-right" @tap="openaddress(index)">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}</view>
											<image src="../../static/down3.png"></image>
										</view>
									</view>
								</view>
							</view>
							<view class="info-box" v-if="item.latitude">
								<view class="info-box-list">
									<view class="serve">
										<view class="serve-title">纬度<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
										<view class="serve-right" @tap="openaddress(index)">
											<view :class="item.latitude?'uni-input1':'uni-input2'">{{item.latitude?item.latitude:'请选择'}}</view>
											<image src="../../static/down3.png"></image>
										</view>
									</view>
								</view>
							</view>
							<view class="info-box" v-if="item.longitude">
								<view class="info-box-list">
									<view class="serve">
										<view class="serve-title">经度<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
										<view class="serve-right" @tap="openaddress(index)">
											<view :class="item.longitude?'uni-input1':'uni-input2'">{{item.longitude?item.longitude:'请选择'}}</view>
											<image src="../../static/down3.png"></image>
										</view>
									</view>
								</view>
							</view>
						</view>
					
						<view class="info-box" v-else-if="item.type == '4'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right" @tap="opentime(index)">
										<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
										</view>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '5'">
							<view class="info-box-list">
								<view class="info-box-width" style="width: 100%;">
									<view class="info-box-small">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view style="margin-top: 20rpx;">
										<textarea style="border: solid 1px #eee;border-radius: 18rpx;padding: 20rpx;font-weight: 500;font-size: 26rpx;" placeholder-style="color: #909090;font-size: 26rpx;font-weight: 100;" placeholder="请输入" :class="item.cent?'uni-input1':'uni-input2'" v-model="item.cent"></textarea>
										<!-- <u-textarea count :value="item.cent" placeholder="请输入" placeholderStyle="color: #909090;font-size: 26rpx;font-weight: 500;"></u-textarea> -->
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '6'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker @change="e=> bindPickerChange1(e,index,'array2')" :range="array2">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
						<view class="info-box" v-else-if="item.type == '8'">
							<view class="info-box-list">
								<view class="serve">
									<view class="serve-title">{{item.name}}<span v-if="item.isbx" style="color: red;margin-left: 6rpx;">*</span></view>
									<view class="serve-right">
										<picker @change="e=> bindPickerChange3(e,index,'array5')" :range="array5">
											<view :class="item.cent?'uni-input1':'uni-input2'">{{item.cent?item.cent:'请选择'}}
											</view>
										</picker>
										<image src="../../static/down3.png"></image>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
<!-- 				<view 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 :imagelist="mtbox.imgcent"  :wjlist="mtbox.filecent" @onchangfileJsonimg="e=>{onchangfileJsonimg(e)}" @onchangfileJsonfile="e=>{onchangfileJsonfile(e)}"></sczl>
									
				
								</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 {
				newtextlist:[],
				mtbox:{
					imgcent:[],
					filecent:[],
				},
				idx: [0,0,0,0],
				array1: [],
				array2: ['可公开', '不宜公开','大洋怪重', '不属于地名'],
				array4: ['现今地名', '历史地名','本地名删除'],
				array5: ['冷泉', '热泉'],
				time: null,
				array3: getApp().globalData.list1,
				BASE_URL,
				nvConfig: {
					title: "地名命名申报",
					bgColor: "#ffffff",
					color: "#000000",
					fixedAssist: {
						hide: true,
					},
				},
				lbbox:[],
				textlist: [{
						name: '行政区划',
						type: '2',
						isbx:true,
						cent: '',
						from:'adminArea'
					},
					{
						name: '地名类别',
						type: '7',
						isbx:true,
						cent: '',
						from:'placeNameCategory'
					},
					{
						name: '标准名称',
						type: '1',
						isbx:true,
						cent: '',
						from:'standardName'
					},
					{
						name: '地名代码',
						type: '1',
						isbx:false,
						cent: '',
						from:'toponymicCode'
					},
					{
						name: '是否可公开',
						type: '6',
						isbx:false,
						cent: '',
						from:'whetherPublic'
					},
					{
						name: '罗马字母拼写',
						type: '1',
						isbx:true,
						cent: '',
						from:'romanLettersSpell'
					},
					{
						name: '通名罗马字母拼写',
						type: '1',
						isbx:false,
						cent: '',
						from:'commonRomanAlphabetSpelling'
					},
					{
						name: '少数民族语拼写',
						type: '1',
						isbx:false,
						cent: '',
						from:'minoritySpelling'
					},
					{
						name: '地名语种',
						type: '1',
						isbx:false,
						cent: '',
						from:'language'
					},
					{
						name: '别名',
						type: '1',
						isbx:false,
						cent: '',
						from:'alias'
					},
					{
						name: '简称',
						type: '1',
						isbx:false,
						cent: '',
						from:'abbreviation'
					},
					{
						name: '使用时间',
						type: '8',
						isbx:true,
						cent: '',
						from:'usageTime'
					},
					{
						name: '曾用名',
						type: '1',
						isbx:false,
						cent: '',
						from:'formerName'
					},
					{
						name: '设立时间',
						type: '4',
						isbx:true,
						cent: '',
						from:'establishTime'
					},
					{
						name: '废止时间',
						type: '4',
						isbx:false,
						cent: '',
						from:'annulmentTime'
					},
					{
						name: '地理位置',
						type: '3',
						isbx:true,
						cent: '',
						from:'mapCoordinates'
					},
					{
						name: '地名来历',
						type: '5',
						isbx:true,
						cent: '',
						from:'originOfPlaceNames'
					},
					{
						name: '地名含义',
						type: '5',
						isbx:true,
						cent: '',
						from:'meaningOfPlaceNames'
					},
					{
						name: '历史沿革',
						type: '5',
						isbx:true,
						cent: '',
						from:'historicalEvolution'
					},
					{
						name: '备注',
						type: '5',
						isbx:false,
						cent: '',
						from:'remark'
					},
				]
			};
		},
		components: {
			sczl
		},
		computed: {
			pageTop() {
				return parseInt(88 * uni.getSystemInfoSync().windowWidth / 750) + uni.getSystemInfoSync().statusBarHeight
			}
		},
		onLoad(e) {
			this.gain()
			

		},
		methods: {
			gain() {
				this.API.gettreeselect().then(res => {
					console.log(res.data[0].children);
					
					let box1 = []
					let box2 = []
					let box3 = []
					let box4 = []
					for (let i = 0; i < res.data[0].children.length; i++) {
						let list1 = res.data[0].children[i]
						
						let cent1 = {
							id: list1.id,
							name: list1.label
						}
						box1.push(cent1)
						if(list1.children) {
							for (let n = 0; n < list1.children.length; n++) {
								let list2 = list1.children[n]
								let cent2 = {
									id: list2.id,
									name: list2.label,
									pid: list1.id,
								}
								box2.push(cent2)
								if(list2.children) {
									for (let x = 0; x < list2.children.length; x++) {
										let list3 = list2.children[x]
										let cent3 = {
											id: list3.id,
											name: list3.label,
											pid: list2.id,
										}
										box3.push(cent3)
										if(list3.children) {
											for (let y = 0; y < list3.children.length; y++) {
												let list4 = list3.children[y]
												let cent4 = {
													id: list4.id,
													name: list4.label,
													pid: list3.id,
												}
												box4.push(cent4)
											}
										}
									}
								}
							}
						} else {
							
						}
					}
					this.lbbox = [box1,box2,box3,box4]
					console.log(this.lbbox);
					this.updatelist(0,0)
				})
				// this.API.getregional().then(res => {
				// 	console.log(res);
				// })
			},
			gopath(e) {
				uni.navigateTo({
					url: e
				})
			},
			onchangfileJsonimg(e,){
				console.log(e);
				this.mtbox.imgcent = e
			},
			onchangfileJsonfile(e) {
				console.log(e);
				this.mtbox.filecent = e
			},
			confirm(e) {
				this.textlist[this.time].cent = e.fulldate
			},
			opentime(e) {
				this.$refs.calendar.open();
				this.time = e
			},
			mapdoorplatesuccess() {
				console.log(this.textlist,this.textlist.length)
				let from = {}
				// for (let i = 0; i < this.textlist.length; i++) {
				// 	if(this.textlist[i].isbx) {
				// 		if(this.textlist[i].cent) {
							
				// 		} else {
				// 			uni.showToast({
				// 				icon:'none',
				// 				title:'请填写' + this.textlist[i].name 
				// 			})
				// 			return
				// 		}
				// 	} else {
						
				// 	}
				// }
				// for (let i = 0; i < this.newtextlist.length; i++) {
				// 	if(this.newtextlist[i].isbx) {
				// 		if(this.newtextlist[i].cent) {
							
				// 		} else {
				// 			uni.showToast({
				// 				icon:'none',
				// 				title:'请填写' + this.newtextlist[i].name 
				// 			})
				// 			return
				// 		}
				// 	} else {
						
				// 	}
				// }
				for (let i = 0; i < this.textlist.length; i++) {

					if(this.textlist[i].from == 'mapCoordinates') {
						from[this.textlist[i].from] = this.textlist[i].cent
						from.eastLongitude = this.textlist[i].longitude
						from.northLatitude = this.textlist[i].latitude
					} else {
						from[this.textlist[i].from] = this.textlist[i].cent
					}
				}
				console.log(from,from.length)
				from.createdUser=uni.getStorageSync('USERS_KEY').userId
				from.status='待审核'
				from.remarksField5 = JSON.stringify(this.newtextlist)
				this.API.toponym(from).then(res => {
					console.log(res);
					if (res.code == 200) {
						uni.showToast({
							icon: 'success',
							title: "添加成功",
						})
						setTimeout(() => {
							uni.redirectTo({
								url: '/pages/mapdoorplatesuccess/mapdoorplatesuccess',
							})
						}, 800)
				
					}
				})
			},
			bindPickerChange2: function(e, e1) {
				console.log('picker发送选择改变，携带值为', e, e1,this.array1)
				let box1 = this.array1[0]
				let box2 = this.array1[1]
				let box3 = this.array1[2]
				let box4 = this.array1[3]
				this.textlist[e1].cent = box4[e.detail.value[3]]?box4[e.detail.value[3]].name:box3[e.detail.value[2]]?box3[e.detail.value[2]].name:box2[e.detail.value[1]]?box2[e.detail.value[1]].name:box1[e.detail.value[0]].name
				if(this.textlist[e1].cent == '泉') {
					this.array5 = ['冷泉', '热泉']
					this.newtextlist = [
						{
							name: '类型',
							type: '8',
							isbx:true,
							cent: '',
							from:'name0'
						},
						{
							name: '最高水位(米)',
							type: '1',
							isbx:false,
							cent: '',
							from:'name1'
						},
						{
							name: '最低水位(米)',
							type: '1',
							isbx:false,
							cent: '',
							from:'name2'
						},
						{
							name: '最大输出量(立方米)',
							type: '1',
							isbx:false,
							cent: '',
							from:'name3'
						},
						{
							name: '日出水量(立方米)',
							type: '1',
							isbx:false,
							cent: '',
							from:'name4'
						},
						{
							name: '涌水高度(米)',
							type: '1',
							isbx:false,
							cent: '',
							from:'name5'
						},
						{
							name: '年均水温(摄氏度)',
							type: '1',
							isbx:false,
							cent: '',
							from:'name6'
						},
					]
				} else if(this.textlist[e1].cent == '瀑布') {
					this.newtextlist = [
						{
							name: '最大落差(米)',
							type: '1',
							isbx:true,
							cent: '',
							from:'name0'
						},
						{
							name: '最大宽度(米)',
							type: '1',
							isbx:true,
							cent: '',
							from:'name0'
						},
						{
							name: '流量(立方米/秒)',
							type: '1',
							isbx:false,
							cent: '',
							from:'name0'
						},
						{
							name: '上游水源',
							type: '1',
							isbx:false,
							cent: '',
							from:'name0'
						},
					]
				}else if(this.textlist[e1].cent == '') {
					
				}else if(this.textlist[e1].cent == '') {
					
				}
				
				this.newtextlist.push(
					{
						name: '所在(跨) 行政区',
						type: '1',
						isbx:true,
						cent: '',
						from:'name'+this.newtextlist.length
					},
				)
				this.newtextlist.push(
					{
						name: '其他信息',
						type: '5',
						isbx:false,
						cent: '',
						from:'name'+this.newtextlist.length
					},
				)
				console.log(this.newtextlist)
			},
			bindPickerChange1: function(e, e1,e2) {
				console.log('picker发送选择改变，携带值为', e, e1,e2)
				this.textlist[e1].cent = this[e2][e.detail.value]
			},
			bindPickerChange3: function(e, e1,e2) {
				console.log('picker发送选择改变，携带值为', e, e1,e2)
				this.newtextlist[e1].cent = this[e2][e.detail.value]
			},
			openaddress(e) {
				let that = this
				// 用户已经同意小程序使用录音功能，后续调用 wx.startRecord 接口不会弹窗询问
				wx.chooseLocation({
					success: function(res) {
						that.textlist[e].cent = res.address
						that.textlist[e].latitude = res.latitude
						that.textlist[e].longitude = res.longitude
						console.log(res)
					},
					fail(err) {
						console.log(err)
					}
				});
			},
			// picker的列发生变化时
			columnChange(e) {
				// column列索引（0-第一列）  value是列中数组索引
				this.updatelist(parseInt(e.target.column), parseInt(e.target.value))
			},
			updatelist(col, idx) {
				console.log(col,idx)
				let data = this.lbbox
				let list = this.array1 // 视图渲染
				list[0] = data[0] // picker的第一列数据
				// 当第一列变化时
				if (col == 0) {
					// 更新第二列的数据
					list[1] = list[0][idx]?data[1].filter(ele => ele.pid == list[0][idx].id):[]
					// 更新第三列的数据
					list[2] = list[1][0]?data[2].filter(ele => ele.pid == list[1][0].id):[]
					list[3] = list[2][0]?data[3].filter(ele => ele.pid == list[2][0].id):[]
					this.idx = [idx, 0, 0,0]
				}
				// 当第二列变化时
				if (col == 1) {
					// 只用更新第三列数据
					list[2] = list[1][idx]?data[2].filter(ele => ele.pid == list[1][idx].id):[]
					list[3] = list[2][0]?data[3].filter(ele => ele.pid == list[2][0].id):[]
					this.idx = [this.idx[0], idx, 0,0]
				}
				// 当第三列变化时
				if (col == 2) {
					// 只用更新第三列数据
					list[3] = list[2][idx]?data[3].filter(ele => ele.pid == list[2][idx].id):[]
					this.idx = [this.idx[0],this.idx[1],idx,0]
				}
				// 更新list，更新picker视图
				this.array1 = list
			}
		}
	}
</script>

<style scoped lang="scss">
	.uni-input1 {
		color:#3d3d3d;
		// font-weight: bold;

	}
	.uni-input2 {
		color: #909090;

	}
	.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>