index.vue 2.74 KB
<template>
    <div class="box">
      <div class="mt20"/>
      <el-card>
        <el-row :gutter="20">
          <el-col :sm="24" :lg="12">
            <!--赛事日历-->
            <match-calendar @select-date="getScheduleList"></match-calendar>
          </el-col>
          <el-col :sm="24" :lg="12">
            <div class="calendarList">
              <ul v-loading="loading">
                <li v-for="n in schList" @click="goMatch(n)">
                  <label>{{ n.timeStr }}</label>
                  <div class="esp mt5">{{ n.name }}</div>
                </li>
                <el-empty v-if="schList.length== 0" :image="`/img/order_no.png`" :image-size="200"/>
              </ul>
            </div>

          </el-col>
        </el-row>
      </el-card>
<!--      <match-cj />-->
    </div>
</template>

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


const router = useRouter()

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

function getScheduleList(params) {
  loading.value = true
  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 scoped lang="scss">
.calendarList {
  border: 1px solid #F0F0F0;
  padding: 12px 20px 0;
  overflow: hidden;
  height: 100%;

  ul {
    overflow: auto;
    height: 330px;
    margin: 0;

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

      label {
        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: #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: #000;

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