/* 关注学校*/
<template>
    <div>
        <div class="fontBox">请选择关注学校</div>
        <div class="card">
            <div class="cardItem" v-for="(v,i) in schoolList" :key="i">
                <div>{{v.schoolName}}</div>
                <div class="cardItem_blue" @click="switchSchool(v)">切换</div>
            </div>
        </div>
        
        <van-popup style="background: transparent;" get-container="body" v-model="showSchool">
            <!-- <school-add></school-add> -->
            <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: [],
            showSchool: false
        }
    },
    mounted() {
        this.getList()
    },
    methods: {
        //切换学校
        switchSchool(v) {
            sessionStorage.setItem('schoolNamesChoose',JSON.stringify(v))
            this.$router.push({name : sessionStorage.getItem('prePage')})
        },
        getList() {
            this.schoolList =  JSON.parse(sessionStorage.getItem('schoolNames')) 
        }
    }
}
</script>

<style lang="scss" scoped>
.fontBox {
    width: 100vw;
    height: 8vw;
    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>