<template>
  <div class="cell-box">
    <van-cell
      class="cell"
      :title="
        item.placeIssueName ||
        item.classIssueName ||
        item.excellIssueName ||
        item.sequeIssueName
      "
      is-link
      center
      v-for="(item, index) in classData"
      :key="index"
      :border="false"
      @click="
        () => {
          goExercise({
            placeIssueName: item.placeIssueName,
          });
        }
      "
    >
      <template #icon>
        <div class="icon">{{ index + 1 }}</div>
      </template>
    </van-cell>
    <div style="height:40rpx;width: 750rpx;"></div>
    <m-classify-tip :content="classifyTip"></m-classify-tip>
  </div>
</template>

<script>
import api from "@/api/index";
import utils from "@/utils/index";
export default {
  data() {
    return {
      classifyTip:['地方题库,如有个别地区增加【地方题库】,请选择该区域的【地方题库】+【必学题】学习,如果没有无需学习地方题库'],
      classData: [],
      query: {},
    };
  },
  onLoad(op) {
    this.query = op;
  },
  methods: {
    goExercise(extraQuery) {
      let query = Object.assign({}, this.query);
      if (extraQuery) {
        query = {
          ...query,
          ...extraQuery,
        };
      } else {
      }

      uni.navigateTo({
        url: "/otherPages/exercise/index?" + utils.mapToUrlQuery(query),
      });
    },
    getClassData() {
      api.exam
        .studentQuestionInfoSelectDfQuestionInfo(this.query)
        .then((res) => {
           res.data.shift()
          this.classData = res.data;
        });
    },
  },
  mounted() {
    this.getClassData();
  },
};
// const {
// 	route: { query },
// 	router: { push },
// } = new RouterBus();
// const classData = ref();
// getTopicClass(query.path as string, query).then(({ data }) => {
// 	//地方专题第一个选项去掉
// 	if (query.title == "地方专题") {
// 		data.data?.shift();
// 	}

// 	classData.value = data.data;
// });
</script>

<style lang="scss" scoped>
.cell-box {
  display: flex;
  padding: 5px 15px;
  flex-wrap: wrap;
  justify-content: space-between;
  .cell {
    width: 167px;
    margin-top: 10px;
    box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
  }
  .icon {
    width: 20px;
    height: 20px;
    background: #498ef5;
    border-radius: 50%;
    font-weight: 500;
    font-family: PingFang SC;
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    margin-right: 5px;
  }
}
</style>
