<template>
    <div style="display: flex;flex-direction: column;gap: 20px;height: 100%;">
        <div class="top">
            <div class="topTit">
                <div>
                    <div>集团简介</div>
                    <div style="height: 4px;background-color: #0663FE;width: 2rem;margin-top: 6px;"></div>
                </div>
                <div>
                    <img src="../../../assets/img/bianji.svg" alt="">
                </div>
            </div>
            <div class="Topbri">
                {{ fromL.admin.CampusF.GroupBri }}
            </div>
        </div>
        <div class="feature">
            <div class="topTit">
                <div>
                    <div>办学特色</div>
                    <div style="height: 4px;background-color: #0663FE;width: 2rem;margin-top: 6px;"></div>
                </div>
                <div>
                    <img src="../../../assets/img/bianji.svg" alt="">
                </div>
            </div>

            <div style="display: flex;justify-content: space-between;">
                <div class="featureCon" v-for="(i, index) in featureList" :key="index">
                    <img style="width: 24px;" src="../../../assets/img/tese.svg" alt="">
                    <div class="featureConTit">{{ i.name }}</div>
                    <div class="Topbri">{{ i.bri }}</div>
                </div>
            </div>
        </div>

        <div class="feature">
            <div class="topTit">
                <div>
                    <div>师资力量</div>
                    <div style="height: 4px;background-color: #0663FE;width: 2rem;margin-top: 6px;"></div>
                </div>
                <div>
                    <img src="../../../assets/img/bianji.svg" alt="">
                </div>
            </div>
            <div class="Topbri">
                {{ fromL.admin.CampusF.GroupBri }}
            </div>

            <div style="display: flex;justify-content: space-between;">
                <div class="featureCon2" v-for="(i, index) in teaData" :key="index">
                    <div class="featureConTit2">{{ i.bri }}</div>
                    <div class="Topbri">{{ i.name }}</div>
                </div>
            </div>
        </div>

        <div class="feature">
            <div class="topTit">
                <div>
                    <div>特色应用</div>
                    <div style="height: 4px;background-color: #0663FE;width: 2rem;margin-top: 6px;"></div>
                </div>
                <div>
                    <img src="../../../assets/img/bianji.svg" alt="">
                </div>
            </div>

            <div class="AppStoreList">
                <div class="AppStore" v-for="(i,index) in featureApp" :key="index">
                    <img style="width: 24px;" src="../../../assets/img/bianji.svg" alt="">
                    <div class="AppStoreCon">
                        <img style="width: 18px;margin-bottom: 10px;" src="../../../assets/img/tese.svg" alt="">
                        <div class="AppStoreConTit">{{i.name}}</div>
                        <div class="AppStoreConBri">{{i.detail}}</div>
                    </div>
                </div>

                <div class="AppStore">
                    <div style="height: 24px;"></div>
                    <div class="AppAdd">
                        <img src="../../../assets/img/add.svg" alt="">
                    </div>
                    <div>

                    </div>
                </div>
            </div>

        </div>
    </div>
</template>

<script>
import { mapGetters } from 'vuex';
import { API_CONFIG } from '../../../common/apiConfig.js';
export default {
    data() {
        return {
            featureApp:[]
        }
    },
    computed: {
        ...mapGetters(['fromL']),
        featureList() {
            return this.fromL.admin.CampusF.feature; // 从 Vuex 的 fromL 中获取 featureList
        },
        teaData() {
            return this.fromL.admin.CampusF.teacherN.list; // 从 Vuex 的 fromL 中获取 teaData
        },
    },
    methods: {
        // 获取cocoFlow2应用
        getData() {
            let cocoFlowCopy = []
            if (this.fromL.admin.cocoFlow2 && this.fromL.admin.cocoFlow2.length) {
                cocoFlowCopy = this.fromL.admin.cocoFlow2.map(item => item.id);
            } else {
                return
            }

            let params = [
                {
                    functionName: API_CONFIG.ajax_AdminApp.functionName,
                    con: cocoFlowCopy.join(','),
                },
            ];

            this.$ajax
                .post(API_CONFIG.baseUrl, params)
                .then((res) => {
                    this.featureApp = res.data[0]
                    // console.log("后端传的数据", this.featureApp);
                    
                })
                .catch((err) => {
                    console.log(err);
                });
        },
    },
    mounted() {
        this.getData()
    }
}
</script>

<style scoped>
.top {
    height: 159px;
    padding: 36px 27px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    justify-content: space-between;
}

.topTit {
    font-family: PingFang SC;
    font-weight: 600;
    font-size: 20px;
    line-height: 22px;
    color: #0663FE;
    display: flex;
    height: 36px;
    justify-content: space-between;
}
.topTit img{
    cursor: pointer;
}
.Topbri{
    font-family: PingFang SC;
    font-weight: 400;
    font-size: 12px;
    line-height: 22px;
    color: #000;
}

.feature {
    width: 100%;
    padding: 36px 27px;
    border-radius: 12px;
    box-sizing: border-box;
    background: #EEEEEE;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: space-between;
}

.featureCon {
    background: #FFFFFF;
    width: 24%;
    height: 206px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 12px;
    padding: 40px 20px;
    align-items: center;
    box-sizing: border-box;
    gap: 18px;
}

.featureCon2 {
    background: #FFFFFF;
    width: 24%;
    height: 94px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 12px;
    padding: 40px 20px;
    align-items: center;
    box-sizing: border-box;
    gap: 10px;
}

.featureConTit {
    font-family: PingFang SC;
    font-weight: 600;
    font-size: 20px;
    line-height: 22px;
    color: #000;
}

.featureConTit2 {
    font-family: PingFang SC;
    font-weight: 600;
    font-size: 20px;
    line-height: 22px;
    color: #0663FE;
}

.AppStoreList {
    display: flex;
    gap: 20px;
}

.AppStore {
    width: 33%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.AppStoreCon {
    height: 122px;
    border-radius: 10px;
    padding: 17px 17px;
    box-sizing: border-box;
    background: #fff;
}

.AppAdd {
    height: 122px;
    border-radius: 10px;
    padding: 17px 17px;
    box-sizing: border-box;
    border: 1px dashed #000000;
    background: #E5E5E5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.AppStoreConTit {
    font-family: PingFang SC;
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 5px;
}

.AppStoreConBri {
    font-family: PingFang SC;
    font-weight: 300;
    font-size: 12px;
    color: #969BA3;
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.AppStoreBri {
    font-family: PingFang SC;
    font-size: 10px;
    color: #969BA3;
}
</style>