<style scoped>
.title {
  font-size: 26px;
  font-family: Microsoft JhengHei;
  font-weight: bold;
  color: #000000;
  line-height: 44px;
  margin-top: 30px;
  margin-bottom: 10px;
}
.card {
  width: 210px;
  height: 290px;
  border-radius: 10px;
  margin-right: 20px;
}
.card-img {
  width: 210px;
  height: 290px;
  border-radius: 10px;
  object-fit: cover;
}
.info {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #fff;
}
.all {
  margin: 20px auto;
  width: 320px;
  height: 42px;
  border: 1px solid #474747;
  border-radius: 8px;
}
</style>
<template>
  <div>
    <div class="title">附近的城市</div>
    <div class="flex">
      <div
        @click="navToSearch(item)"
        class="relative card"
        v-for="item in cityList"
        :key="item.Id"
      >
        <img class="card-img" :src="item.ImageList[0]" />
        <div class="info">
          <div>{{ item.AreaName }}</div>
          <!-- <div>10Km</div> -->
        </div>
      </div>
    </div>
    <div class="flex flex-center">
      <q-btn
        @click="navToSearch()"
        label="所有目的地"
        class="all"
        unelevated
      ></q-btn>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    cityList: {
      default: () => [],
    },
    name: {
      default: () => ({}),
    },
  },
  data() {
    return {};
  },
  methods: {
    navToSearch(item) {
      console.log("navToDetail", item);
      let params = {
        qsearchDate: this.searchDate,
        qsearchEndDate: this.searchEndDate,
      };
      if (item) {
        params.qsearchKey = item.AreaName
      }
      this.CommonJump("/search", params);
    },
  },
};
</script>