matchNews.vue 2.82 KB
<template>
  <el-card :body-style="{padding: '10px'}" class="mb20">
<!--    <div>-->
<!--      <div class="liveImgbox" @click="goDetail(newsList[0])">-->
<!--        <i class="ii">{{ language==0?'直播中':'Live' }}</i>-->
<!--        <img :src="fillImgUrl_webSite(newsList[0]?.picUrl)">-->
<!--      </div>-->
<!--    </div>-->

    <div class="indexTitle">
      <h3 class="leftboderTT">{{ language==0?'赛事报道':'Special reports' }}</h3>
<!--      <a class="more" @click="goList(query2.sortId,'专题报道')">MORE</a>-->
    </div>
    <div>
      <div class="item" v-for="n in newsList" :key="n.id">
        <p class="esp">{{ n.name }}</p>
      </div>
    </div>

    <div class="indexTitle"><h3 class="leftboderTT">{{ language==0?'赛事视频':'Event Videos' }}</h3>
<!--      <a class="more" @click="goList(10000006,'赛事视频')">MORE</a>-->
    </div>
    <div class="item" v-for="n in newsList2" :key="n.id">
      <div class="videoImgbox" @click="goDetail(n)">
        <img :src="fillImgUrl_webSite(n.picUrl)">
      </div>
    </div>
    <div class="indexTitle"><h3 class="leftboderTT">{{ language==0?'赛事图片':'Event Photos' }}</h3>
<!--      <a class="more" @click="goList(10000007,'赛事图片')">MORE</a>-->
    </div>
    <div v-for="n in newsList3" :key="n.id">
      <div class="picbox"  @click="goDetail(n)"><img :src="fillImgUrl_webSite(n.picUrl)"/></div>
    </div>
  </el-card>
</template>

<script setup>
import {getNewsListById} from "@/apiPc/webSite";
import {onMounted, ref} from "vue";
import cache from '@/plugins/cache'
const language = ref(cache.local.get('language') || 0)
const props = defineProps({
  matchId: {
    type: String,
    required: true
  }
})
const newsList = ref([])
const newsList2 = ref([])
const newsList3 = ref([])
const query1 = ref({
  pageSize: 1,
  pageNum: 1,
  code:  `${props.matchId}${language.value == 0 ?'100':'101'}2`
})
const query2 = ref({
  pageSize: 3,
  pageNum: 1,
  code:  `${props.matchId}${language.value == 0 ?'100':'101'}1`
})
const query3 = ref({
  pageSize: 1,
  pageNum: 1,
  code:  `${props.matchId}${language.value == 0 ?'100':'101'}3`
})
onMounted(() => {
  getList(query1.value)
  getList2(query2.value)
  getList3(query3.value)
})
const getList = (obj) => {
  getNewsListById(obj).then(res => {
    newsList.value = res.rows
  })
}
const getList2 = (obj) => {
  getNewsListById(obj).then(res => {
    newsList2.value = res.rows
  })
}
const getList3 = (obj) => {
  getNewsListById(obj).then(res => {
    newsList3.value = res.rows
  })
}
const goList = (sortId,name) => {
  router.push({
    path: `/news/list/${sortId}`,
    query:{
      kindName:name
    }
  })
}
</script>

<style scoped lang="scss">
.indexTitle{margin: 20px 0 12px;
h3{
  font-size: 20px;
  color:var(--el-color-primary);
}
}
.item:hover{cursor: pointer;color: var(--el-color-primary)}
.indexTitle a.more{top: 0;}
</style>