<template>
  <div id="index">
    <recruitdetail-layout :needRight="false" v-if="!loading">
      <template v-slot:mainInfoTop>
        <el-row>
          <el-col :span="24">
            <el-breadcrumb separator-class="el-icon-arrow-right">
              <el-breadcrumb-item :to="{ path: '/' }"
                ><i class="el-icon-s-home"></i>
                <span style="font-size: 0.8rem;">网站首页</span>
              </el-breadcrumb-item>
              <el-breadcrumb-item>
                <span style="font-size: 0.9rem;"><el-link :underline="false" @click="$router.push({ path: '/info/list' })">新闻列表</el-link></span>
              </el-breadcrumb-item>
              <el-breadcrumb-item><span style="font-zise: 0.8rem;">新闻详情</span></el-breadcrumb-item>
            </el-breadcrumb>
          </el-col>
        </el-row>
      </template>
      <template v-slot:mainLeft>
        <el-row>
          <!-- <el-col :span="24" align="right" style="font-size: 0.8rem;">插件</el-col> -->
          <el-col :span="24" align="center" style="font-size: 1.5rem; padding-top: 1rem;">{{ info.title }}</el-col>
          <el-col :span="24" align="right" class="date">
            发布时间:{{ info.meta && info.meta.createdAt ? new Date(info.meta.createdAt).toLocaleDateString() : '' || '' }}
            <!-- 点击人次:26125 -->
          </el-col>
          <el-col :span="24" style="text-align:center">
            <el-image :src="info.picurl" style="height:60%;width:60%"></el-image>
          </el-col>
          <el-col :span="24" style="padding-top: 1rem;" v-html="info.content"> </el-col>
        </el-row>
      </template>
    </recruitdetail-layout>
  </div>
</template>

<script>
import recruitdetailLayout from '@/layout/recruitdetail-layout.vue';
import { mapActions, mapState } from 'vuex';
export default {
  name: 'index',
  props: {},
  components: {
    recruitdetailLayout,
  },
  data: () => ({
    info: {},
    loading: true,
    menuList: [{ index: '1', name: '学校简介' }, { index: '2', name: '学校概括' }],
  }),
  created() {
    this.search();
  },
  computed: {},
  methods: {
    ...mapActions(['newsOperation']),
    async search() {
      let result = await this.newsOperation({ type: 'search', data: { id: this.$route.query.id } });
      if (`${result.errcode}` === '0') {
        this.$set(this, `info`, result.data);
        this.$set(this, `loading`, false);
      }
    },
  },
};
</script>

<style lang="less" scoped>
.date {
  font-size: 0.8rem;
  padding-top: 1rem;
  border-bottom: 1px dashed #f6f6f6;
  padding-bottom: 15px;
}
.schoolOverview {
  font-size: 1rem;
  width: 75px;
  float: left;
  height: 21px;
  line-height: 21px;
  text-align: center;
  background: #8ec965;
  color: #fff;
}
.school_header {
  width: 100%;
  height: 30px;
  border-top: 2px solid #8ec965;
}
</style>
