<template>
  <div class="mian">
    <div class="content fl">
      <div class="title">考前须知</div>
      <div class="cont-left">
        <div class="h2">考前须知</div>
        <div class="explain">
          <div class="txt">
            “高级财富管理师”证书培训作为提升从业人员素质的基本途径，得到了监管部门、各金融机构及广大从业人员的高度认可，对于规范从业人员职业水平，实现从业人员自我管理起到了巨大的推动作用。
          </div>
          <div class="txt">
            不断规范“高级财富管理师”证书考试制度,目的是建立财富管理从业人员职业标准及用人规范,为金融机构和客户鉴别从业者能力提供识别标杆。为确保考试顺利有序进行，现将《考前须知》公示如下。请各位考生认真阅读，明确考试规则，遵守考试纪律，做好考前准备。
          </div>
        </div>
        <div class="txt-cont" ref="catalog1" id="catalog1">
          <div class="tits">考试时间</div>
          <p>考试时间： <span style="color: red">2021 年 6 月 1 9 日 17:00—18:00</span></p>
        </div>
        <div class="txt-cont" ref="catalog2" id="catalog2">
          <div class="tits">考试内容</div>
          <p>1.题型：均为客观题，其中单选题20题，每题2分；多选题10题，每题3分；判断题15题，每题2分，总分100分。</p>
          <p>2.考点：试题内容70%源于教材学习内容，30%源于直播课程授课内容</p>
        </div>
        <div class="txt-cont" ref="catalog4" id="catalog4">
          <div class="tits">考试成绩</div>
          <p>考试成绩为“通过”或“未通过”，将在考试后以3个工作日内通知考试结果，考试通过者可获得证书。</p>
        </div>
        <div class="txt-cont" ref="catalog7" id="catalog7">
          <div class="tits">考试纪律</div>
          <p>
            1.考生应诚信考试并自觉服从监考工作人员管理，不得以任何理由妨碍监考员等考试工作人员履行职责，不得扰乱考试秩序
          </p>
          <p>2.考试过程中请关闭手机，严禁随意走动、离开考场</p>
          <p>3.考试闭卷进行，禁止翻阅资料和交头接耳</p>
          <p>4.请使用黑色中性笔答题，否则视为无效试卷</p>
          <p>5.考试时长1小时，时间到继续答题或延迟交卷者，视为无效试卷</p>
          <p>6.请认真填写试卷上的个人信息，个人信息空缺及有误者，视为无效试卷</p>
          <p>7.提前交卷的考生请迅速自觉离开考场，切勿逗留或影响其他考生答卷</p>
          <p>预祝大家考试顺利！</p>
        </div>
      </div>
    </div>
    <div :class="showClass" ref="suspension">
      <div class="cont">
        <div class="titl">
          <img src="../../assets/images/lear-tips-micon.png" alt="" />
          <div class="txt">目录导航</div>
        </div>
        <ul>
          <template v-for="(item, index) in catalogList">
            <li :key="index" :class="item.active" @click="clickScroll(item.id, index)">
              <div class="name">{{ item.name }}</div>
              <div class="prog">
                <div class="pr1"></div>
                <div class="pr2"></div>
              </div>
            </li>
          </template>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      showClass: 'cont-right',
      catalogList: [
        { name: '考试时间', id: 'catalog1', active: 'active' },
        { name: '考试内容', id: 'catalog2', active: '' },
        { name: '考试成绩', id: 'catalog4', active: '' },
        { name: '考试纪律', id: 'catalog7', active: '' }
      ]
    }
  },
  mounted() {
    document.addEventListener('scroll', this.handleScrollx, true)
  },
  methods: {
    handleScrollx() {
      this.catalogList.map((item, index) => {
        if (!this.$refs[item.id]) {
          return
        }
        const offH = this.$refs[item.id].getBoundingClientRect().top
        if (offH < 140 && offH > -140) {
          for (let i = 0; i < this.catalogList.length; i++) {
            this.catalogList[i].active = ''
          }
          this.catalogList[index].active = 'active'
        }
      })
      document.documentElement.scrollTop > 100 ? (this.showClass = 'cont-right susp') : (this.showClass = 'cont-right')
    },
    clickScroll(id, index) {
      document.getElementById(id).scrollIntoView()
      this.catalogList.map((item, i) => {
        item.active = ''
      })
      this.catalogList[index].active = 'active'
    }
  }
}
</script>

