<template>
  <!-- 教研工具 -->
  <div
    class="Textbook"
    v-if="
      popedom_code_list.indexOf(2100001) > -1 ||
      popedom_code_list.indexOf(2100002) > -1 ||
      popedom_code_list.indexOf(2100003) > -1
    "
  >
    <div class="top">
      <div class="title">
        <span class="text"> 教研工具</span>
      </div>
    </div>
    <div class="class_list">
      <div v-if="popedom_code_list.indexOf(2100001) > -1">
        <div
          style="background: #4ca6ee"
          @click="
            $router.push({
              path: '/TextAnalysis',
            })
          "
        >
          <img src="../../assets/teacherdev/jygj-1.png" alt="" />
        </div>
        <p>文本分析</p>
      </div>
      <div v-if="popedom_code_list.indexOf(2100002) > -1">
        <div
          style="background: #d86046"
          @click="
            $router.push({
              path: '/corpus/seekPage',
            })
          "
        >
          <img src="../../assets/teacherdev/jygj-2.png" alt="" />
        </div>
        <p>教材语料库</p>
      </div>
      <div v-if="popedom_code_list.indexOf(2100003) > -1">
        <div
          style="background: #c254cc"
          @click="
            $router.push({
              path: '/wordcard/table',
            })
          "
        >
          <img src="../../assets/teacherdev/jygj-3.png" alt="" />
        </div>
        <p>字词练习卡</p>
      </div>
      <!-- <div>
        <div
          style="background: #54cc92"
          @click="
            $router.push({
              path: '/CalligraphyMaster/table',
            })
          "
        >
          <img src="../../assets/teacherdev/jygj-4.png" alt="" />
        </div>
        <p>书法大师</p>
      </div> -->
    </div>
  </div>
</template>

<script>
import { getToken } from '@/utils/auth';
export default {
  props: ['classList', 'type'],
  data() {
    return {
      popedom_code_list: [],
    };
  },
  created() {
    let userInfor = getToken()
      ? JSON.parse(getToken())
      : sessionStorage.getItem('GCLS_Token_Tc')
      ? JSON.parse(sessionStorage.getItem('GCLS_Token_Tc'))
      : null;
    this.popedom_code_list = userInfor ? userInfor.popedom_code_list : [];
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.Textbook {
  .top {
    width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    .title {
      width: 100%;
      height: 90px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .text {
        position: relative;
        font-size: 24px;
        font-weight: bold;
      }
      .more {
        cursor: pointer;
        font-size: 16px;
        display: flex;
        align-items: center;
        span {
          opacity: 0.4;
        }
        img {
          width: 25px;
          height: 19px;
        }
      }
    }
  }
  .class_list {
    width: 1200px;
    box-sizing: border-box;
    margin: 0 auto;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 40px 56px;
    > div {
      // width: 88px;
      height: 124px;
      cursor: pointer;
      margin-right: 42px;
      div {
        width: 88px;
        height: 88px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 8px;
        margin: 0 auto;
        img {
          width: 48px;
          height: 48px;
        }
      }

      p {
        margin: 0;
        margin-top: 10px;
        font-weight: 400;
        font-size: 20px;
        line-height: 26px;
      }
    }
  }
}
</style>
