homeCalendar.vue 2.53 KB
<template>
  <div>
    <match-calendar @select-date="getScheduleList"></match-calendar>

    <div class="calendarList">
      <ul v-loading="loading">
        <li v-for="n in schList" :key="n.id" @click="goMatch(n)">
          <label>{{ n.timeStr }}</label>
          <div class="esp mt5">{{ n.name }}</div>
        </li>
      </ul>
      <el-empty
          v-if="schList.length== 0"
          :image="`/img/order_no.png`"
          :image-size="200" style="--el-empty-padding:0;--el-empty-description-margin-top:0"
      />
    </div>
  </div>
</template>

<script setup>
import {ref} from 'vue'
import {useRouter} from 'vue-router'
import MatchCalendar from "/@/viewsPc/components/matchCalendar.vue";
import {getIndexScheduleList} from "/@/apiPc/common";

const router = useRouter()
const schList = ref([])
const loading = ref(false)

async function getScheduleList(params) {
  loading.value = true
  await getIndexScheduleList(params).then(res => {
    loading.value = false
    schList.value = res.data
  })
}

function goMatch(n) {
  router.push({
    name: 'matchDetail',
    params: {
      id: n.cptId
    },
    query: {
      matchId: n.cptId
    }
  })
}


</script>

<style lang="scss" scoped>
.calendarList {
  border: 1px solid #F0F0F0;
  padding: 12px 20px;
  overflow: auto;
  height: 225px;

  ul {
    li {
      cursor: pointer;
      background: #F6F9FE;
      margin: 7px 0 7px 20px;
      position: relative;
      padding: 13px;
      border-radius: 10px;
      font-weight: 500;
      font-size: 15px;

      label {
        //color: #453DEA;
        color: #000;
        margin-right: 15px;

        &::before {
          content: '';
          background: #fff;
          left: -17px;
          top: 0px;
          bottom: 0;
          margin: auto;
          border-radius: 50%;
          width: 2px;
          height: 2px;
          position: absolute;
          z-index: 1
        }
      }
    }

    li::before {
      content: '';
      //background: linear-gradient(0deg, #8623FC, #453DEA);
      background: #000;
      border-radius: 50%;
      width: 8px;
      height: 8px;
      position: absolute;
      left: -20px;
      top: 0;
      bottom: 0;
      margin: auto;
      z-index: 1;
    }

    li::after {
      content: '';
      left: -16px;
      width: 1px;
      height: 100%;
      background: #EBEBEB;
      position: absolute;
      top: 20px
    }

    li:hover {
      color: #fff;
      //background: linear-gradient(-90deg, #8623FC, #453DEA);
      background: #000;

      label {
        color: #fff;
      }
    }
  }
}
</style>