<style lang="scss" scoped>
.mian {
  padding: 40px;
  .content {
    position: relative;
    background: rgba(255, 255, 255, 1);
    border-radius: 6px;
    padding: 0 40px 30px 40px;
    margin-bottom: 20px;
    .title {
      color: #333333;
      font-size: 18px;
      line-height: 65px;
      border-bottom: 1px solid rgba(204, 204, 204, 1);
    }
    .cont-txt {
      padding-bottom: 30px;
      p {
        font-size: 18px;
        color: #666666;
        line-height: 30px;
        text-indent: 2em;
      }
    }
    .new-h2 {
      margin-top: 30px;
    }
    .h2 {
      font-size: 35px;
      color: #333333;
      text-align: center;
      padding: 10px 0;
    }
    .explain {
      .tits {
        font-size: 22px;
        color: #333333;
      }
      .txt {
        font-size: 18px;
        color: rgba(51, 51, 51, 1);
        line-height: 40px;
        // width: 90%;
        // margin: 0 auto;
        text-indent: 2em;
      }
    }
    .cont-left {
      width: 75%;
    }
    .txt-cont {
      margin-top: 20px;
      .tits {
        font-weight: bold;
        font-size: 22px;
        line-height: 40px;
        width: 100%;
        color: #333;
        border-bottom: 1px solid #cccccc;
        padding-top: 10px;
      }
      p {
        text-align: justify;
        color: rgba(51, 51, 51, 1);
        font-size: 18px;
        line-height: 35px;
        margin-top: 15px;
        width: 90%;
        margin: 10px auto 0 auto;
        text-indent: -0.8em;
      }
      .qr-code {
        width: 35%;
        display: block;
        margin: 0 auto;
      }
      .img1 {
        width: 80%;
        display: block;
        margin: 10px auto 0 auto;
      }
      .img2 {
        width: 65%;
        margin: 10px auto;
        display: block;
      }
      .ind {
        text-indent: 2em;
      }
      ul {
        margin: 0 auto;
        padding: 27px 0 0 0;
        list-style: none;
        li.top {
          .li-txt {
            position: absolute;
            top: 55%;
            -webkit-transform: translateY(-50%);
            transform: translateY(-50%);
            -o-transform: translateY(-50%);
            -ms-transform: translateY(-50%);
            left: 20%;
          }
        }
        li:nth-child(2) {
          .l {
            opacity: 0.6;
          }
        }
        li:nth-child(3) {
          .l {
            opacity: 0.7;
          }
        }
        li:nth-child(4) {
          .l {
            opacity: 0.8;
          }
        }
        li:nth-child(5) {
          .l {
            opacity: 0.9;
          }
        }
        li {
          position: relative;
          width: 100%;
          margin-bottom: 30px;
          overflow: hidden;
          .l {
            position: relative;
            float: left;
            width: 20%;
            opacity: 0.5;
            img {
              display: block;
              width: 100%;
            }
            span {
              position: absolute;
              top: 50%;
              left: 50%;
              -webkit-transform: translate(-50%, -50%);
              transform: translate(-50%, -50%);
              -o-transform: translate(-50%, -50%);
              -ms-transform: translate(-50%, -50%);
              color: #fff;
              font-size: 20px;
              text-align: center;
              white-space: nowrap;
            }
          }
          .li-txt {
            float: left;
            width: 77%;
            margin-left: 3%;
            div {
              font-size: 18px;
              color: rgba(51, 51, 51, 1);
              line-height: 30px;
            }
          }
        }
      }
    }
  }
  .cont-right.susp {
    position: fixed;
    right: -40px;
    top: 80px;
  }
  .cont-right {
    position: absolute;
    top: 150px;
    right: 0;
    width: 30%;
    .cont {
      width: 200px;
      margin: 0 auto;
      .titl {
        width: 100%;
        height: 73px;
        background: url('../../assets/images/lear-tips-mbg.png');
        background-size: 100% 100%;
      }
      .titl {
        display: flex;
        justify-content: center;
        align-items: center;
        img {
          width: 28px;
          height: 28px;
        }
        .txt {
          color: rgba(255, 255, 255, 1);
          font-size: 22px;
          margin-left: 8px;
        }
      }
      ul {
        padding: 0;
        li.active {
          .name {
            color: #2994ea;
          }
          .prog {
            .pr1 {
              background: #2994ea;
            }
            .pr2 {
              background: #2994ea;
            }
          }
        }
        li {
          display: flex;
          list-style: none;
          width: 164px;
          margin: 0 auto 20px auto;
          cursor: pointer;
          .name {
            font-size: 18px;
            color: #999999;
          }
          .prog {
            width: 86px;
            margin-left: auto;
            position: relative;
            margin-top: 5px;
            .pr1 {
              position: absolute;
              top: 8px;
              right: 0;
              width: 100%;
              height: 1px;
              background: #d8d8d8;
            }
            .pr2 {
              position: absolute;
              top: 0;
              right: 0;
              width: 16px;
              height: 16px;
              background: rgba(216, 216, 216, 1);
              border-radius: 50%;
            }
          }
        }
      }
    }
  }
}
.exa-main {
  .tip-t {
    font-size: 22px;
    color: #333333;
  }
  .padd-min-tit {
    padding: 8px 0 0 0;
  }
  .min-tit {
    color: rgba(51, 51, 51, 1);
    font-size: 18px;
    margin: 20px 0 20px 10px;
    a {
      color: #018aff;
    }
  }
  .con-mian {
    display: table;
    img {
      vertical-align: middle;
    }
  }
  .step1-img-w {
    img {
      width: 30%;
    }
    .step-arrow {
      width: 5%;
    }
  }
  .step2-img-w {
    .step2-1 {
      width: 23.5%;
    }
    .step2-2 {
      width: 24.5%;
    }
    .step2-3 {
      width: 41.5%;
    }
    .step-arrow {
      width: 5%;
    }
  }
  .step3-img-w {
    img {
      width: 30%;
    }
    .step-arrow {
      width: 5%;
    }
  }
  .step4-img-w {
    img {
      width: 21.25%;
    }
    .step-arrow {
      width: 5%;
    }
  }
  .step5-img-w {
    .tip-txt {
      width: 30%;
      color: rgba(255, 41, 41, 1);
      font-size: 18px;
      display: inline-block;
    }
    img {
      width: 30%;
      margin-left: 3%;
    }
  }
  .step6-img-w {
    img {
      width: 100%;
    }
  }
  .step7-img-w {
    .sbt {
      overflow: hidden;
      margin-top: 15px;
    }
    img {
      float: left;
      width: 12px;
      height: 12px;
      margin: 7px 5px 0 0;
    }
    .t {
      float: left;
      color: rgba(51, 51, 51, 1);
      font-size: 18px;
    }
    a {
      margin-left: 20px;
      padding-top: 10px;
      font-size: 18px;
      color: rgba(1, 138, 255, 1);
      display: block;
    }
    .tt {
      font-size: 18px;
      color: #333333;
      margin-left: 20px;
      line-height: 30px;
      margin-top: 10px;
    }
  }
}
@media screen and (min-width: 1610px) {
  .mian .content .txt-cont ul li .l {
    width: 13%;
  }
  .mian .content .txt-cont ul li .li-txt div {
    font-size: 20px;
  }
  .mian .content .txt-cont ul li.top .li-txt {
    left: 13%;
  }
}
@media screen and (max-width: 1610px) {
  .mian .content .txt-cont ul li .li-txt div {
    font-size: 16px;
  }
}
.table {
  width: 90%;
  margin: 20px auto;
  border-collapse: collapse;
  text-align: center;
  td,
  th {
    padding: 12px;
  }
}
</style>
