detail.vue 4.59 KB
<template>
  <div>
    <div class="box">
      <el-button class="back-btn" @click="goback()">{{ languageLibrary[language].a }}</el-button>
      <el-row class="detail-title">
        <el-col :span="4">
          <span v-if="projectMainInfo.enrollStatusStr == '未开始'" style="background: #3194FA;border-radius:6px 0 6px 0;padding: 0 4px">{{ languageLibrary[language].g }}</span>
          <span v-else-if="projectMainInfo.enrollStatusStr == '进行中'" style="background: #21C9AB;border-radius:6px 0 6px 0;padding: 0 4px">{{ languageLibrary[language].h }}</span>
          <span v-else style="background: #929AA0;border-radius:6px 0 6px 0;padding: 0 4px">{{ languageLibrary[language].i }}</span>
        </el-col>
        <el-col :span="6">
          <span style="font-size: 20px;font-weight: bold;margin-bottom: 5px">{{projectMainInfo.name}}</span>
<!--          <div style="display: flex;flex-direction: column;">-->
<!--            <span style="font-size: 20px;font-weight: bold;margin-bottom: 5px">{{projectMainInfo.name}}</span>-->
<!--            <span>{{projectMainInfo.beginTime + '~' + projectMainInfo.endTime}}</span>-->
<!--          </div>-->
        </el-col>
        <el-col :span="14">
          <span>比赛时间: {{projectMainInfo.beginTime + '~' + projectMainInfo.endTime}}</span>
        </el-col>

<!--        <el-col style="border-left: 1px solid #929AA0;border-right: 1px solid #929AA0" :span="4">-->
<!--          <div style="display: flex;flex-direction: column;text-align: center">-->
<!--            <span style="font-size: 14px;color: #929AA0;margin-bottom: 5px">{{ languageLibrary[language].b }}</span>-->
<!--            <span style="color: #EEEEEE;font-size: 16px">${{projectMainInfo.serviceFee}}</span>-->
<!--          </div>-->
<!--        </el-col>-->
<!--        <el-col :span="4">-->
<!--          <div style="display: flex;flex-direction: column;text-align: center">-->
<!--            <span style="font-size: 14px;color: #929AA0;margin-bottom: 5px">{{ languageLibrary[language].c }}</span>-->
<!--            <span style="color: #EEEEEE;font-size: 16px">{{projectMainInfo.projectFormat}}</span>-->
<!--          </div>-->
<!--        </el-col>-->
      </el-row>

      <el-row>
        <el-col class="photo-space" :lg="12" v-for="item in photoList">
          <div class="photo-img-group">
            <img class="photo-img" :src="fillImgUrl(item.path)">
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script setup>
import { onMounted, onUnmounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import {useStorage} from "@vueuse/core";
import {getMain,getImgList} from '@/apiPc/webSite'

const router = useRouter()
const route = useRoute()
const activeName = ref("first")
const language = useStorage('language', 1)
const languageLibrary = ref([{
  a:'返回',
  b:'总买入费用',
  c:'参赛席位',
  g:'未开始',
  h:'进行中',
  i:'已结束',
},{
  a:'Return',
  b:'Total buy-in fee',
  c:'Entry seats',
  g:'Not started',
  h:'In progress',
  i:'Completed',
},{
  a:'돌아가기',
  b:'총 바이인 금액',
  c:'엔트리 수',
  g:'시작 전',
  h:'진행 중',
  i:'완료됨',
},{
  a:'戻る',
  b:'バイイン総額',
  c:'エントリー数',
  g:'未開始',
  h:'進行中',
  i:'完了',
},{
  a:'Quay lại',
  b:'Tổng phí Buy-in',
  c:'Số ghế tham gia',
  g:'Chưa bắt đầu',
  h:'Đang diễn ra',
  i:'Đã hoàn thành',
}])

const tId = ref()
const projectMainInfo = ref({})
const photoList = ref([])

onMounted(() => {
  tId.value = route.params.id
  getMainInfo()
  getPhotoList()
})

const getMainInfo = () => {
  getMain(tId.value).then(res => {
    if (res.code === 200) {
      projectMainInfo.value = res.data
    }
  })
}

const getPhotoList = () => {
  getImgList({cptId:tId.value}).then(res => {
    if (res.code === 200) {
      photoList.value = res.rows
    }
  })
}

const goback = function () {
  router.go(-1)
}

</script>
<style lang="scss" scoped>
.box {
  padding: 0 10%;
}

.back-btn {
  font-size: 16px;
  color: #fff;
  background: url("@/assets/v1/arrow_left.png") no-repeat left;
  background-size: auto 35px;
  padding-left: 35px;
  box-shadow: none;
  border: none;
}

.detail-title {
  color: #fff;
  background: #1F2644;
  padding: 40px 30px;
  border-radius: 15px;
  display: flex;
  align-items: center;

  .not-start {
    display: inline-block;
    background: #3194FA;
    border-radius:6px 0 6px 0;
    padding: 0 4px
  }
}

.photo-space {
  padding: 10px;
}

.photo-img-group {
  padding: 20px;
  width: 100%;
  position: relative;
}

.photo-img {
  width: 100%;
  aspect-ratio: 3/2;
  cursor: pointer;
}
</style>