|
@@ -2,21 +2,26 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<!-- 轮播 -->
|
|
|
- <v-carousel v-if="jobFair?.pcHeadImg && jobFair?.pcHeadImg.length > 0" :show-arrows="jobFair?.pcHeadImg.length > 1 ? 'hover' : false" cycle :hide-delimiters="true" style="height: 500px;">
|
|
|
+ <v-carousel
|
|
|
+ v-if="jobFair?.pcHeadImg && jobFair?.pcHeadImg.length > 0"
|
|
|
+ :show-arrows="jobFair?.pcHeadImg.length > 1 ? 'hover' : false"
|
|
|
+ cycle :hide-delimiters="true"
|
|
|
+ :style="{'height': isMobile ? '200px' : '500px'}"
|
|
|
+ >
|
|
|
<v-carousel-item v-for="(k, i) in jobFair?.pcHeadImg" :key="i">
|
|
|
<img :src="k" :lazy-src="k" style="width: 100%; height:100%;">
|
|
|
</v-carousel-item>
|
|
|
</v-carousel>
|
|
|
|
|
|
- <div :style="{'background-color': jobFair.backgroundColour || '#fff', 'min-height': jobFair?.pcHeadImg && jobFair?.pcHeadImg.length > 0 ? 'calc(100vh - 500px)' : '100vh'}">
|
|
|
- <div class="default-width">
|
|
|
+ <div :style="{'background-color': jobFair.backgroundColour || '#fff', 'min-height': jobFair?.pcHeadImg && jobFair?.pcHeadImg.length > 0 ? `calc(100vh - ${isMobile ? '200px' : '500px'})` : '100vh'}">
|
|
|
+ <div :class="{'default-width': !isMobile}">
|
|
|
<!-- 类别展示 -->
|
|
|
- <div class="d-flex align-center" v-if="jobFair?.tag && jobFair.tag.length">
|
|
|
+ <div class="d-flex align-center" v-if="jobFair?.tag && jobFair.tag.length" style="overflow-x: auto;">
|
|
|
<div
|
|
|
v-for="(val, index) in jobFair.tag"
|
|
|
:key="index"
|
|
|
- class="tag-item"
|
|
|
- :class="{'tag-active': index === tab}"
|
|
|
+ class="tag-item"
|
|
|
+ :class="[{'tag-active': index === tab}, {'mx-5': isMobile}]"
|
|
|
:style="{'width': `calc(100% / ${jobFair.tag.length} )`}"
|
|
|
@click.stop="handleTabClick(index)"
|
|
|
>
|
|
@@ -26,8 +31,8 @@
|
|
|
|
|
|
<div v-if="!items.length" class="emptyText">{{ loadingType === 1 ? loadingText[loadingType] : '暂无数据,去看看其他吧~' }}</div>
|
|
|
<template v-else>
|
|
|
- <EntCard v-if="jobFair?.category === '0'" :jobFairId="jobFair?.id" :list="items" class="mt-5" />
|
|
|
- <JobCard v-if="jobFair?.category === '1'" :jobFairId="jobFair?.id" :list="items" class="mt-5" />
|
|
|
+ <EntCard v-if="jobFair?.category === '0'" :jobFairId="jobFair?.id" :list="items" :isMobile="isMobile" class="mt-5" />
|
|
|
+ <JobCard v-if="jobFair?.category === '1'" :jobFairId="jobFair?.id" :list="items" :isMobile="isMobile" class="mt-5" />
|
|
|
<div :class="['loading', {'loadMoreText': !loadingType}]" class="pb-5" @click="handleChangePage">{{ loadingText[loadingType] }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -37,7 +42,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({name: 'jobFair-enterprises'})
|
|
|
-import { ref, reactive } from 'vue'
|
|
|
+import { ref, reactive, onMounted } from 'vue'
|
|
|
import { getJobFairEnterprisePage, getJobFair, getJobFairEntJobPage } from '@/api/recruit/personal/jobFair'
|
|
|
import EntCard from './components/entCard1.vue'
|
|
|
import JobCard from './components/jobCard1.vue'
|
|
@@ -51,6 +56,12 @@ const query = reactive({
|
|
|
jobFairId: route.params.id
|
|
|
})
|
|
|
|
|
|
+const isMobile = ref(false)
|
|
|
+onMounted(() => {
|
|
|
+ const userAgent = navigator.userAgent
|
|
|
+ isMobile.value = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(userAgent)
|
|
|
+})
|
|
|
+
|
|
|
const items = ref([])
|
|
|
const loadingText = ['点击加载更多', '加载中...', '']
|
|
|
const loadingType = ref(0)
|
|
@@ -124,6 +135,7 @@ const handleChangePage = () => {
|
|
|
line-height: 74px;
|
|
|
opacity: .8;
|
|
|
cursor: pointer;
|
|
|
+ text-wrap: nowrap;
|
|
|
}
|
|
|
.tag-active {
|
|
|
opacity: 1;
|