<template>
  <div class="NPC-zhedie">
    <div class="topTitle">
      <div class="NPC-top-left">
        <span class="NPC-topTitle-text">{{ curQue.title }}</span>
      </div>
      <div class="NPC-top-right" @click="handleChangeTab">
        <span class="NPC-top-right-text">{{ wordShow ? "收起" : "展开" }}</span>
        <img v-if="wordShow" src="../../../assets/NPC/down.png" alt="" />
        <img v-else class="rotate" src="../../../assets/NPC/down.png" alt="" />
      </div>
    </div>
    <el-collapse-transition>
      <div class="NPC-notes-list" v-show="wordShow">
        <div
          class="NPC-notes"
          v-for="(item, index) in curQue.option"
          :key="'NPC-notes' + index"
        >
          <div class="NPC-notes-con">
            <span class="NPC-notes-con-number">{{ item.number }}</span>
            <span class="NPC-notes-con-text">{{ item.con }}</span>
          </div>
          <div class="NPC-notes-trans">
            {{ item.interpret }}
          </div>
          <div class="NPC-notes-note" v-if="item.note" v-html="item.note"></div>
          <div
            class="NPC-notes-note-img"
            v-if="item.img_list && item.img_list.length > 0"
          >
            <div
              v-for="(imgItem, imgIndex) in item.img_list"
              :key="'imgList' + imgIndex"
            >
              <img :src="imgItem.id" class="NPC-notes-img" />
            </div>
          </div>
        </div>
      </div>
    </el-collapse-transition>
  </div>
</template>

<script>
//这里可以导入其它文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》from ‘《组件路径》';
import WordPhraseDetail from "./components/WordPhraseDetail.vue";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {
    WordPhraseDetail,
  },
  props: ["curQue"],
  data() {
    //这里存放数据
    return {
      wordShow: true,
    };
  },
  //计算属性 类似于data概念
  computed: {},
  //监控data中数据变化
  watch: {},
  //方法集合
  methods: {
    handleChangeTab() {
      this.wordShow = !this.wordShow;
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  //生命周期-创建之前
  beforeCreated() {},
  //生命周期-挂载之前
  beforeMount() {},
  //生命周期-更新之前
  beforUpdate() {},
  //生命周期-更新之后
  updated() {},
  //生命周期-销毁之前
  beforeDestory() {},
  //生命周期-销毁完成
  destoryed() {},
  //如果页面有keep-alive缓存功能，这个函数会触发
  activated() {},
};
</script>
<style lang="scss" scoped>
/* @import url(); 引入css类 */
.NPC-zhedie {
  width: 780px;
  margin-bottom: 24px;
  .topTitle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding-left: 24px;
    padding-right: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    .NPC-top-left {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      .NPC-topTitle-text {
        font-family: "sourceR";
        font-size: 16px;
        color: #fff;
        font-weight: bold;
        margin-right: 8px;
      }
      .NPC-play-all {
        width: 24px;
        height: 24px;
        background: url("../../../assets/NPC/play-white.png") no-repeat left top;
        background-size: 100% 100%;
        cursor: pointer;
      }
    }
    .NPC-top-right {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      cursor: pointer;
      &-text {
        font-weight: normal;
        font-size: 14px;
        line-height: 16px;
        color: #ffffff;
      }
      img {
        width: 16px;
        height: 16px;
        margin-left: 4px;
      }
    }

    .rotate {
      animation-name: firstrotate;
      animation-direction: 2s;
      animation-fill-mode: both;
      animation-timing-function: linear;
    }
  }
  .NPC-notes-list {
    padding: 24px 24px 5px 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 8px 8px;
    .NPC-notes {
      width: 100%;
      margin-bottom: 24px;
      .NPC-notes-con {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-bottom: 12px;
        > span {
          font-style: normal;
          font-weight: normal;
          font-size: 14px;
          line-height: 150%;
          color: #e35454;
          &.NPC-notes-con-number {
            font-family: "robot";
          }
          &.NPC-notes-con-text {
            flex: 1;
            margin-left: 5px;
            font-family: "GB-PINYINOK-B";
          }
        }
      }
      .NPC-notes-trans {
        font-family: "robot";
        font-style: normal;
        font-weight: bold;
        font-size: 14px;
        line-height: 150%;
        color: #000000;
        margin-bottom: 12px;
        padding-left: 27px;
      }
      .NPC-notes-note {
        font-family: "robot";
        font-style: normal;
        font-weight: normal;
        font-size: 14px;
        line-height: 150%;
        color: #000000;
        text-indent: 27px;
      }
    }
  }
  .NPC-notes-note-img {
    width: 100%;
    > div {
      width: 100%;
      > img {
        max-width: 100%;
      }
    }
  }
}
@keyframes firstrotate {
  0% {
    transform: rotateZ(0deg);
  }
  100% {
    transform: rotateZ(180deg);
  }
}
@keyframes huifuRotate {
  0% {
    transform: rotateZ(180deg);
  }
  100% {
    transform: rotateZ(0deg);
  }
}
</style>
<style lang="scss">
.NPC-zhedie {
  .el-collapse-item__content {
    padding-bottom: 0;
  }
  .el-slider__button {
    width: 8px;
    height: 8px;
  }
  .el-slider__runway {
    margin: 0;
    padding: 0;
  }
  .el-slider {
    position: relative;
    top: -3px;
  }
  .el-collapse {
    background: #f7f7f7;
    box-sizing: border-box;
    border-radius: 8px;
  }
  .el-collapse-item__header {
    height: 48px;
    background: #e35454;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    border-radius: 8px 8px 0px 0px;
  }

  .el-collapse-item__wrap {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: 0;
    background: #f7f7f7;
    border-radius: 0px 0px 8px 8px;
  }
  .el-collapse-item__arrow {
    display: none;
  }
  .el-table__row {
    padding: 4px 0;
  }
}
</style>