<template>

	<view>
		<view style="padding: 0px 0px;">
			<view class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index">
				<!-- <view v-if="item.isSort">
					<view class="filter-content-list">
						<view v-for="(detailItem,idx) in selectDetailList" :key="idx" :class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'"
						 :style="{'color': detailItem.isSelected?themeColor:'#666666'}" @tap="sortTap(idx,selectDetailList,item.key)">
							<text>{{detailItem.title}}</text>
						</view>
					</view>
				</view> -->
				<view>
					<view classs="filter-content-title" v-if="item.detailTitle && item.detailTitle.length">
						<text>{{item.detailTitle}}</text>
					</view>
					<!-- <view class="filter-content-detail show_min_height"> -->
					<scroll-view scroll-y="true">
						<view class="">
							<span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">渠道</span>
							<view class="filter-content-detail show_min_height">
								<text v-if="( productCodeLable? index==3 : false ) "
									v-for="( detailItem,idx) in selectDetailLists" :key="idx"
									class='filter-content-detail-item-default'
									:style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}"
									@tap="itemTaps(idx,selectDetailLists,item.isMutiple,'channelCode',detailItem)">
									{{detailItem.title}}
								</text>
							</view>
							<span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">品牌</span>
							<view class="filter-content-detail show_min_height">
								<text v-if="( productCodeLable? index!==2 : true ) "
									v-for="( detailItem,idx) in selectDetailList" :key="idx"
									class='filter-content-detail-item-default'
									:style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}"
									@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key,detailItem,index)">
									{{detailItem.title}}
								</text>
							</view>
							<view style="margin-bottom: 10rpx;" v-for="(p,pIndex) in productCodeLable"
								v-if="(productCodeLable? index==2:false) ">
								<view class="newselsetitle">{{p}}</view>
								<view class="newselse">
									<text
										:style="{background:seleIdex == zIndex +'/'+ p + '/' + index?'#FF6700':'',color:seleIdex == zIndex +'/'+ p + '/' + index?'#FFFFFF':'',border:seleIdex == zIndex +'/'+ p + '/' + index?'0px':''}"
										@click="pseleFn(zIndex,p,index)" v-for="(z,zIndex) in productCodeList[p]"
										class="newselseitem">{{z}}</text>
								</view>
							</view>
						</view>
					</scroll-view>

				</view>
				<view class="filter-content-detail" v-show="pickerShow">
					<!-- 省市区选择 -->
					<view class="region-box" v-if="( productCodeLable? index==1 : true ) ">
						<picker-view :value="region" @change="bindChange">
							<picker-view-column>
								<view class="center" v-for="(item, index) in areaCodeList" :key="index">
									<!-- v-show不可去除 去掉会显示undefined 原因未知 -->
									<view v-show="false">{{ JSON.stringify(item.areaName)  }}</view>
									{{item.areaName}}
								</view>
							</picker-view-column>
							<picker-view-column v-if="areaCodeList[areaIndex[0]]">
								<view class="center" v-for="(item, index) in areaCodeList[areaIndex[0]].childList"
									:key="index">
									<view v-show="false">{{ JSON.stringify(item.areaName)  }}</view>
									{{ item.areaName }}
								</view>
							</picker-view-column>
							<picker-view-column v-if="areaCodeList[areaIndex[0]]">
								<view class="center"
									v-for="(item, index) in areaCodeList[areaIndex[0]].childList[areaIndex[1]].childList"
									:key="index">
									<view v-show="false">{{ JSON.stringify(item.areaName)  }}</view>
									{{ item.areaName }}
								</view>
							</picker-view-column>
						</picker-view>
					</view>
				</view>
				<view class="filter-content-footer">
					<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;"
						@tap="resetClick(selectDetailList,item.key,selectDetailLists,'channelCode',index)">
						<text>重置</text>
					</view>
					<view class="filter-content-footer-item"
						:style="{'color': '#FFFFFF', 'background-color': themeColor}"
						@tap="sureClick(selectDetailList,item.key,index)">
						<text>确定</text>
					</view>
				</view>
			</view>
		</view>
	</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				productCodeLable: null,
				selectArr: [],
				result: {},
				menuIndex: 0,
				selectDetailList: [],
				selectDetailLists: [],
				independenceObj: {},
				selectedKey: '',
				cacheSelectedObj: {},
				defaultSelectedTitleObj: {},
				seleIdex: null,
				areaCodeList: [],
				areaIndex: [0, 0, 0],
				provinceCode: '',
				cityCode: '',
				areaCode: '',
				region: [],
				paixu: 1,
				oilCode: '0#',
				showHide: true,
				pickerShow: false,
			};
		},
		props: {
			themeColor: {
				type: String,
				default () {
					return '#D1372C'
				}
			},
			menuList: {
				type: Array,
				default () {
					return []
				}
			},
			areaCodeList1: {
				type: Array,
				default () {
					return []
				}
			},
			productCodeList: {
				type: Object,
				default () {
					return null
				}
			},
			independence: {
				type: Boolean,
				default: false
			}
		},
		watch: {
			productCodeList: function(n, o) {
				// console.log('%c 打印的新的列表格式箭头↓zxxxx','color:red;font-size:32px')
				this.setingFn()
				// console.log(this.productCodeList,this.menuList,'9999999999999')
			},
			selectDetailList: function(n, o) {
				// console.log('%c 元数组切换↓1','font-size:50px;color:blue')
				// console.log(this.menuIndex)
			}

		},
		created() {
			/*
			 * @property {Object}   productCodeList: 传入的新列表格式
			 * @property {Array}   productCodeLable: 传入的新列表格式的列表标题
			 * @property {Function} setingFn: 调用微信接口获取code 通过code调用服务端接口换取请求头数据
			 */
			// console.log(this.menuList,'打印列表列表')
			this.setingFn()
			this.areaCodeList = uni.getStorageSync('areaCodeList') || []
			this.areaCodeList.unshift({
				areaName: '全部',
				childList: [{
					areaName: '',
					childList: [{
						areaName: ''
					}]
				}]
			})
			if (this.areaCodeList.length === 1) {
				let instance = setInterval(() => {
					// console.log('执行一次')
					if (this.areaCodeList1.length) {
						clearInterval(instance)
						this.areaCodeList = [...this.areaCodeList, ...this.areaCodeList1]
					}
				}, 2000)
			}
			// setTimeout(() => {

			// },3000)

			// setTimeout(()=>{
			// 	if(this.areaCodeList1.length<1){
			// 		this.areaCodeList = uni.getStorageSync('areaCodeList')
			// 	}else{
			// 		this.areaCodeList = this.areaCodeList1
			// 	}
			// 	// this.areaCodeList = this.areaCodeList1
			// 	console.log(this.areaCodeList,this.areaCodeList1,'11111111111111')
			// 	this.areaCodeList.unshift({areaName:'全部',childList:[{areaName:'',childList:[{areaName:''}]}]})
			// },3000)
			// console.log('%c 子组件参数↓','font-size:30px;color:red')
		},
		computed: {
			selectedTitleObj() {
				let obj = {}
				for (let i = 0; i < this.menuList.length; i++) {
					let item = this.menuList[i];
					obj[item.key] = item.title;
				}
				return obj;
			},
			defaultSelectedObj() { // 保存初始状态
				return this.getSelectedObj()
			},
			selectedObj: {
				get() {
					return this.getSelectedObj()
				},
				set(newObj) {
					return newObj;
				}

			}
		},
		methods: {
			//选择值改变事件    省市区级联选择
			bindChange(e, ccc) {
				// 用于对比滑动的是哪一列数据
				const val = e.detail.value
				this.areaIndex = val
				this.region = val
				console.log(this.areaIndex, val, '省市区下标')
				if (this.areaIndex[0] !== val[0]) {
					// 如果滑动的是第一列数据，让二三列恢复到0
					this.areaIndex = [val[0], 0, 0]
					// console.log(this.areaCodeList[val[0]].childList[0].areaName,'打印是否[全部]')
				} else if (this.areaIndex[1] !== val[1]) {
					this.areaIndex[1] = val[1]
					// 滑动的是第二列数据
					this.areaIndex = [val[0], val[1], 0]
					// console.log(this.areaCodeList[val[0]].childList[val[1]].childList[0].areaName,'打印是否[全部]')
				} else {
					this.areaIndex = e.detail.value;
				}
				if (!ccc) {
					// 数组push‘全部’
					if (val[0] != 0) {
						if (this.areaCodeList[val[0]].childList[0].areaName != '全部') {
							this.areaCodeList[val[0]].childList.unshift({
								areaName: '全部'
							})
						}
						if (this.areaIndex[1] != 0) {
							if (this.areaCodeList[val[0]].childList[val[1]].childList[0].areaName != '全部') {
								this.areaCodeList[val[0]].childList[val[1]].childList.unshift({
									areaName: '全部'
								})
							}
						}
						this.provinceCode = this.areaCodeList[this.areaIndex[0]].id
						this.cityCode = this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].id
						this.areaCode = this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].childList[this
							.areaIndex[2]].id
					} else {
						this.provinceCode = this.cityCode = this.areaCode = ''
						this.areaIndex = [0, 0, 0]
					}
				}

				this.$emit('changeArea', e)
			},


			pseleFn(e, w, j) {
				if (arguments.length < 3) {
					this.seleIdex = '#' + '/' + '柴油' + '/' + this.menuIndex
				} else {
					this.seleIdex = e + '/' + w + '/' + j
				}
				// this.oilCode = this.seleIdex
				// console.log(e,w,j,'aaaaaaaaaaaaaaaaa')
			},
			setingFn() {
				if (this.productCodeList) {
					this.productCodeLable = Object.keys(this.productCodeList)
				}
				// console.log(this.productCodeLable,'ddddddddddddddddddd')
			},
			getSelectedObj() {
				let obj = {}
				for (let i = 0; i < this.menuList.length; i++) {
					let item = this.menuList[i];
					if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString()
						.length > 0) { // 处理并列菜单默认值

						if (item.isMutiple) {
							obj[item.key] = [];
							item.detailList[0].isSelected = false;
							item.detailLists[0].isSelected = false;
							if (!Array.isArray(item.defaultSelectedIndex)) { // 如果默认值不是数组
								item.defaultSelectedIndex = [item.defaultSelectedIndex];
							}
							for (let j = 0; j < item.defaultSelectedIndex.length; j++) { // 将默认选中的值放入selectedObj
								item.detailList[item.defaultSelectedIndex[j]].isSelected = true;
								obj[item.key].push(item.detailList[item.defaultSelectedIndex[j]].value)
								item.detailLists[item.defaultSelectedIndex[j]].isSelected = true;
								obj[item.key].push(item.detailLists[item.defaultSelectedIndex[j]].value)
							}

						} else {
							obj[item.key] = item.detailList[item.defaultSelectedIndex].value;
							this.selectedTitleObj[item.key] = item.detailList[item.defaultSelectedIndex].title;
							this.defaultSelectedTitleObj[item.key] = item.detailList[item.defaultSelectedIndex].title;
							item.detailList[0].isSelected = false;
							item.detailList[item.defaultSelectedIndex].isSelected = true;
							obj[item.key] = item.detailLists[item.defaultSelectedIndex].value;
							this.selectedTitleObj[item.key] = item.detailLists[item.defaultSelectedIndex].title;
							this.defaultSelectedTitleObj[item.key] = item.detailLists[item.defaultSelectedIndex].title;
							item.detailLists[0].isSelected = false;
							item.detailLists[item.defaultSelectedIndex].isSelected = true;
						}
					} else {
						if (item.isMutiple) {
							obj[item.key] = [];
						} else {
							obj[item.key] = '';
						}
					}
				}
				this.result = obj;
				return obj;
			},
			// 重置所有选项，包括默认选项，并更新result
			resetAllSelect(callback) {
				let titles = [];
				for (let i = 0; i < this.menuList.length; i++) {
					this.resetSelected(this.menuList[i].detailList, this.menuList[i].key);
					titles[this.menuList[i].key] = this.menuList[i].title;
				}
				// console.log(titles,'*************************')
				let obj = {
					'result': this.result,
					'titles': titles,
					'isReset': true
				}
				this.$emit("confirm", obj);
				callback(this.result);
			},
			// 重置选项为设置的默认值，并更新result
			resetSelectToDefault(callback) {
				for (let i = 0; i < this.menuList.length; i++) {
					this.selectDetailList = this.menuList[i].detailList;

					if (this.menuList[i].defaultSelectedIndex) {
						if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // 把所有默认的为false的点为true
							for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) {
								if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) {
									this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this
										.menuList[i].isMutiple, this
										.menuList[i].key)
									this.itemTaps(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this
										.menuList[i].isMutiple, this
										.menuList[i].key)
								}
							}
						} else {
							this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i]
								.isMutiple, this.menuList[
									i].key)
							this.itemTaps(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i]
								.isMutiple, this.menuList[
									i].key)
						}

						// 获取非默认项的下标
						let unDefaultSelectedIndexArr = this.getUnDefaultSelectedIndex(this.menuList[i])
						// 把所有不是默认的为true的点为false
						for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) {
							if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) {
								this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i]
									.isMutiple, this
									.menuList[i].key)
								this.itemTaps(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i]
									.isMutiple, this
									.menuList[i].key)
							}
						}
					}


				}

				this.selectedObj = this.defaultSelectedObj;
				this.result = this.defaultSelectedObj;
				let obj = {
					'result': this.result,
					'titles': this.defaultSelectedTitleObj,
					'isReset': true
				}
				this.$emit("confirm", obj);
				callback(this.result)
			},
			getUnDefaultSelectedIndex(menuListItem) { // 获取非默认项
				let tempDefault = menuListItem.defaultSelectedIndex;
				if (!Array.isArray(tempDefault)) {
					tempDefault = [tempDefault];
				}
				// 获取所有项的下标 组成新的数组
				let all = [];
				for (let i = 0; i < menuListItem.detailList.length; i++) {
					all.push(i)
				}
				// 将默认选中的数组与所有项的数组的不同值合并为一个新数组
				var unDefaultSelectedIndex = tempDefault.filter(function(v) {
					return !(all.indexOf(v) > -1)
				}).concat(all.filter(function(v) {
					return !(tempDefault.indexOf(v) > -1)
				}));
				return unDefaultSelectedIndex;
			},
			resetMenuList(val) {
				this.menuList = val;
				this.$emit('update:menuList', val)
			},
			menuTabClick(index) {
				// console.log(this.menuList,'展开')
				this.menuIndex = index;
				this.selectDetailList = this.menuList[index].detailList;
				this.selectDetailLists = this.menuList[index].detailLists;
				this.selectedKey = this.menuList[index].key;
				// 如果是独立菜单
				if (this.independence && !this.menuList[index].isSort) {
					if (JSON.stringify(this.independenceObj) == '{}') {
						this.initIndependenceObj(index);
					} else {
						for (let key in this.independenceObj) {
							if (key != this.selectedKey) {
								this.initIndependenceObj(index);
								this.resetSelected(this.menuList[index].detailList, this.selectedKey);
							}
						}
					}

				}
				if (this.independence && this.menuList[index].isSort) {

					this.independenceObj = {};


				}
				if (this.independence) {
					let idx = this.menuList[index].defaultSelectedIndex;
					if (idx != null && idx.toString().length > 0) { // 处理独立菜单默认值
						if (this.menuList[index].isMutiple) {
							for (let i = 0; i < idx.length; i++) {
								if (this.menuList[index].detailList[idx[i]].isSelected == false) {
									this.itemTap(idx[i], this.menuList[index].detailList, true, this.selectedKey);
									this.itemTaps(idx[i], this.menuList[index].detailList, true, this.selectedKey);
								}

							}
						} else {
							if (this.menuList[index].detailList[idx].isSelected == false) {

								this.itemTap(idx, this.menuList[index].detailList, false, this.selectedKey);
								this.itemTaps(idx, this.menuList[index].detailList, false, this.selectedKey);

							}
						}

					}
				}


				// #ifdef H5
				this.selectedObj = this.selectedObj;
				this.$forceUpdate();
				// #endif
			},
			initIndependenceObj(index) {
				this.independenceObj = {};
				if (this.menuList[index].isMutiple) {
					this.independenceObj[this.selectedKey] = [];
				} else {
					this.independenceObj[this.selectedKey] = '';
				}
			},
			//图标点击方法
			itemTap(index, list, isMutiple, key, detailItem, indexs) {
				//是否多选
				if (isMutiple == true) {
					list[index].isSelected = !list[index].isSelected;
					if (index == 0) {
						this.resetSelected(list, key)
						if (!this.independence) {
							this.selectedTitleObj[key] = list[index].title;
						}
					} else {
						list[0].isSelected = false
						if (list[index].isSelected) {
							if (this.independence) {
								this.independenceObj[this.selectedKey].push(list[index].value);
							} else {
								this.selectedObj[key].push(list[index].value);
							}
						} else {
							list[index].isSelected = false;
							if (this.independence) {
								var idx = this.independenceObj[this.selectedKey].indexOf(list[index].value);
								this.independenceObj[this.selectedKey].splice(idx, 1);
							} else {
								var idx = this.selectedObj[key].indexOf(list[index].value);
								this.selectedObj[key].splice(idx, 1);
							}

						}
						if (this.independence) {
							this.result = this.independenceObj;
						} else {
							this.result = this.selectedObj;
						}

					}
				} else {
					//判断是否是第一个
					if (index == 0) {
						this.resetSelected(list, key)
						if (!this.independence) {
							this.selectedTitleObj[key] = list[index].title;
						}
					} else {
						//列表第一个为false
						list[0].isSelected = false
						if (this.independence) {
							this.independenceObj[this.selectedKey] = list[index].value;
							this.result = this.independenceObj;
						} else {
							this.selectedObj[key] = list[index].value;
							this.result = this.selectedObj;
							this.selectedTitleObj[key] = list[index].title;
						}

						for (let i = 0; i < list.length; i++) {
							if (index == i) {
								list[i].isSelected = true
							} else {
								list[i].isSelected = false
							}
						}
					}
					if (indexs == 1) {
						if (detailItem.value == 10) {
							this.detailItems = ''
							this.pickerShow = true
						} else {
							this.detailItems = detailItem.value
							this.provinceCode = ''
							this.cityCode = ''
							this.areaCode = ''
							this.pickerShow = false
							this.region = []
						}
					} else {
						this.pickerShow = false
					}
					if (indexs == 2) {
						this.oilCode = detailItem.value
					}
					if (indexs == 0) {
						this.paixu = detailItem.value == 'juli' ? 1 : 2
					}
					console.log(index, list, isMutiple, key, detailItem, indexs, '打印打印打印')
					// this.detailItems = detailItem.value*1000
				}
				// #ifdef H5
				this.$forceUpdate();
				// #endif
			},
			//图标点击方法
			itemTaps(index, list, isMutiple, key, detailItem, indexs) {
				//是否多选
				if (isMutiple == true) {
					list[index].isSelected = !list[index].isSelected;
					if (index == 0) {
						this.resetSelected(list, key)
						if (!this.independence) {
							this.selectedTitleObj[key] = list[index].title;
						}
					} else {
						list[0].isSelected = false
						if (list[index].isSelected) {
							if (this.independence) {
								this.independenceObj[this.selectedKey].push(list[index].value);
							} else {
								this.selectedObj[key].push(list[index].value);
							}
						} else {
							list[index].isSelected = false;
							if (this.independence) {
								var idx = this.independenceObj[this.selectedKey].indexOf(list[index].value);
								this.independenceObj[this.selectedKey].splice(idx, 1);
							} else {
								var idx = this.selectedObj[key].indexOf(list[index].value);
								this.selectedObj[key].splice(idx, 1);
							}

						}
						if (this.independence) {
							this.result = this.independenceObj;
						} else {
							this.result = this.selectedObj;
						}

					}
				} else {
					//判断是否是第一个
					if (index == 0) {
						this.resetSelected(list, key)
						if (!this.independence) {
							this.selectedTitleObj[key] = list[index].title;
						}
					} else {
						//列表第一个为false
						list[0].isSelected = false
						if (this.independence) {
							this.independenceObj[this.selectedKey] = list[index].value;
							this.result = this.independenceObj;
						} else {
							this.selectedObj[key] = list[index].value;
							this.result = this.selectedObj;
							this.selectedTitleObj[key] = list[index].title;
						}

						for (let i = 0; i < list.length; i++) {
							if (index == i) {
								list[i].isSelected = true
							} else {
								list[i].isSelected = false
							}
						}
					}
					console.log(index, list, isMutiple, key, detailItem, '打印打印打印')
				}
				// #ifdef H5
				this.$forceUpdate();
				// #endif
			},
			resetSelected(list, key, lists, keys) {
				// console.log('%c 重置方法第二步resetSelected函数参数↓','color:green;font-size:30px')
				if (typeof this.result[key] == 'object') {
					this.result[key] = [];
					this.selectedTitleObj[key] = list[0].title;
				} else {
					this.result[key] = '';
					this.selectedTitleObj[key] = list[0].title;
					// console.log(this.result,'重置之后的数据')
				}
				for (let i = 0; i < list.length; i++) {
					if (i == 0) {
						list[i].isSelected = true;
					} else {
						list[i].isSelected = false;
					}
				}
				if (key == 'siteBrand') {
					if (typeof this.result[keys] == 'object') {
						this.result[keys] = [];
						this.selectedTitleObj[keys] = lists[0].title;
					} else {
						this.result[keys] = '';
						this.selectedTitleObj[key] = lists[0].title;
						// console.log(this.result,'重置之后的数据')
					}
					for (let i = 0; i < lists.length; i++) {
						if (i == 0) {
							lists[i].isSelected = true;
						} else {
							lists[i].isSelected = false;
						}
					}
				}
				console.log(this.result)
				// #ifdef H5
				this.$forceUpdate();
				// #endif
			},
			sortTap(index, list, key) {
				if (this.independence) {
					this.independenceObj[this.selectedKey] = list[index].value;
					this.result = this.independenceObj;
				} else {
					this.selectedObj[key] = list[index].value;
					this.result = this.selectedObj;
					this.selectedTitleObj[key] = list[index].title;
				}

				for (let i = 0; i < list.length; i++) {
					if (index == i) {
						list[i].isSelected = true;
					} else {
						list[i].isSelected = false;
					}
				}
				let obj = {
					'result': this.result,
					'titles': this.selectedTitleObj,
					'isReset': false
				}
				this.$emit("confirm", obj);
			},
			//点击 确定方法
			sureClick(selectDetailList, item, index) {
				console.log(index, this.oilCode, this.paixu, '5555555555555')
				if (index == 2 && !this.oilCode) {
					this.menuList[0].detailList[0].isSelected = true
					this.menuList[0].detailList[1].isSelected = false
					this.paixu = 1
					this.selectedTitleObj['sort'] = '距离优先'
				}
				if (index == 0 && !this.oilCode && this.paixu == 2) {
					uni.showToast({
						title: '请先选择油品再价格排序',
						icon: 'none'
					})
					this.itemTap(0, selectDetailList, false, item, selectDetailList[1], index)
					this.paixu = 1
					return
				}
				if (this.areaIndex[0] == 0) {
					this.provinceCode = ''
					this.cityCode = ''
					this.areaCode = ''
				}
				if (this.areaIndex[1] == 0) {
					this.cityCode = ''
					this.areaCode = ''
				}
				if (this.areaIndex[2] == 0) {
					this.areaCode = ''
				}
				let obj = {
					'result': this.result,
					'titles': this.selectedTitleObj,
					'isReset': false,
				}
				obj.result.provinceCode = this.provinceCode
				obj.result.cityCode = this.cityCode
				obj.result.areaCode = this.areaCode
				obj.result.distance = this.provinceCode ? '' : this.cityCode ? '' : this.areaCode ? '' : this.detailItems
				obj.result.sort = this.paixu == 1 ? 'juli' : 'price'
				// obj.result.distance = this.detailItems
				console.log(obj, this.oilCode, 'look me!')
				// console.log(this.seleIdex.split('/'),this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]],this.seleIdex.split('/')[2],'dddddddddddddddddd') 
				if (this.seleIdex !== null && this.seleIdex.split('/')[2] == 2) {

					obj.result.oilProductCode = this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[
						0]] ? this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]] : ''
					obj.titles.oilProductCode = obj.result.oilProductCode ? obj.result.oilProductCode : '全部'
					this.oilCode = obj.result.oilProductCode
					console.log(obj, 'look me!2')
					this.$emit("confirm", obj);
					return
				}
				this.$emit("confirm", obj);
			},
			resetClick(list, key, lists, keys, index) {
				console.log('%c 重置方法第一步resetClick函数参数↓', 'color:red;font-size:30px')
				console.log(list, key)
				if (this.seleIdex !== null && this.seleIdex.split('/')[2] == 2) {
					console.log(this.seleIdex.split('/'), this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex
						.split('/')[0]
					])
					this.pseleFn()
					// console.log(obj,'look me!2')
					// this.$emit("confirm", obj);
				}
				if (key == 'channelCode') {
					this.provinceCode = ''
					this.cityCode = ''
					this.areaCode = ''
				}
				this.resetSelected(list, key, lists, keys)
				if (index == 2) {
					this.oilCode = ''
					this.paixu = 1
					console.log(this.oilCode, index, '9999999999999999')
				}
				if (index == 1) {
					this.provinceCode = ''
					this.cityCode = ''
					this.areaCode = ''
					this.detailItems = ''
					this.region = []
					this.pickerShow = false
					let aaa = {
						detail: {
							value: [0, 0]
						}
					}
					let ccc = 1
					this.bindChange(aaa, ccc)
				}
				if (index == 0) {
					this.paixu = 1
				}
			}
		}
	}
