<template>
	<view class="phone-filter-page">
		<view class="icon-title-navBar-box">
			<view @click="goUpPage" class="nav-bar-icon"></view>
			<text class="nav-bar-title">筛选</text>
		</view>
		<view class="filter-body-box">
			<!-- 报证机构 -->
			<view class="filter-body-name">报证机构</view>
			<view class="phone-radio-group filter-radio-group">
				<view class="phone-radio-item" v-for="(item,index) in bzJigouList" :class="{active: jigouId===index}" @click="radioSelect('jg',index)">{{item.name}}</view>
			</view>
			
			<!-- 职业 -->
			<view class="filter-body-name">职业</view>
			<view class="phone-radio-group filter-radio-group">
				<view class="phone-radio-item" v-for="(item,index) in zhiyeList" :class="{active: jigouId===index}" @click="radioSelect('jg',index)">{{item.name}}</view>
			</view>
			
			<!-- 等级 -->
			<view class="filter-body-name">等级</view>
			<view class="phone-radio-group filter-radio-group">
				<view class="phone-radio-item" v-for="(item,index) in LevelList" :class="{active: jigouId===index}" @click="radioSelect('jg',index)">{{item.name}}</view>
			</view>
			
			<!-- 办证状态 -->
			<view class="filter-body-name">办证状态</view>
			<view class="phone-radio-group filter-radio-group">
				<view class="phone-radio-item" v-for="(item,index) in banzhengList" :class="{active: jigouId===index}" @click="radioSelect('jg',index)">{{item.name}}</view>
			</view>
			
			<!-- 考试状态 -->
			<view class="filter-body-name">考试状态</view>
			<view class="phone-radio-group filter-radio-group">
				<view class="phone-radio-item" v-for="(item,index) in kaoshiList" :class="{active: jigouId===index}" @click="radioSelect('jg',index)">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {onLoad,onShow} from '@dcloudio/uni-app';
	import {ref,reactive} from "vue"
	import * as banzhengApi from "@/api/banzheng.js"
	const bzData = reactive({
		jigouId: '',
		zhiyeId: '',
		levelId: '',
		banzhengId: '',
		kaoshiId: '',
	})
	const bzJigouList = ref([]);
	const zhiyeList = ref([]);
	const LevelList = ref([]);
	const banzhengList = ref([]);
	const kaoshiList = ref([]);
	onLoad((options) => {
		initPage();
	})
	
	function initPage(){
		getKaozhengJigouList();
		getKaozhengZhiyeList();
		getKaozhengLevelList();
		getKaozhengBanzhengList();
		getKaozhengKaoshiList();
	}
	
	function getKaozhengJigouList(){
		banzhengApi.getKaozhengJigou().then(res => {
			bzJigouList.value = res.data;
		})
	}
	
	function getKaozhengZhiyeList(){
		banzhengApi.getKaozhengZhiye().then(res => {
			zhiyeList.value = res.data;
		})
	}
	
	function getKaozhengLevelList(){
		banzhengApi.getKaozhengLevel().then(res => {
			LevelList.value = res.data;
		})
		
	}
	
	function getKaozhengBanzhengList(){
		banzhengApi.getKaozhengBanzheng().then(res => {
			banzhengList.value = res.data;
		})
	}
	
	function getKaozhengKaoshiList(){
		banzhengApi.getKaozhengKaoshi().then(res => {
			kaoshiList.value = res.data;
		})
	}
	
	function radioSelect(name,index){
		
	}
	
	function goUpPage(){
		uni.redirectTo({
			url: '/pages/admin/banzheng/list'
		})
	}
</script>

<style>
</style>