<!-- requestType 1:掌上信息 2:好店首页 3:积分商城 -->
<!-- @selectAreaid  选择地区id -->
<!-- @selectClassid 选择分类id -->
<!-- @selectClassTwoid 选择二级分类id -->
<!-- @selectOrders 选择排序id -->
<!-- @pageScrollHeight 积分商城点击tab后滑动顶部,取消回到顶部 -->
<!-- @getOrderId 默认第一个排序id -->
<template>
	<view class="container">
		<view class="pop-mask" v-if="is_openTabbar" @click="close"></view>
		<view :class="isPageScroll==='1'&& is_openTabbar?'isPageScroll':'p-r'">
			<view class="tabBar-list dis-flex b-f" :class="{'border-line':is_openTabbar,'border-bottom':is_openTabbar}">
				<block v-for="(tabItem,index) in SelectInfo.top" :key="index" v-if="index < 3">
					<view class="tabBar-item dis-flex flex-x-center flex-y-center f-28 flex-box" :style="currentType===tabItem.subscript?'color:#FF4444;':'color:#333333'"
					 @click="openTabbar(tabItem.subscript)" v-if="tabItem.status===1 && (requestType ==1 && index!=0)">
						<view class="m-right10 onelist-hidden tabBar-itemTitle">{{(title && index ==1 && requestType!= '文章头条' )?title:(title && index ==0 && requestType== '文章头条' )?title:tabItem.title}}</view>
						<view class="iconfont" :class="currentType===tabItem.subscript?'icon-fold':'icon-unfold'"></view>
					</view>
				</block>
			</view>
			<view class="pop-content padding-box-all b-f" @touchmove.stop.prevent="" :class="{show:is_openTabbar}">
				<block v-if="!!cityData && currentType==='area'">
					<view >
					<view class="dis-flex">
						<view class="flex-box" style="padding-top: 30upx;">
							<view v-if="businessCard" class="city-name f-28 m-btm50" :class="isAllarea?'col-f4':'col-3'" @click="allCityarea('all')">全部</view>
							<view class="city-name f-28" :class="!isAllarea?'col-f4':'col-3'" @click="allCityarea('city')">{{cityData.name}}</view>
						</view>
						<scroll-view 
						scroll-y="true" 
						class="cityScroll"  
						v-if="!isAllarea" 
						:scroll-top="cityScrollTop"  
						@scroll="cityChage"
						:upper-threshold="topNumberct"
						lower-threshold="0"
						@scrolltolower="scrolltolowerct"
						@scrolltoupper="scrolltoupperct"
						>
							<view class="city-list" style="padding-left: 30upx;padding-top: 30upx;">
								<view class="city-list-item m-btm50 f-28" :class="city_id===cityItem.id?'col-f4':'col-3'" @click="getcityId(cityItem)"
								 v-for="(cityItem,index) in cityData.list" :key="index">{{cityItem.name}}</view>
								<!-- <view class="right">
								 	<image v-if="cityData.list.length > 9" :src="imgfixUrls  + 'scrollbottom.gif'" mode=""></image>
								 </view> -->
							</view>
						</scroll-view>
						
					</view>
					<view class="dis-flex" style="height: 50upx;">
						<view class="left" >
							<!-- <image v-if="SelectInfo.class.length > 9" :src="imgfixUrls  + 'scrollbottom.gif'" mode=""></image> -->
						</view>
						<view class="left" style="padding-top: 0upx;position: relative;padding-bottom: 18upx;">
							<!-- <view  style="width: 2upx;background-color: #eeeeee;height: 100%;position: absolute;left: 0;top: 0;">
								
							</view> -->
							<image @click="citybottombtn" v-if="cityData.list.length > 9 && !citybottom" :src="imgfixUrls  + 'scrollbottom.gif'" mode=""></image>
						</view>
					</view>
					</view>
				</block>
				<block v-if="currentType==='class'">
									<scroll-view 
									class="classScroll" 
									:scroll-top="scrollTop" 
									scroll-y="true" 
									style="padding-top: 30upx;" 
									:upper-threshold="topNumber"
									lower-threshold="0"
									@scrolltolower="scrolltolowers"
									@scrolltoupper="scrolltolower" 
									@scroll="classoneChage">
										
										<view class="class_list dis-flex" v-for="(classItem,index) in SelectInfo.class" :key="index">
											<view class="class_listOne  dis-flex flex-box m-btm50"  style="width: 50%;" :class="classOneId===classItem.cate_one || classOneId===classItem.id || cate_one == classItem.cate_one || cate_one == classItem.id?'col-f4':'col-3'"
											 @click="getclassOneId(classItem)">
												<view class="class_listOneItem f-28">{{classItem.name}}</view>
											</view>
											<block v-if="(classOneId===classItem.cate_one || classOneId===classItem.id) && (!!classItem.list &&classItem.list.length>0) || cate_one == classItem.cate_one || cate_one == classItem.id">
												<view class="class_Twolist"  @touchmove.stop.prevent="">
													<scroll-view 
													scroll-y="true" 
													:style="{height: boxHeight - 20 + 'px'}"
													:scroll-top="scrollTopTwo" 
													class="class_TwoScroll" 
													@scroll="classtwoChage"
													:upper-threshold="topNumbertwo"
													lower-threshold="0"
													@scrolltolower="scrolltolowerst"
													@scrolltoupper="scrolltolowert" 
													>
														<view class="class_listTwo m-btm30" @click="getclassTwoId(classTwoItem)" v-for="(classTwoItem,indexTwo) in classItem.list"
														 :key="indexTwo">
														 <view class="class_listTwoItem f-28" :class="(classTwoId===classTwoItem.id||classTwoId===classTwoItem.cate_two || cate_two == classTwoItem.cate_two || cate_two == classTwoItem.id)?'col-f4':'col-3'">{{classTwoItem.name}}</view>
															<!-- <view class="class_listTwoItem f-28" :class="(classTwoId===classTwoItem.id||classTwoId===classTwoItem.cate_two || cate_two == classTwoItem.cate_two || cate_two == classTwoItem.id)?'col-f4':'col-3'">{{classTwoItem.name}}</view> -->
														</view>
														
													</scroll-view>
													<view class="right">
														<image @click="sorTwoTop" v-if="classItem.list.length > 11 && !classtwobottom" :src="imgfixUrls  + 'scrollbottom.gif'" mode=""></image>
													</view>
												</view>
											</block>
										</view>
									</scroll-view>
								</block>
				<block v-if="currentType==='orders'">
					<scroll-view scroll-y="true" class="class_TwoScroll" style="padding-top: 30upx;">
						<view class="class_listTwo">
							<view class="class_listTwoItem f-28 m-btm50" @click="getOrderId(orderItem)" v-for="(orderItem,index) in SelectInfo.orders"
							 :key="index" :class="orderId===orderItem.val?'col-f4':'col-3'">{{orderItem.title}}</view>
						</view>
					</scroll-view>
				</block>
				<block v-if="currentType==='nwe_area' || currentType === 'area_id'">
					<view class="dis-flex" style="padding-top: 30upx;">
						<scroll-view class="flex-box" style="height: 400upx;" :scroll-y="true">
							<view class="f-24 t-c industry-item" :style="{color: item.id != provinceId?'#363636':'#ff4444'}" v-for="(item,index) in provinceList" :key="index" @click="getCityList(index,item)">
								{{item.name}}
							</view>
						</scroll-view>
						<scroll-view class="flex-box" style="height: 400upx;" :scroll-y="true">
							<view class="f-24 t-c industry-item" :style="{color: item.id != cityId?'#363636':'#ff4444'}" v-for="(item,index) in cityList" :key="index" @click="getAreaList(index,item)">
								{{item.name}}
							</view>
						</scroll-view>
						<scroll-view class="flex-box" style="height: 400upx;" :scroll-y="true">
							<view class="f-24 t-c industry-item" :style="{color: item.id != areaId?'#363636':'#ff4444'}" v-for="(item,index) in areaList" :key="index" @click="getAreaId(index,item)">
								{{item.name}}
							</view>
						</scroll-view>
					</view>
				</block>
				<block v-if="currentType==='industry' || currentType=== 'education' && industryOne">
					<view class="dis-flex" style="padding-top: 30upx;">
						<scroll-view class="flex-box" style="height: 400upx;" :scroll-y="true">
							<view class="f-24 t-c industry-item" :style="{color: !item.checked?'#363636':'#ff4444'}" v-for="(item,index) in industryOne" :key="index" @click="getindustryTwo(index,item)">
								{{item.title}}
							</view>
						</scroll-view>
						<scroll-view class="flex-box" style="height: 400upx;" :scroll-y="true" v-if="pageName != '企业'">
							<view class="f-24 t-c industry-item" :style="{color: !item.checked?'#363636':'#ff4444'}" v-for="(item,index) in industryTwo" :key="index" @click="getindustryThree(index,item)">
								{{item.title}}
							</view>
						</scroll-view>
						<scroll-view class="flex-box" style="height: 400upx;" :scroll-y="true" v-if="pageName != '企业'">
							<view class="f-24 t-c industry-item" :style="{color: !item.checked?'#363636':'#ff4444'}" v-for="(item,index) in industryThree" :key="index" @click="getindustryFour(index,item)">
								{{item.title}}
							</view>
						</scroll-view>
					</view>
				</block>
				<!-- 相亲新增 -->
				<block v-if="currentType==='sort'">
					<scroll-view scroll-y="true" style="padding-top: 30upx;" class="class_TwoScroll">
						<view class="class_listTwo">
							<view class="class_listTwoItem f-28 m-btm50" @click="getSortId(sortItem)" v-for="(sortItem,index) in SelectInfo.sort"
							 :key="index" :class="sortId===sortItem.val?'col-f4':'col-3'">{{sortItem.title}}</view>
						</view>
					</scroll-view>
				</block>
				<block v-if="currentType==='gneder'">
					<scroll-view scroll-y="true" style="padding-top: 30upx;" class="class_TwoScroll">
						<view class="class_listTwo">
							<view class="class_listTwoItem f-28 m-btm50" @click="getGnederId(gnederItem)" v-for="(gnederItem,index) in SelectInfo.gneder"
							 :key="index" :class="gnederId===gnederItem.val?'col-f4':'col-3'">{{gnederItem.title}}</view>
						</view>
					</scroll-view>
				</block>
				<view class="dis-flex" v-if="currentType==='class' && SelectInfo.class.length > 9" style="height: 50upx;">
					<view class="left" @click="sorTop">
						<image v-if="SelectInfo.class.length > 9 && !classonebottom" :src="imgfixUrls  + 'scrollbottom.gif'" mode=""></image>
					</view>
					<view class="left">
						<!-- <image v-if="SelectInfo.class.length > 9" :src="imgfixUrls  + 'scrollbottom.gif'" mode=""></image> -->
					</view>
				</view>
			</view>
		</view>
		<view >
			
		</view>
	</view>
