<template>
  <div class="cell-box">
    <van-cell
      class="cell"
      :title="
        item.placeIssueName ||
        item.classIssueName ||
        item.excellIssueName ||
        item.sequeIssueName
      "
      is-link
      @click="goExercise({
        classIssueName:item.classIssueName

      })"
      center
      v-for="(item, index) in classData"
      :key="index"
      :border="false"
    >
      <template #icon>
        <div class="icon">{{ index + 1 }}</div>
      </template>
    </van-cell>
  </div>
</template>

<script >
import api from "@/api/index";
import utils from "@/utils/index";
export default {
  data() {
    return {
      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
        .studentQuestionInfoSelectFlQuestionInfo(this.query)
        .then((res) => {
          this.classData = res.data;
        });
    },
  },
  mounted() {
    this.getClassData();
  },
};
</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);
    background: #fff;
  }
  //地区
  .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>
