<template>
  <div class="bg-white rounded-md h-screen py-4">
    <div class="margin_center">
      <div class="flex">
        <img class="w-146px" v-if="detailData.sm_logo" :src="getFullUrl(detailData.sm_logo) " alt="" />
        <div>
          <h3>{{ detailData.sm_name }}</h3>
          <p>
            <span class="mr-3">{{ detailData.sm_period }}</span>
            {{ detailData.sm_address }}
          </p>
          <div>
            <p>详细地址：{{ detailData.sm_address }}</p>
            <p>学校电话：{{ detailData.sm_lxr_contact }}</p>
          </div>
        </div>
      </div>
      <el-divider border-style="dotted" />
      <div v-html="detailData.sm_brief"></div>
    </div>
    <div class="text-center">
      <el-button type="primary" :disabled="isButton" @click="editLink">
        编辑
      </el-button>
    </div>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";
import { user } from '@/store/index'
const router = useRouter();
let detailData = $ref({});
let https = window.GLOBAL_CONFIG.api;
request({
  url: "/school/main/detail",
  data: {
    id: user.value.sm_id,
  },
}).then((res) => {
  if (res.code == "1") {
    detailData = res.data.one_info;
  }
});

function editLink() {
  router.push({ name: "xxgl_xj" });
}
</script>
<style lang="scss" scoped>
.margin_center {
  width: 800px;
  height: calc(80% - 50px);
  margin: 0 auto;
  overflow: auto;
  line-height: 30px;
}
</style>