<template>
	<view>
		<view class="jiazheng-uni-list">

			<view class="jiazheng-search-box">

				<view @click="clickAlltype" class="select-item-box">
					<text>全部类型</text><icon :class="allJtClass"/>
				</view>
				<view class="all-type-list">
					<view v-if="isOpen" v-for="(item,index) in allType" :key="index" @click="onSelectCell(item,index)" class="all-type-item all-type-active">
						<view class="le-dropdown-cell-active-text">{{item.label}}</view>
						<view v-show="item.value==typeChecked"></view>
					</view>
				</view>
				<view class="jiazheng-search-right">
					<!--  当前点击 增加 saixuan-active-->
					<view class="saixuan-item-box saixuan-active">
						<text>更新时间</text><icon :class="updataJtClass"/>
					</view>
					<view class="saixuan-item-box">
						<!-- class切换  saixuan-jt-default  saixuan-jt-click-->
						<text>录入时间</text><icon :class="luruJtClass"/>
					</view>
					<uni-icons type="search" size="16" color="#000" @click="toggle('top')"></uni-icons>
				</view>
				
			</view>
			
			<view>
				<view>
					<view>王一一</view>
					<view>分享</view>
					<view>打电话</view>
				</view>
				<view>
					<image src="" mode=""></image>
					<view>
						<p>	1000岁｜3年经验</p>
						<p>四川成都人</p>
					</view>
					<view>
						待岗
					</view>
				</view>
			</view>
			
			
			
			
			
			<view>
				<!-- 普通弹窗 -->
				<uni-popup ref="popup" background-color="#fff">
					<view>
						asdfdsfadsf阿萨德发生的发的顺丰
					</view>
				</uni-popup>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue";
	// import {
	// 	DropdownList
	// } from "./data.js";
	// const menuList = ref(DropdownList)
	const allType = [{
			label: "由近到远",
			value: 0
		},
		{
			label: "由远到近",
			value: 1
		},
		{
			label: "由远到近",
			value: 2
		},
		{
			label: "由远到近",
			value: 3
		},
	]

	let isOpen = ref(false)
	let typeChecked = ref(1)
	const popup = ref(null);
	const allJtClass = 'select-jt-default';
	const updataJtClass = 'saixuan-jt-default';
	const luruJtClass = 'saixuan-jt-click';
	const clickAlltype = (data) => {
		isOpen.value = true
	}
	const onSelectCell = (data, index) => {
		console.log('data', data);
		console.log('index', index);
		isOpen.value = false;
		allJtClass = 'select-jt-click'
	}
	const toggle = (data, index) => {
		popup.value.open('top')
	}
</script>

<style>
	.jiazheng-uni-list {
		display: flex;
		width: 100%;
		flex-direction: column;
	}

	.jiazheng-uni-list-left {
		position: relative;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
</style>