</script>

<style>
	.show_min_height {
		max-height: 40vh;
		/* overflow-y: scroll; */
		display: flex;
		justify-content: flex-start;
		align-items: center;
		flex-direction: row;
		flex-wrap: wrap;
	}

	.newselsetitle {
		font-weight: 600;
		margin-bottom: 15rpx;
	}

	.newselse {
		width: 100%;
		display: flex;
		gap: 15rpx;
		flex-wrap: wrap;
	}

	.newselseitem {
		padding: 5rpx 10rpx;
		/* background-color: #000000; */
		display: flex;
		align-items: center;
		justify-content: center;
		border: 1rpx solid #bbbbbb;
		min-width: 90rpx;
	}

	.filter-content {
		background-color: #F6F7F8;
	}

	.filter-content-title {
		border-bottom: #EEEEEE 1px solid;
		padding: 10px 15px;
		font-size: 13px;
		color: #999999;
	}

	.filter-content-detail {
		padding: 5px 15px;
	}

	.filter-content-detail-item-active {
		background-color: #D1372C;
		color: #FFFFFF;
		padding: 5px 15px;
		border-radius: 20px;
		margin-right: 10px;
		margin-top: 10px;
		display: inline-block;
		font-size: 14px;
	}

	.filter-content-detail-item-default {
		background-color: #FFFFFF;
		color: #666666;
		padding: 5px 15px;
		border-radius: 20px;
		margin-right: 10px;
		margin-top: 10px;
		display: inline-block;
		font-size: 14px;
	}

	.filter-content-footer {
		display: flex;
		justify-content: space-between;
		width: 100%;
		height: 45px;
		margin-top: 10px;
	}

	.filter-content-footer-item {
		width: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 16px;
	}

	.filter-content-list {

		padding: 5px 15px;
	}

	.filter-content-list-item-default {
		color: #666666;
		width: 100%;
		padding: 10px 0px;
	}

	.filter-content-list-item-default text {
		width: 90%;
		font-size: 14px;
		display: inline-block;
	}

	.filter-content-list-item-active {
		color: #D1372C;
		width: 100%;
		padding: 10px 0px;
	}

	.filter-content-list-item-active text {
		font-size: 14px;
		width: 90%;
		display: inline-block;
	}

	.filter-content-list-item-active:after {
		content: '✓';
	}
</style>
<style lang="scss" scoped>
	.region-box {
		background-color: #FFFFFF;

		.center {
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.btn-Block {
			width: 100%;
			background-color: #FFFFFF;
			padding: 25upx;
			height: 230upx;

			.btn-left {
				width: 250upx;
				height: 80upx;
				border-radius: 10upx;
				color: #289CFD;
				background-color: rgba(153, 153, 153, 0.2);
				margin-right: 30upx;
			}

			.btn-right {
				width: 250upx;
				height: 80upx;
				border-radius: 10upx;
				color: #FFFFFF;
				background-color: #289CFD;
			}
		}

		.picker-view {
			background-color: #FFFEFD;
		}

		picker-view {
			width: 100%;
			height: 600upx;
		}
	}

	.zdyTitle {
		font-weight: 600;
		margin: 10px 10px 0;
		display: block;
	}
</style>
