<template>
	<view class="">
		<view class="search-box">
			<view class="search-input-box">
				<svg t="1733904658291" class="search-icon" viewBox="0 0 1024 1024" version="1.1"
					xmlns="http://www.w3.org/2000/svg" p-id="5981" xmlns:xlink="http://www.w3.org/1999/xlink">
					<path
						d="M174.545 465.455c0-18.619 16.291-34.91 34.91-34.91s34.909 16.291 34.909 34.91c0 121.018 100.072 221.09 221.09 221.09 18.619 0 34.91 16.291 34.91 34.91s-16.291 34.909-34.91 34.909c-160.581 0-290.909-130.328-290.909-290.91z m290.91 360.727c200.145 0 360.727-160.582 360.727-360.727S665.6 104.727 465.455 104.727 104.727 265.31 104.727 465.455 265.31 826.182 465.455 826.182z m323.49-76.8L961.164 921.6c13.963 13.964 13.963 34.91 0 48.873-13.964 13.963-34.91 13.963-48.873 0L737.745 795.927c-74.472 60.51-169.89 97.746-272.29 97.746C228.073 896 34.909 702.836 34.909 465.455S228.073 34.909 465.455 34.909 896 228.073 896 465.455c0 109.381-39.564 209.454-107.055 283.927z"
						p-id="5982">
					</path>
				</svg>
				<input confirm-type="search" ref="searchInputRef" class="search-input" :auto-blur="true" type="text"
					placeholder="请输入关键字" v-model="keyword" @focus="onSearchFocus()" @blur="onSearchBlur()"
					@confirm="getMapList" />
			</view>
			<view class="search-select">
				<view class="select-item" @click.stop="$refs.cityRef.open()" >
					<text class="item-text">{{codeLabel || '办理区域'}}</text>
					<u-icon name="arrow-down-fill" color="#101010" size="16"></u-icon>
				</view>
				<view class="select-item">
					<text class="item-text">位置类型</text>
					<u-icon name="arrow-down-fill" color="#101010" size="16"></u-icon>
				</view>
			</view>
		</view>
		
		<!-- 选择地址 -->
		<city ref="cityRef" @cityName="e => codeLabel = e" @onConfirm="onSearchFocus"/>
	</view>
</template>

<script>
	import { getMapList_Api } from "@/api/map.js"
	export default {
		data() {
			return {
				keyword: undefined,
				code:'',
				codeLabel:'河北省/石家庄市/长安区 河北省/石家庄市/长安区'
			}
		},
		methods: {
			onSearchFocus() {
				// 
			},
			getMapList() {

			}
		}
	}
</script>

<style lang="scss" scoped>
	$radius_ : 20rpx;
	$heig_: 80rpx;

	.search-box {
		padding: 20rpx 20rpx 0;
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		z-index: 999;

		.search-input-box {
			width: 100%;
			height: $heig_;
			background-color: #fff;
			border-radius: $radius_ $radius_ 0 0;
			display: flex;
			align-items: center;
			padding: 0 10px;
			color: #020202;
			.search-icon {
				width:45rpx;
				height:45rpx;

				path {
					fill: #020202;
				}
			}
			.search-input{
				padding-left: 10px;
			}
		}

		.search-select {
			border-top: 1rpx solid #E8E8E8;
			width: 100%;
			height: $heig_;
			background-color: #fff;
			border-radius: 0 0 $radius_ $radius_ ;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.select-item {
				width: 50%;
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: 30rpx;

				.item-text {
					display: inline-block;
					padding-right: 6rpx;
					overflow: hidden;
				}
			}
		}
	}
</style>