</template>

<script>
	import App from '../../common/js/app.js';
	import wPicker from '@/components/w-picker/w-picker.vue';
	export default {
		data() {
			return {
				is_openTabbar: false,
				SelectInfo: {},
				currentType: null,
				cityData: {},
				city_id: null,
				classOneId: null,
				classTwoId: null,
				orderId: null,
				isAllarea: false,
				industryOne:null,
				industryTwo:[],
				industryThree:[],
				industryID:[],
				provinceList:[],
				cityList:[],
				areaList:[],
				provinceId:'',
				cityId:'',
				areaId:'',
				agencyData:{},
				sortId: null,  //相亲新增
				gnederId: null,
				citybottom:false,
				classonebottom:false,
				classtwobottom:false,
				scrollTop:0,
				scrollTopTwo:0,
				cityScrollTop:0,
				topNumbertwo:10,//预设为10避免一开始就触发事件
				topNumber:10,
				topNumberct:10,
				boxHeight:0
			}
		},
		mounted() {
			this.getSelectInfo();
			this.agencyData = uni.getStorageSync('agencyData');
			
			
		},
		components:{
			wPicker
		},
		props: {
			//请求页面类型
			requestType: {
				type: String,
				default: function() {
					return '2'
				}
			},
			//积分商城滑动 0关闭 1开启
			isPageScroll: {
				type: String,
				default: function() {
					return '0'
				}
			},
			businessCard: {
				type: Boolean,
				default: function() {
					return false
				}
			},
			cate_one: {
				type:String,
				default: ''
			},
			cate_two: {
				type:String,
				default:''
			},
			title:{
				type:String,
				default:''
			},
			pageName:{
				type:String,
				default:''
			}
		},
		watch:{
			cate_one: {
				handler(newval) {

					this.setData({
						classOneId: newval
					})
				},
				deep: true
			},
			cate_two: {
				handler(newval) {

					this.setData({
						classTwoId: newval
					})
				},
				deep: true
			},
			title :{
				handler(newval) {
					
					// debugger
				},
				deep: true
			},
		},
		methods: {
			citybottombtn(){
				this.cityScrollTop = 9999;
				this.citybottom = true;
			},
			sorTwoTop(){
				this.scrollTopTwo = 9999;
				this.classtwobottom = true;
			},
			sorTop(){
				this.scrollTop = 9999;
				this.classonebottom = true;
			},
			scrolltolowerst(e){
				//到底部
				this.classtwobottom = true;
			},
			scrolltolowert(e){
				this.scrollTopTwo =  this.topNumbertwo;
				this.classtwobottom = false;
			},
			classtwoChage(e){
				console.log(e);
				this.topNumbertwo = e.detail.scrollHeight - 366;
			},
			scrolltolower(e){
				// console.log(e);
				this.scrollTop =  this.topNumber;
				this.classonebottom = false;
			},
			scrolltolowers(e){
				this.classonebottom = true;
			},
			classoneChage(e){
				console.log(e);
				this.topNumber = e.detail.scrollHeight - 371;
			},
			scrolltolowerct(e){
				console.log('触发了距底');
				this.citybottom = true;
			},
			scrolltoupperct(e){
				console.log('触发了距顶');
				this.citybottom = false;
				this.cityScrollTop =  this.topNumberct;
			},
			cityChage(e){
				console.log(e);
				this.topNumberct = e.detail.scrollHeight - 371;
			},
			getAreaId(index,item){
				if(item.id == this.areaId) return
				this.areaId = item.id;
				this.$emit('getcityWork',item.id);
				this.SelectInfo.top.map(items=>{
										if(items.subscript == 'nwe_area' || items.subscript == 'area_id'){
											items.title = item.name;
										}
									})
				this.close();
			},
			getAreaList(index,item){
				
				let _this = this;
				
				_this.cityId = item.id;
				_this.areaList = item.dist;
				if(item.dist.length == 0){
					_this.$emit('getcityWork',item.id);
					_this.areaList = [];
					this.SelectInfo.top.map(items=>{
											if(items.subscript == 'nwe_area' || items.subscript == 'area_id'){
												items.title = item.name;
											}
										})
					return
				}
				if(_this.areaList[0].id == item.id) return
				_this.areaList.unshift({
					id:item.id,
					name:`全${item.name}`,
					flag:true
				})
			},
			getCityList(index,item){
				let _this = this;
				// console.log(item);
				_this.provinceId = item.id;
				_this.cityList = item.area;
				_this.areaList = [];
				if(!item.id || !_this.cityList[0]){
					_this.$emit('getcityWork',item.id);
					this.SelectInfo.top.map(items=>{
						if(items.subscript == 'nwe_area' || items.subscript == 'area_id'){
							items.title = item.name;
						}
					})
					return
				}
				if(!!_this.cityList[0] && _this.cityList[0].id == item.id) return
				_this.cityList.unshift({
					id:item.id,
					name:`全${item.name}`,
					dist:[]
				});
				
				
			},
			getCitys(){
				let _this = this;
				
				_this.provinceList = uni.getStorageSync('cityList');
				_this.provinceList.unshift({
					id:'',
					name:'全国',
					area:[]
				})
				// _this.agencyData.areaid = ''
				console.log(_this.provinceList,_this.agencyData);
				// debugger
				_this.provinceList.map(item=>{
					if(item.id == _this.agencyData.areaid){
						_this.getCityList('',item);
						return false
					}
					item.area.map(items=>{
						if(items.id == _this.agencyData.areaid){
							_this.getCityList('',item);
							_this.getAreaList('',items);
							return false
						}
						items.dist.map(itemss=>{
							if(itemss.id == _this.agencyData.areaid){
								_this.getCityList('',item);
								_this.getAreaList('',items);
								_this.getAreaId('',itemss);
								return false
							}
						})
					})
				})
				
			},
			getindustryFour(index,items){
				console.log(this.industryThree[0].id)
				
				this.industryThree.map(item=>{
					item.checked = false;
				});
				this.industryThree[index].checked = true;
				this.is_openTabbar = !this.is_openTabbar;
				this.is_openTabbar = !this.is_openTabbar;
				this.SelectInfo.top.map(item=>{
									if(item.subscript == 'industry' || item.subscript == 'education'){
										item.title = items.title;
									}
								})
				if(index == 0){
					this.industryID = [this.industryID[0],this.industryID[1],''];
					this.$emit('getResumeList',this.industryID);
					return
				}else{
					this.industryID = [this.industryID[0],this.industryID[1],this.industryThree[index].id];
					this.$emit('getResumeList',this.industryID);
				};
				this.is_openTabbar = false;
				this.currentType = null;
			},
			getindustryThree(index,items){
				// debugger
				this.industryThree = [];
				this.industryTwo.map(item=>{
					item.checked = false;
				})
				this.industryTwo[index].checked = true;
				this.is_openTabbar = !this.is_openTabbar;
				this.is_openTabbar = !this.is_openTabbar;
				
				if(index == 0){
					this.industryID = [this.industryID[0],'',''];
					this.$emit('getResumeList',this.industryID);
					return
				}else{
					this.industryID = [this.industryID[0],this.industryTwo[index].id,'']
				}
				this.SelectInfo.top.map(item=>{
									if(item.subscript == 'industry' || item.subscript == 'education'){
										item.title = items.title;
										// debugger
									}
								})
				let data={
					type:3,
					pid:this.industryTwo[index].id
				}
				App._post_form('&'+ this.SelectInfo.industry, data, res => {
					console.log(res);
					this.industryThree = res.data;
					if(res.data.length != 0){
						this.industryThree.unshift({
							id:'0',
							title:'全部'
						})
					}
					this.getindustryFour(0,this.industryThree[0]);
				})
			},
			getindustryTwo(index,items){
				this.industryTwo = [];
				this.industryThree = [];
				this.industryOne.map(item=>{
					item.checked = false;
				});
				this.industryOne[index].checked = true;
				this.is_openTabbar = !this.is_openTabbar;
				this.is_openTabbar = !this.is_openTabbar;
				this.SelectInfo.top.map(item=>{
					if(item.subscript == 'industry' || item.subscript == 'education'){
						item.title = items.title;
					}
				})
				if(index == 0){
					this.industryID = ['','',''];
					this.$emit('getResumeList',this.industryID);
					return
				}else{
					this.industryID = [this.industryOne[index].id,'','']
				}
				
				// this.
				let data={
					type:2,
					pid:this.industryOne[index].id
				}
				App._post_form('&'+ this.SelectInfo.industry, data, res => {
					console.log(res);
					
					this.industryTwo = res.data;
					if(res.data.length != 0){
						this.industryTwo.unshift({
							id:'0',
							title:'全部'
						})
					};
					// console.log(index)
					// debugger
					this.getindustryThree(0,this.industryTwo[0]);
				})
			},
			openTabbar(subscript) {
				let _this = this;
				if (this.isPageScroll === '1') {
					this.$emit('pageScrollHeight', '1')
				}
				this.is_openTabbar = true;
				this.currentType = subscript;
				this.$nextTick(function(){
					const query = uni.createSelectorQuery().in(_this);
						query.select('.pop-content').boundingClientRect(data => {
							console.log(data,2333333)
							_this.boxHeight = data.height;
						}).exec();
				})
			},
			close() {
				if (this.isPageScroll === '1') {
					this.$emit('pageScrollHeight', '0')
				}
				this.is_openTabbar = false;
				this.currentType = null;
			},
			getindustry(url){
				// 
				this.industryOne = [];
				this.industryTwo = [];
				this.industryThree = [];
				App._post_form('&'+ url, {
				}, res => {
					console.log(res);
					this.industryOne = res.data;
					this.industryOne.unshift({
						id:'0',
						title:'全部'
					})
					this.industryOne.map(item=>{
						item.checked = false
					});
					// this.industryOne[0].checked = true;
					this.getindustryTwo(0,this.industryOne[0]);
				})
			},
			getSelectInfo() {
				let _this = this,
					agencyData = uni.getStorageSync('agencyData'),
					url = `&do=SelectInfo&type=${_this.requestType}&cate_one=${_this.cate_one}&cate_two=${_this.cate_two}`;
				if(_this.requestType == '服务列表'){
					url = `&p=housekeep&do=housekeepSelectInfo&type=2`
				}else if(_this.requestType == '需求列表'){
					url = `&p=housekeep&do=housekeepSelectInfo&type=1`
				} else if(_this.requestType == '文章头条'){
					url = `&p=headline&do=headlineSelectInfo`
				}
				
				App._post_form(url, {
					
				}, res => {
					let SelectInfo = res.data;
					let title;
					if(res.data.class){
						
						res.data.class.map(item=>{
							if(item.cate_one == _this.cate_one){
								_this.$emit('selectClassid', item);
								// debugger
								if(item.list.length > 0){
									item.list.map(items=>{
										if(items.cate_two == _this.cate_two){
											// debugger
											_this.$emit('selectClassTwoid', items)
											// debugger
										}
									})
								}
							}
						})
					}
					if(res.data.orders){
						setTimeout(()=>{
							_this.getOrderId(res.data.orders[0]);
							
							_this.getCitys();
						})
						_this.$emit('getOrderId', SelectInfo.orders[0].val,title);
					}
					// 相亲新增
					if(res.data.sort) {
						setTimeout(() => {
							_this.getSortId(res.data.sort[0]);
							_this.getCitys();
							_this.getGnederId(res.data.gneder[0]);
						})
						_this.$emit('getSortId', SelectInfo.sort[0].val,title);
					}
					
					if (!!SelectInfo.area) {
						_this.getCityarea(SelectInfo.area,true);
						SelectInfo.top.map(item=>{
							if(item.subscript == 'area'){
								item.title = agencyData.areaname;
							}
						})
					}
					if(!!SelectInfo.industry){
						_this.getindustry(SelectInfo.industry);
					}
					if(SelectInfo.top.length > 3){
						_this.$emit('getmore',SelectInfo);
					}
					if(_this.SelectInfo.orders) {
						_this.setData({
							orderId: SelectInfo.orders[0].val
						})
					}
					_this.setData({
						SelectInfo
					});
					// _this.SelectInfo.top.splice(0)
				})
			},
			allCityarea(cityType = 'all') {
				let _this = this;
				if (cityType === 'all') {
					_this.$emit('selectAllarea')
					let tabbarList = _this.SelectInfo.top,
						tabIndex = tabbarList.findIndex(item => item.subscript === 'area');
					tabbarList[tabIndex].title = '全部';
					_this.setData({
						is_openTabbar: false,
						currentType: null,
						city_id: "",
						isAllarea: true
					})
				} else {
					_this.setData({
						isAllarea: false
					})
				}
			},
			getCityarea(requestUrl,flag) {
				let _this = this,
					agencyData = uni.getStorageSync('agencyData'),
					doUrl = '&' + requestUrl;
				App._post_form(doUrl, {
					city_id: agencyData.areaid
				}, res => {
					_this.setData({
						cityData: res.data,
						city_id: agencyData.areaid,
					})
					_this.cityData.list.map(item=>{
						if(item.select == 1){
							_this.$emit('selectAreaid', item,flag);
						}
					})
				})
			},
			async getcityId(cityItem) {
				let _this = this;
				_this.SelectInfo.class = await _this.getCityClass(cityItem.id);
				_this.$emit('selectAreaid', cityItem);
				_this.setData({
					is_openTabbar: false,
					currentType: null,
					city_id: cityItem.id,
				})
				let tabbarList = _this.SelectInfo.top,
					tabIndex = tabbarList.findIndex(item => item.subscript === 'area');
				tabbarList[tabIndex].title = cityItem.name;
			},
			getCityClass(areaid){
				let _this = this;
				let data = {
					is_two: 1,
					is_set: 0,
					is_ios: 0,
					areaid:areaid.id ||areaid
				};
				// debugger
				return new Promise((resolve, reject) => {
					let all = {
								id:'0',
								name:'全部',
								title:'全部',
								list:[]
							}
					App._post_form('&p=pocket&do=classList', data, res => {
						if(JSON.stringify(res.data) != '[]'){
							res.data.list.unshift(all)
							res.data.list.map((item,index)=>{
								item.name = item.title;
								if(index == 0){
									_this.$emit('selectClassid', item);
								}
									if(item.list.length > 0){
										item.list.map((items,indexs)=>{
											items.name = items.title;
											if(indexs == 0){
												_this.$emit('selectClassTwoid', items)
											}
										})
									}
							});
							resolve(res.data.list);
							_this.getclassOneId(all)
						}else{
							resolve(_this.SelectInfo.class);
						}
						
						
					});
				})
				
			},
			getclassOneId(classItem) {
				let _this = this;
				_this.$emit('selectClassid', classItem)
				if (!(!!classItem.list) || (!!classItem.list && classItem.list.length === 0)) {
					_this.setData({
						is_openTabbar: false,
						currentType: null,
						classTwoId: ""
					})
				}
				_this.setData({
					classOneId: !!classItem.cate_one ? classItem.cate_one : classItem.id
				});
				let tabbarList = _this.SelectInfo.top,
					tabIndex = tabbarList.findIndex(item => item.subscript === 'class');
				tabbarList[tabIndex].title = classItem.name;
			},
			getclassTwoId(classTwoItem) {
				let _this = this;
				// debugger
				_this.$emit('selectClassTwoid', classTwoItem);
				
				_this.setData({
					classTwoId: !!classTwoItem.id ? classTwoItem.id : classTwoItem.cate_two,
					is_openTabbar: false,
					currentType: null
				})
				let tabbarList = _this.SelectInfo.top,
					tabIndex = tabbarList.findIndex(item => item.subscript === 'class');
				tabbarList[tabIndex].title = classTwoItem.name;
			},
			getOrderId(orderItem) {
				let _this = this;
				
				_this.$emit('selectOrders', orderItem)
				_this.setData({
					orderId: orderItem.val,
					is_openTabbar: false,
					currentType: null
				})
				let tabbarList = _this.SelectInfo.top,
					tabIndex = tabbarList.findIndex(item => item.subscript === 'orders');
				tabbarList[tabIndex].title = orderItem.title;
				console.log(tabbarList[tabIndex].title,'tabbarList[tabIndex].title')
			},
			// 相亲模块新增
			getSortId(sortItem) {
				let _this = this
				_this.$emit('selectSort',sortItem)
				_this.setData({
					sortId: sortItem.val,
					is_openTabbar: false,
					currentType: null
				})
				let tabbarList = _this.SelectInfo.top,
					tabIndex = tabbarList.findIndex(item => item.subscript === 'sort');
				tabbarList[tabIndex].title = sortItem.title;
			},
			getGnederId(gneterItem) {
				let _this = this
				_this.$emit('selectGneder',gneterItem)
				_this.setData({
					gnederId: gneterItem.val,
					is_openTabbar: false,
					currentType: null
				})
				let tabbarList = _this.SelectInfo.top,
					tabIndex = tabbarList.findIndex(item => item.subscript === 'gneder');
				tabbarList[tabIndex].title = gneterItem.title;
			}
		},
		computed: {

		}
	}
