<template>
	<view class="h_s_b">
		<view class="s_i_b">
			<view class="select">
				<view>{{ searchType }}</view>
				<image :src="icon_arrow_down_black_16" mode=""></image>
			</view>
			<input type="text" v-model="value" @confirm="search" placeholder="请输入事件名称" />
			<view class="s_b" @click="search">搜索</view>
		</view>
		<u-popup v-model="show" mode="bottom" border-radius="16" height="40%">
			<view class="pp_b">
				<u-radio-group v-model="searchType" @change="radioGroupChange">
					<u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item">
						{{ item }}
					</u-radio>
				</u-radio-group>
				<view class="pp_h">分类</view>
				<u-radio-group v-model="type" @change="radioGroupChange">
					<u-radio @change="radioChange" v-for="(item, index) in typeList" :key="index" :name="item">
						{{ item }}
					</u-radio>
				</u-radio-group>
				<!-- <view class="btns">
					<view class="primary">
						
					</view>
				</view> -->
			</view>
		</u-popup>
	</view>
</template>
<script>
	export default {
		name: 'HomeSearch',
		data() {
			return {
				icon_arrow_down_black_16: require('@/static/images/icon_arrow_down_black_16.svg'),
				icon_arrow_up_gray_16: require('@/static/images/icon_arrow_up_gray_16.svg'),
				searchType: '户政',
				show: false,
				list: [
					'全部', '户政', '出入境', '交警', '治安', '监管', '网安', '禁毒', '边管', '安康医院', 'NGO管理', '内保', '见义勇为',
				],
				typeList: ['全部', '个人业务', '企业业务', ],
				type: '',
				value: ''
			}
		},
		methods: {
			search() {
				this.$emit('search', this.value)
			},
			selectSearch() {
				this.show = true
			},
			radioGroupChange(e) {
				console.log('radioGroupChange', e)
			},
			radioChange(e) {
				console.log('radioChange', e)
			}
		}
	}
</script>
<style lang="scss" scoped>
	.btns {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.h_s_b {
		padding: 24rpx;
		width: 100%;
		height: 148rpx;

		.pp_b {
			padding: 24rpx;

			.u-radio-group {
				display: flex;
			}

			.u-radio {
				width: 30vw !important;
				display: flex;
			}
		}

		.pp_h {
			width: 100%;
			height: 100rpx;
			line-height: 100rpx;
			color: rgba(17, 17, 17, 1);
		}
	}

	.s_i_b {
		display: flex;
		border-radius: 16rpx;
		border: 1rpx solid rgba(248, 248, 248, 1);
		align-items: center;

		uni-input {
			flex: 1;
		}

		.select {
			color: rgba(17, 17, 17, 1);
			display: flex;
			align-items: center;
			justify-content: center;
			padding: 12rpx;

			uni-image {
				width: 32rpx;
				height: 32rpx;
				color: rgba(248, 248, 248, 1);
			}
		}

		.s_b {
			background-color: rgba(16, 109, 255, 1);
			color: rgba(255, 255, 255, 1);
			padding: 12rpx;
			border-radius: 12rpx;
		}
	}
</style>