<template>
  <div>
    <breadcrumb class="content-max-width crumb" :data="crumbData"/>
    <div class="site-box" v-if="list.length">
      <div class="title">{{ list[0].title }}</div>
      <div class="content" v-html="list[0].content">
        证书成绩查询请前往职业技能等级证书信息管理服务平台（网址： https://vslc.ncb.edu.cn ）进行查询。
      </div>
      <div class="btn" @click="goDetail">去查询</div>
    </div>
    <img :src="list[0].cover_pc_url" alt="">
  </div>
</template>
<script>
import action from '@action'
import breadcrumb from '@/components/breadcrumb'
export default {
  components: {
    breadcrumb
  },
  data() {
    return {//this.$store.state.classify
      articleClassify: this.$store.state.classify,
      list: [],
      crumbData: [
        {
          path: '/',
          name: '首页'
        },
        {
          name: '证书成绩查询'
        }
      ]
    }
  },
  mounted() {
    this.newsList()
  },
  methods: {
    goDetail() {
      window.open('https://vslc.ncb.edu.cn')
    },
    newsList() {
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      if (!Object.keys(this.$store.state.classify).length) {
        setTimeout(() => {
          this.articleClassify = this.$store.state.classify
          this.newsList()
        }, 2000)
      } else {
        const findId = this.articleClassify.children.find(item => {
          return item.display_name === '证书成绩查询'
        })
        action.articleAction.getArticle({ category_id: findId.id }).then(res => {
          this.list = res.data.list
          loading.close()
        })
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.crumb{
  padding-top: 24px;
}
.content-max-width{
  width: 1112px;
  margin: 0 auto;
}
.site-box{
  width: 650px;
  margin: 0 auto;
  .title{
    text-align: center;
    font-size: 18px;
    color: #222222;
    line-height: 18px;
    margin: 24px 0;
  }
  .content{
    font-size: 14px;
    color: #666666;
    line-height: 20px;
  }
  .btn{
    text-align: center;
    width: 96px;
    height: 36px;
    background: linear-gradient(315deg, rgba(225, 47, 116, 0.83) 0%, #C01540 100%);
    border-radius: 4px;
    font-size: 14px;
    color: #FFFFFF;
    line-height: 20px;
    margin: 24px auto;
    line-height: 36px;
    cursor: pointer;
  }
}
img{
  width: 876px;
  display: block;
  margin: 0 auto 24px auto;
}
</style>
