homeQuick.vue 8.34 KB
<template>
  <div class="itemBox" v-if="language === 0">
    <el-row :gutter="20">
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(0)"><img src="@/assets/dance/btn01.png">签证服务</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(1)"><img src="@/assets/dance/btn02.png">酒店预订</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(2)"><img src="@/assets/dance/btn03.png">接送服务</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(10)"><img src="@/assets/dance/btn04.png">票务服务</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="goMedia"><img src="@/assets/dance/btn07.png">媒体注册</div>
      </el-col>
      <!--      <el-col :sm="12" :lg="4" :xs="12">-->
      <!--        <div class="item" @click="goAround"><img src="@/assets/dance/btn06.png">周边活动</div>-->
      <!--      </el-col>-->
      <!--      <el-col :sm="12" :lg="4" :xs="12">-->
      <!--        <div class="item" @click="liveClick"><img src="@/assets/dance/btn05.png">赛事直播</div>-->
      <!--      </el-col>-->
    </el-row>
  </div>
  <div class="itemBox_en" v-else>
    <el-row :gutter="20" justify="space-around">
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(0)"><img src="@/assets/dance/btn01.png">Visa Services</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(1)"><img src="@/assets/dance/btn02.png">HOTEL RESERVATION</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(2)"><img src="@/assets/dance/btn03.png">TRANSPORTATION RESERVATION</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="popRemark(10)"><img src="@/assets/dance/btn04.png">TICKET SERVICES</div>
      </el-col>
      <el-col :sm="12" :lg="4" :xs="12">
        <div class="item" @click="goMedia"><img src="@/assets/dance/btn07.png">Media Registration</div>
      </el-col>
      <!--      <el-col :sm="12" :lg="4" :xs="12">-->
      <!--        <div class="item" @click="goAround"><img src="@/assets/dance/btn06.png">Around Activity</div>-->
      <!--      </el-col>-->

      <!--      <el-col :sm="12" :lg="4" :xs="12">-->
      <!--        <div class="item" @click="liveClick"><img src="@/assets/dance/btn05.png">live streaming</div>-->
      <!--      </el-col>-->
    </el-row>
  </div>
  <order-remark ref="orderRemarkRef" @submit="goBooking"/>
  <affix-invitation ref="dialogInvitationRef"/>
  <!--  媒体注册-->
  <media-register ref="mediaRegisterRef"/>
</template>

<script setup>
import {useRouter} from "vue-router";

const router = useRouter()
import OrderRemark from '@/viewsPc/components/orderRemark'
import AffixInvitation from '@/viewsPc/match/components/affix-invitation'
import MediaRegister from '@/viewsPc/components/mediaRegister.vue'

const {proxy} = getCurrentInstance()
import {useStorage} from "@vueuse/core/index";
import {ElMessage} from "element-plus";
import {getCurrentInstance} from "@vue/runtime-core";
import {computed, onMounted, watch} from "vue";
import {getBaseInfoByActiveId} from "@/apiPc/booking";
import * as match from "@/apiPc/match";
import useUserStore from "@/store/modules/user";

const props = defineProps({
  matchId: {
    type: String,
    required: true,
    default: '0'
  },
  cptName: {
    type: String,
    required: true,
    default: ''
  }
})
const language = useStorage('language', 0)
const form = ref({})
const liveData = ref({})
const matchId = computed(() => props.matchId);

watch(matchId, (val) => {
  if (val && val != '0') {
    getBaseInfoByActiveId(props.matchId).then(res => {
      form.value = res.data || null
    }).catch(err => {
      console.log(err)
      form.value = null
    })

    match.getInfoByCptId({cptId: props.matchId}).then((res) => {
      liveData.value = res.data || {}
    })
  }
})

const liveClick = () => {
  if (liveData.value.videoStatus == "1") {

    if (language.value == 0) {

      window.open(liveData.value.videoUrlCn)
    } else {
      window.open(liveData.value.videoUrlEn)
    }
  } else {
    ElMessage.warning(language.value == 0 ? '暂无直播' : 'No live')
  }
}

const goAbout = () => {
  router.push({path: `/about/wuDao`})
}
const goAround = () => {
  //周边活动
  router.push({path: `/about/wuDao`, query: {activeIndex: '2'}})
}

