/* 认证学校*/
<template>
    <div>
        <div class="fontBox"></div>
        <div class="card">
            <div class="cardItem" v-for="(v,i) in schoolList" :key="i">
                <div @click="switchClass(v)">{{v.schoolName}}</div>
                <div class="cardItem_blue" @click="switchSchool">重新认证</div>
            </div>
        </div>
        
        <!-- <van-popup style="background: transparent;" get-container="body" v-model="showSchool">
            <group-penson></group-penson>
        </van-popup> -->
    </div>
</template>

<script>
import schoolAdd from '@/views/Travel/component/schoolAdd'
import groupPenson from '@/views/Travel/component/groupPenson'
export default {
    components: { schoolAdd , groupPenson},
    data() {
        return {
            schoolList: [
                // {isAuth: false, schoolName: "测试学校"},
            ],
            showSchool: false
        }
    },
    methods: {
        //获取学校
        getSchool() {
            let userNum = JSON.parse(localStorage.getItem('userInfo')).centerNo
            this.yxAxios.get(`${this.baseUrl}/prod/user/info/getSchool?userNum=${userNum}`).then((res) => {
                if(res.data.code == 200) {
                    this.schoolList = res.data.data
                }else {
                    this.$toast.fail(res.data?.message)
                }
            })
        },
        //切换学校
        switchSchool() {
            localStorage.setItem('backRZ',true)
            this.$router.push({name: localStorage.getItem('prePage') })
        },
        //选择班级
        switchClass(v) {
            this.$router.push({name: 'classAttestation',query: {schoolNamequery: v.schoolName}})
        }
    },
    mounted() {
        this.getSchool()
    }
}
</script>

<style lang="scss" scoped>
.fontBox {
    width: 100vw;
    height: 3vw;
    display: flex;
    align-items: center;
    padding: 0 4vw;
    box-sizing: border-box;
    background-color: #F5F6FA;
    font-size: 3.5vw;
    color: #999999;
}
.card {
    padding: 7vw 5vw 0; 
    box-sizing: border-box;

    .cardItem {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10vw;
        font-size: 3.8vw;

        .cardItem_blue {
            color:#3074FF
        }
    }
}
</style>