<template>
  <view class="bg-white">
    <div class="cell-box">
      <view v-for="(item, index) in classData" :key="index">
        <van-cell
          value-class="custom-right-cell"
          class="cell"
          :title="
            item.placeIssueName ||
            item.classIssueName ||
            item.excellIssueName ||
            item.sequeIssueName
          "
          center
          :border="false"
        >
          <div class="select">
            <div
              class="select-item0"
              @click="
                () => {
                  goExercise({
                    sequeIssueName: item.sequeIssueName,
                  });
                }
              "
            >
              语音讲解
            </div>
            <div
              @click="
                () => {
                  goExercise({
                    sequeIssueName: item.sequeIssueName,
                  });
                }
              "
              class="select-item1"
            >
              单项测试
            </div>
          </div>
          <template #icon>
            <div class="icon">{{ index + 1 }}</div>
          </template>
        </van-cell>
      </view>
    </div>
    <!-- <div style="height: 40rpx; width: 750rpx"></div>
    <div style="padding:0rpx 15rpx">
         <m-classify-tip :content="classifyTip"></m-classify-tip>
    </div> -->
  </view>
</template>

<script>
import api from "@/api/index";
import utils from "@/utils/index";
export default {
  data() {
    return {
      classData: [],
      classifyTip:['软件题库已同步更新至车管所最新'],
      query: {
        title: "",
        vehicle: "",
      },
    };
  },
  methods: {
    goExercise(extraQuery) {
      let query = Object.assign({}, this.query);
      if (extraQuery) {
        query = {
          ...query,
          ...extraQuery,
        };
      } else {
      }

      uni.navigateTo({
        url: "/otherPages/exercise/index?" + utils.mapToUrlQuery(query),
      });
    },
  },
  onLoad(op) {
    this.query = op;
  },
  mounted() {
    api.exam.studentQuestionInfoSelectSxQuestionInfo(this.query).then((res) => {
      if (this.query.vehicle === "摩托车") {
        this.classData = res.data;
      } else {
        res.data.shift();
        this.classData = res.data;
      }
    });
  },
};
</script>
<style>
.custom-right-cell {
  flex: 1.2 !important;
}
</style>

<style lang="scss" scoped>
.bg-white {
  background: #ffffff;
}
.cell-box {
  display: flex;
  padding: 5px 15px;
  flex-wrap: wrap;
  justify-content: space-between;
  > view {
    width: 100%;
    border-bottom: 1px solid #ddd;
  }
  .cell {
    width: 100%;

    line-height: 28px;

    // box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
  }
  .select {
    display: flex;
    flex-direction: row;
    color: white;
    flex: 1.2;

    .select-item0 {
      padding: 0 18rpx;
      background: #498ef5;
      margin-right: 20rpx;
      border-radius: 8rpx;
      font-size: 24rpx;
    }

    .select-item1 {
      padding: 0 18rpx;
      background: #06bd5e;
      font-size: 24rpx;
      border-radius: 16rpx;
    }
  }
  .icon {
    width: 40rpx;
    height: 40rpx;
    background: #498ef5;
    border-radius: 50%;
    font-weight: 500;
    font-family: PingFang SC;
    font-size: 26rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    margin-right: 10rpx;
  }
}
</style>