</script>

<style lang="scss">
	.pop-mask {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 997;
		background: rgba(0, 0, 0, .5);
	}

	.isPageScroll {
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		z-index: 999;
	}

	.tabBar-list {
		height: 80upx;
		line-height: 80upx;
		position: relative;
		z-index: 997;
		// border-bottom: 1upx solid #eeeeee;
	}


	.pop-content {
		position: absolute;
		left: 0;
		top: 80upx;
		z-index: 998;
		opacity: 0;
		visibility: 0;
		transition: all .25s ease-in;
		// transform: translateY(-400upx);
		border-radius: 0upx 0upx 30upx 30upx;
		border-top: 1upx solid #eeeeee;
		padding-top: 0 !important;
		padding-bottom: 0!important;
		// margin-top: 30upx;
	}

	.pop-content.show {
		width: 100vw;
		max-height: 830upx;
		opacity: 1;
		visibility: 1;
		// transform: translateY(18%);
	}

	.cityScroll {
		width: 50%;
		max-height: 740upx;
	}

	.classScroll {
		width: 100%;
		max-height: 780upx;
		overflow-y: scroll;
		position: relative;
	}
	
	.left{
		// position: absolute;
		// bottom: 10upx;
		// left: 30upx;
		flex: 1;
		text-align: center;
		image{
			width: 30upx;
			height: 30upx;
		}
		// background-color: #ff4444;
	}
	.right{
		// text-align: center;
		position: relative;
		image{
			width: 30upx;
			height: 30upx;
			margin: auto;
			position: absolute;
			left: 22%;
			top: 10upx;
			transform: translateX(-50%);
			
		}
	}
	
	.city-list-item:last-child {
		margin: 0 !important;
	}

	.class_listOne {
		overflow-y: scroll;
	}

	.class_Twolist {
		z-index: 1000;
		position: fixed;
		left: 50%;
		top: 80upx;
		width: 100%;
		max-height: 798upx;
		// border-left: 1upx solid #eeeeee;
		padding-left: 30upx;
		padding-top: 30upx;
		padding-bottom: 54upx;
	}

	.class_TwoScroll {
		width: 100%;
		max-height: 730upx;
	}

	.tabBar-itemTitle {
		width: auto;
	}
	.industry-item{
		padding: 5upx 10upx;
		width: 200upx;
		line-height: 100upx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
</style>
