<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>
    <q-scroll-area
      :thumb-style="thumbStyle"
      style="height: 290px;width100%;"
    >
        <div class="row no-wrap">
          <div
          @click="navToSearch(item)"
          class="relative card cursor-pointer"
          v-for="item in cityList"
          :key="item.Id"
        >
          <img class="card-img" :src="item.ImageList[0]" />
          <div class="info">
            <div class="text-subtitle1 text-weight-bold text-shadow">{{ item.AreaName }}</div>
            <!-- <div>10Km</div> -->
          </div>
        </div>
        </div>
      
    </q-scroll-area>
    <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 {
      thumbStyle: {
        right: '2px',
        borderRadius: '2px',
        backgroundColor: '#027be3',
        width: '2px',
        opacity: '0'
      }
    };
  },
  methods: {
    navToSearch(item) {
      let params = {
        qsearchDate: this.searchDate,
        qsearchEndDate: this.searchEndDate,
      };
      if (item) {
        params.areaId = item.Id
      }
      this.CommonJump("/search", params);
    },
  },
};
</script>