<template>
  <div class="epidemic">
    <div class="wrapper" v-for="(item, index) in mockData" :key="index">
      <div class="cell" @click="jump(item)">
        <p>{{ item.name }}</p>
      </div>
    </div>
  </div>
</template>

<script>
import { epidemicArea } from "@/api/epidemic";
export default {
  data() {
    return {
      mockData: [],
    };
  },
  methods: {
    initData() {
      epidemicArea().then((res) => {
        this.mockData = res.data;
        console.log(this.mockData);
      });
    },
    jump(item) {
      console.log(item);
      this.$router.push({
        name: "EpidemicInformation",
        query: {
          code: item.code,
          name: item.name,
        },
      });
    },
  },
  mounted() {},
  created() {
    this.initData();
  },
};
</script>

<style lang="stylus" scoped>
.epidemic {
  display: flex;
  flex-direction: column;

  .wrapper {
    padding: 25px;

    .cell {
      padding: 22px 25px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: linear-gradient(270deg, #FF8C4B 0%, #FFB64E 100%);
      box-shadow: 0px 2px 4px 0px #BBBBBB;
      border-radius: 10px;

      p {
        padding: 0;
        font-size: 50px;
        font-weight: 500;
        color: #fff;
      }
    }
  }
}
</style>