<template>
	<view class="screen-item flex-common-css sys-background-black">
		<Nav :bgckgroundBox="'#141414'" :title="'筛选'"></Nav>
		<scroll-view :scroll-y="true" class="list-scroll" @scroll="scroll" @scrolltolower="scrolltolower">
			<view class="screen-box">
				<view class="age-name sys-size-32 sys-color-white">
					距离 {{distance}}
				</view>
				<slider :value="distance" @changing="sliderChange" min="0" max="500" activeColor="#727272"
					backgroundColor="#727272" block-size="6" block-color="#FFC107" />
				<view class="num-section sys-size-28 sys-color-5B ">
					<view class="">
						okm
					</view>
					<view class="">
						∞
					</view>
				</view>
				<view class="age-name sys-size-32 sys-color-white">
					年龄 {{`${age[0]} - ${age[1]}`}}
				</view>
				<cjSliderTwo v-model="age" :min="0" :max="35" :step="1" :blockWidth="18" @moving="blockMoving"
					activeColor="#727272" inactiveColor="#727272" blockColor="#FFC107" />
				<view class="num-section sys-size-28 sys-color-5B">
					<view class="">
						okm
					</view>
					<view class="">
						35+
					</view>
				</view>
				<view class="sex">
					<view v-for="(item,index) in sex" :key="index" class="sex-list sys-size-28 sys-radius-12"
						@click="selsectSex(item.id)"
						:class="sexId == item.id?'sys-background-FFC107 sys-color-black':'sys-color-gray-646464 sys-background-222'">
						{{item.name}}
					</view>
				</view>
				<view class="view-user">
					<view class="view-user-left sys-color-white sys-size-32">
						优先查看用户
					</view>
					<view class="view-user-right">
						<view class="view-user-right-name sys-color-5B sys-size-28">
							未设置
						</view>
						<uni-icons type="forward" size="20" color="#5B5B5B"></uni-icons>
					</view>
				</view>
				<view class="view-user">
					<view class="view-user-left sys-color-white sys-size-32">
						速配星座
					</view>
					<view class="view-user-right">
						<view class="view-user-right-name sys-color-5B sys-size-28">
							未设置
						</view>
						<uni-icons type="forward" size="20" color="#5B5B5B"></uni-icons>
					</view>
				</view>
				<view class="placeholder-box"></view>
				<view class="aim-box">
					<view class="aim-title">
						<view class="title-box sys-radius-200 sys-background-FFC107"></view>
						<view class="title-name sys-size-32 sys-color-white">
							交友目的
						</view>
					</view>
					<view class="aim-text sys-color-5B sys-size-24">
						人数不足时，将自动扬大范围
					</view>
					<view class="aim-list">
						<view class="list-box" v-for="(item,index) in 10">
							<image class="list-box-img sys-radius-40" src="../../../static/img/circle/1.png" mode="">
							</image>
							<view class="list-box-name sys-color-5B sys-size-26">
								认识的朋友
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import cjSliderTwo from '@/components/jxs-slider/jxs-slider.vue'
	import cjSlider from '@/components/cj-slider/cj-slider.vue'
	import {
		getFilter
	} from "@/api/discovery";
	export default {
		components: {
			cjSliderTwo
		},
		data() {
			return {
				distance: 50,
				age: [18, 30],
				sex: [{
					'name': '男生',
					'id': 0
				}, {
					'name': '女生',
					'id': 1
				}, {
					'name': '不限',
					'id': 2
				}],
				sexId: 0,
			};
		},
		mounted() {
			this.getFilter()
		},
		methods: {
			getFilter() {
				getFilter().then((res) => {
					console.log(res)
				})
			},
			scroll() {},
			scrolltolower() {},
			blockMoving(e) {
				console.log('正在滑动中', e)
			},
			sliderChange(e) {
				this.distance = e.detail.value
			},
			selsectSex(id) {
				//点击没反应
				this.sexId = id
				console.log(id);
			},
		},
	}
</script>

<style lang="scss" scoped>
	::v-deep uni-slider {
		margin: 0;
	}

	.screen-item {
		width: 100%;
		flex: 1;

		.list-scroll {
			width: 100%;
			flex: 1;
			overflow: auto;
			padding: 24rpx 32rpx 0 32rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;

			.screen-box {
				.age-name {
					margin: 0 0 20rpx 0;
				}

				.num-section {
					padding: 8rpx 0 0 0;
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin: 0 0 40rpx 0;
				}

				.sex {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin: 0 0 40rpx 0;

					.sex-list {
						width: 212rpx;
						padding: 10rpx 0;
						display: flex;
						align-items: center;
						justify-content: center;
					}
				}

				.view-user {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin: 0 0 40rpx 0;

					.view-user-left {}

					.view-user-right {
						display: flex;
						align-items: center;

						.view-user-right-mame {
							margin: 0 4rpx 0 0;
						}
					}
				}

				.placeholder-box {
					width: 100%;
					height: 1rpx;
					border-bottom: 2rpx dashed #383838;
					margin: 0 0 40rpx 0;
				}

				.aim-box {
					width: 100%;
					display: flex;
					flex-direction: column;

					.aim-title {
						display: flex;
						align-items: center;
						margin: 0 0 4rpx 0;

						.title-box {
							width: 4rpx;
							height: 32rpx;
							margin: 0 8rpx 0 0;
						}
					}

					.aim-list {
						display: flex;
						align-items: center;
						flex-wrap: wrap;

						.list-box {
							width: 25%;
							display: flex;
							flex-direction: column;
							align-items: center;
							// margin: 0 60rpx 0 0;
							padding: 32rpx 0 0 0;

							.list-box-img {
								width: 120rpx;
								height: 120rpx;
								margin: 0 0 16rpx 0;
								flex-shrink: 0;
							}

							.list-box-name {
								white-space: nowrap;
							}
						}

						.list-box:last-child {
							margin: 0;
						}
					}
				}
			}
		}
	}
</style>