import OHeader from '@/components/o-header' import OSticky from '@/components/o-sticky' import { Tabs, Tab, showToast, Icon } from 'vant' import { defineComponent, reactive, ref, onMounted } from 'vue' import styles from './index.module.less' import schoolBg from './images/school-bg.png' import logoIcon from './images/logo.png' import { useRouter } from 'vue-router' import { state as globalState } from '@/state' import TeacherItem from './modals/teacher-item' import { schoolSystem } from '@/constant/index' import request from '@/helpers/request' export default defineComponent({ name: 'school-detail', setup() { const router = useRouter() const state = reactive({ list: [], info: {} as any }) const getSchoolDetail = async () => { const schoolId = (globalState.user.data.schoolInfos || []) .map((item) => { return item.id }) .join(',') try { const { data } = await request.get(`/api-school/school/detail/${schoolId}`, {}) state.info = data } catch (e: any) { showToast(e.message) } } const gotoEidt = () => { // /school-eidt router.push({ path: '/school-eidt' }) } const getTeacherList = async () => { // const schoolId = (globalState.user.data.schoolInfos || []) // .map((item) => { // return item.id // }) // .join(',') try { const { data } = await request.post(`/api-school/teacher/page`, { data: { page: 1, rows: 9999 } }) state.list = data.rows } catch (e: any) { showToast(e.message) } } onMounted(() => { getSchoolDetail() getTeacherList() }) return () => ( <>
{state.info.name}
{state.info.provinceName} {state.info.cityName}
地址:{state.info.address}
学年制:{schoolSystem[state.info.schoolSystem]}
邮箱:{state.info.email}
管理老师:{state.info.educationalAdministrationUsername}
负责人:{state.info.emergencyContactPosition}
伴学指导