onMounted(() => {

})

function building() {
  ElMessage.warning(language.value == 0 ? '感谢您对本次比赛的关注,该服务暂无可预订信息,敬请期待。' : 'Thank you for your attention to this competition. The service is currently unavailable for booking. Please stay tuned.')
  return
}

function applyInvitation() {
  var obj = {
    title: language.value == 0 ? '邀请函申请' : 'Visa Invitation Letter ',
    cptId: matchId.value,
  }
  proxy.$refs['dialogInvitationRef'].open(obj)
}

const user = useUserStore().user

function goMedia() {
  proxy.$modal.msgWarning(language.value == 0 ? '暂未开放' :'Not yet open')
  return;

  //如果没登录
  if (!user) {
    ElMessage({
      type: 'warning',
      message: language.value == 0 ? '请先登录' : 'Please login first',
    })
    return
  }

  proxy.$refs['mediaRegisterRef'].open({cptId: matchId.value})
}

function popRemark(type) {
  if (!form.value) {
    building()
    return
  }

  if (type == '0') {
    // 签证
    if (language.value === 0) {
      ElMessage.warning('请切换英文页面办理')
      return
    } else {
      if (!user) {
        ElMessage({
          type: 'warning',
          message: language.value == 0 ? '请先登录' : 'Please login first',
        })
        return
      }

      applyInvitation()
      return
    }
  }

  if ((form.value.isJdView == 0 && type == '1')
      || (form.value.isCarView == 0 && type == '2')
      || (form.value.isFoodView == 0 && type == '3')
      || (form.value.isMealView == 0 && type == '4')
      || (form.value.isPhotoView == 0 && type == '5')
      || (form.value.isTicketView == 0 && type == '10')
  ) {
    building()
    return
  }
  const params = {
    matchId: props.matchId,
    title: language.value == 0 ? '预订说明' : 'Booking Instructions',
    type: type,
    cptName: props.cptName
  }
  proxy.$refs['orderRemarkRef'].open(params)
}

function goBooking(n, f) {
  switch (n) {
    case 10:
      // 票务

      // router.push({
      // path: `/booking/ticket/${props.matchId}`,
      // params: {id:props.matchId},
      // query: {id: props.matchId}
      // })
      break;
    case 1:
      //酒店
      router.push({path: `/booking/hotel/${props.matchId}`, query: {flag: f}})
      break;
    case 2:
      //车辆
      router.push({path: `/booking/car/${props.matchId}`})
      break;
    case 3:
      //餐饮
      router.push({path: `/booking/dinner/${props.matchId}`})
      break;
    case 4:
      //化妆
      router.push({path: `/booking/makeup/${props.matchId}`})
      break;
    case 5:
      //拍照
      router.push({path: `/booking/photography/${props.matchId}`})
      break;
  }
}
</script>

<style scoped lang="scss">
.itemBox, .itemBox_en {
  padding: 20px;
  background: #fff;
  box-shadow: 0 0 46px 0 rgba(1, 16, 64, 0.08);
  border-radius: 20px;
}

:deep(.el-col) {
  max-width: 20%;
  flex: 0 0 20%;
}

.item {
  //box-shadow: 0px 0px 21px 0px rgba(41, 23, 101, 0.14);
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: url("@/assets/dance/btn_bg.png") no-repeat left #FFFFFF;
  background-size: 100% 100%;
  border-radius: 15px;
  gap: 10px;

  img {
    object-fit: contain;
    width: 75px;
    height: 75px;
  }
}

.itemBox_en .item {
  flex-direction: column;
  text-align: center;
  text-transform: uppercase;
  height: 100%;

  img {
    position: relative;
    transition: all 0.2s;
  }

  &:hover {
    box-shadow: 0 0 10px #eee;

    img {
      transform: rotateY(180deg);
    }

    p {
      color: #000;
    }
  }
}

@media screen and (max-width: 768px) {
  .itemBox, .itemBox_en {
    padding: 0 20px 0
  }
  .item {
    font-size: 16px;
    height: auto !important;
    padding: 15px 0;
    margin: 10px 0;

    img {
      width: 50px;
      height: 50px
    }
  }
  :deep(.el-col) {
    max-width: 50%;
    flex: 0 0 50%;
  }
}
</style>