|
|
@@ -5,27 +5,35 @@
|
|
|
<div class="carousel-section">
|
|
|
<el-carousel height="180px" indicator-position="bottom" :interval="4000">
|
|
|
<el-carousel-item v-for="item in bannerData" :key="item.carouselId">
|
|
|
- <img :src="getImg(item)" :alt="getTitle(item) || '轮播图'" class="carousel-img">
|
|
|
+ <img :src="getImg(item)" :alt="getTitle(item) || '轮播图'" class="carousel-img" />
|
|
|
</el-carousel-item>
|
|
|
</el-carousel>
|
|
|
</div>
|
|
|
|
|
|
<!-- 功能区域 -->
|
|
|
<div class="function-section">
|
|
|
- <div class="function-item" :class="{ 'disabled': isPreviewMode }" @click="handleFunctionClick('visit')">
|
|
|
- <img src="@/assets/indexPage/visit.png" alt="预约参观" class="function-icon">
|
|
|
+ <div
|
|
|
+ class="function-item"
|
|
|
+ :class="{ disabled: isPreviewMode }"
|
|
|
+ @click="handleFunctionClick('visit')"
|
|
|
+ >
|
|
|
+ <img src="@/assets/indexPage/visit.png" alt="预约参观" class="function-icon" />
|
|
|
<span class="function-text">预约参观</span>
|
|
|
</div>
|
|
|
- <div class="function-item" :class="{ 'disabled': isPreviewMode }" @click="handleFunctionClick('activity')">
|
|
|
- <img src="@/assets/indexPage/activity.png" alt="活动预约" class="function-icon">
|
|
|
+ <div
|
|
|
+ class="function-item"
|
|
|
+ :class="{ disabled: isPreviewMode }"
|
|
|
+ @click="handleFunctionClick('activity')"
|
|
|
+ >
|
|
|
+ <img src="@/assets/indexPage/activity.png" alt="活动预约" class="function-icon" />
|
|
|
<span class="function-text">活动预约</span>
|
|
|
</div>
|
|
|
<div class="function-item" @click="handleFunctionClick('map')">
|
|
|
- <img src="@/assets/indexPage/map.png" alt="展馆地图" class="function-icon">
|
|
|
+ <img src="@/assets/indexPage/map.png" alt="展馆地图" class="function-icon" />
|
|
|
<span class="function-text">展馆地图</span>
|
|
|
</div>
|
|
|
<div class="function-item" @click="handleFunctionClick('introduce')">
|
|
|
- <img src="@/assets/indexPage/introduce.png" alt="展馆介绍" class="function-icon">
|
|
|
+ <img src="@/assets/indexPage/introduce.png" alt="展馆介绍" class="function-icon" />
|
|
|
<span class="function-text">展馆介绍</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -36,13 +44,18 @@
|
|
|
<h3 class="section-title">展览资讯</h3>
|
|
|
<span class="view-more" @click="viewMore('recommended')">查看更多 +</span>
|
|
|
</div>
|
|
|
- <div class="news-item" v-for="item in newsList" :key="item.informationId" @click="viewNews(item)">
|
|
|
- <img :src="getInfoImg(item)" alt="展览资讯" class="news-img">
|
|
|
+ <div
|
|
|
+ class="news-item"
|
|
|
+ v-for="item in newsList"
|
|
|
+ :key="item.informationId"
|
|
|
+ @click="viewNews(item)"
|
|
|
+ >
|
|
|
+ <img :src="getInfoImg(item)" alt="展览资讯" class="news-img" />
|
|
|
<div class="news-content">
|
|
|
<h4 class="news-title">{{ getTitle(item) }}</h4>
|
|
|
- <span class="news-desc"><el-icon>
|
|
|
- <SortUp />
|
|
|
- </el-icon></span>
|
|
|
+ <span class="news-desc"
|
|
|
+ ><el-icon> <SortUp /> </el-icon
|
|
|
+ ></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -55,9 +68,13 @@
|
|
|
</div>
|
|
|
<div class="scroll-container">
|
|
|
<div class="scroll-wrapper">
|
|
|
- <div class="exhibition-item" v-for="exhibition in exhibitionList" :key="exhibition.exhibitId"
|
|
|
- @click="viewExhibition(exhibition)">
|
|
|
- <img :src="getImg(exhibition)" alt="展览" class="exhibition-img">
|
|
|
+ <div
|
|
|
+ class="exhibition-item"
|
|
|
+ v-for="exhibition in exhibitionList"
|
|
|
+ :key="exhibition.exhibitId"
|
|
|
+ @click="viewExhibition(exhibition)"
|
|
|
+ >
|
|
|
+ <img :src="getImg(exhibition)" alt="展览" class="exhibition-img" />
|
|
|
<div class="exhibition-info">
|
|
|
<h4 class="exhibition-title">{{ getTitle(exhibition) }}</h4>
|
|
|
</div>
|
|
|
@@ -74,13 +91,17 @@
|
|
|
</div>
|
|
|
<div class="scroll-container">
|
|
|
<div class="scroll-wrapper">
|
|
|
- <div class="activity-item" v-for="active in activeList" :key="active.activityId"
|
|
|
- @click="viewActivity(active)">
|
|
|
+ <div
|
|
|
+ class="activity-item"
|
|
|
+ v-for="active in activeList"
|
|
|
+ :key="active.activityId"
|
|
|
+ @click="viewActivity(active)"
|
|
|
+ >
|
|
|
<div class="active-top">
|
|
|
- <img :src="getIndexImg(active)" alt="活动" class="activity-img">
|
|
|
- <span class="active-go"><el-icon>
|
|
|
- <ArrowRight />
|
|
|
- </el-icon></span>
|
|
|
+ <img :src="getIndexImg(active)" alt="活动" class="activity-img" />
|
|
|
+ <span class="active-go"
|
|
|
+ ><el-icon> <ArrowRight /> </el-icon
|
|
|
+ ></span>
|
|
|
</div>
|
|
|
<div class="activity-info">
|
|
|
<h4 class="activity-title">{{ getTitle(active) }}</h4>
|
|
|
@@ -102,13 +123,7 @@ const router = useRouter()
|
|
|
const route = useRoute()
|
|
|
const store = useStore()
|
|
|
// 使用首页API组合式函数
|
|
|
-const {
|
|
|
- bannerData,
|
|
|
- newsList,
|
|
|
- exhibitionList,
|
|
|
- activeList,
|
|
|
- initAllData
|
|
|
-} = useIndexPageApi()
|
|
|
+const { bannerData, newsList, exhibitionList, activeList, initAllData } = useIndexPageApi()
|
|
|
// 从vuex获取isFromParam
|
|
|
const isFromParam = computed(() => store.getters.getIsFrom)
|
|
|
|
|
|
@@ -156,7 +171,7 @@ const handleFunctionClick = (type) => {
|
|
|
if (isPreviewMode.value && !['map', 'introduce'].includes(type)) {
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ const preview = isPreviewMode.value ? '1' : ''
|
|
|
console.log(`点击了${type}功能`)
|
|
|
// 根据不同功能跳转到不同页面或显示不同内容
|
|
|
switch (type) {
|
|
|
@@ -177,8 +192,9 @@ const handleFunctionClick = (type) => {
|
|
|
path: '/allDetailsShow',
|
|
|
query: {
|
|
|
id: '1',
|
|
|
- type: 'museum'
|
|
|
- }
|
|
|
+ type: 'museum',
|
|
|
+ preview,
|
|
|
+ },
|
|
|
})
|
|
|
break
|
|
|
}
|
|
|
@@ -210,14 +226,14 @@ const viewExhibition = (exhibition) => {
|
|
|
const query = {
|
|
|
id: exhibition.exhibitId,
|
|
|
type: 'exhibition',
|
|
|
- isFromPage: 'indexPage'
|
|
|
+ isFromPage: 'indexPage',
|
|
|
}
|
|
|
if (isPreviewMode.value) {
|
|
|
query.preview = '1'
|
|
|
}
|
|
|
router.push({
|
|
|
path: '/allDetailsShow',
|
|
|
- query
|
|
|
+ query,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -228,14 +244,14 @@ const viewActivity = (active) => {
|
|
|
const query = {
|
|
|
id: active.activityId,
|
|
|
type: 'activity',
|
|
|
- isFromPage: 'indexPage'
|
|
|
+ isFromPage: 'indexPage',
|
|
|
}
|
|
|
if (isPreviewMode.value) {
|
|
|
query.preview = '1'
|
|
|
}
|
|
|
router.push({
|
|
|
path: '/allDetailsShow',
|
|
|
- query
|
|
|
+ query,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -246,14 +262,14 @@ const viewNews = (news) => {
|
|
|
const query = {
|
|
|
id: news.informationId,
|
|
|
type: 'information',
|
|
|
- isFromPage: 'indexPage'
|
|
|
+ isFromPage: 'indexPage',
|
|
|
}
|
|
|
if (isPreviewMode.value) {
|
|
|
query.preview = '1'
|
|
|
}
|
|
|
router.push({
|
|
|
path: '/allDetailsShow',
|
|
|
- query
|
|
|
+ query,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -267,7 +283,10 @@ const handleMapClick = async () => {
|
|
|
// 跳转到地图页面,并传递数据
|
|
|
router.push({
|
|
|
name: 'map',
|
|
|
- state: { mapData }
|
|
|
+ query: {
|
|
|
+ preview: isPreviewMode.value ? '1' : '',
|
|
|
+ },
|
|
|
+ state: { mapData },
|
|
|
})
|
|
|
} catch (error) {
|
|
|
console.error('获取地图数据失败:', error)
|
|
|
@@ -276,7 +295,6 @@ const handleMapClick = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
// 只有在首页路径时才初始化数据,避免路由跳转时重复触发
|
|
|
if (route.path === '/indexPage') {
|
|
|
@@ -288,7 +306,7 @@ onMounted(() => {
|
|
|
bannerParams: { pageNum: 1, pageSize: 5, status: statusValue },
|
|
|
newsParams: { pageNum: 1, pageSize: 3, status: statusValue },
|
|
|
exhibitionParams: { pageNum: 1, pageSize: 5, status: statusValue, recommend: 1 },
|
|
|
- activeParams: { pageNum: 1, pageSize: 5, status: statusValue }
|
|
|
+ activeParams: { pageNum: 1, pageSize: 5, status: statusValue },
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -364,7 +382,7 @@ onMounted(() => {
|
|
|
|
|
|
.function-text {
|
|
|
font-size: 16px;
|
|
|
- color: #B1967B;
|
|
|
+ color: #b1967b;
|
|
|
}
|
|
|
|
|
|
&.disabled {
|
|
|
@@ -394,12 +412,11 @@ onMounted(() => {
|
|
|
margin: 0;
|
|
|
position: relative;
|
|
|
padding-left: 10px;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
.view-more {
|
|
|
font-size: 14px;
|
|
|
- color: #79ACF9;
|
|
|
+ color: #79acf9;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
@@ -424,7 +441,7 @@ onMounted(() => {
|
|
|
top: 0;
|
|
|
width: 100%;
|
|
|
height: 106px;
|
|
|
- background: linear-gradient(90deg, rgba(177, 150, 123, 0) 0%, #B1967B 100%);
|
|
|
+ background: linear-gradient(90deg, rgba(177, 150, 123, 0) 0%, #b1967b 100%);
|
|
|
|
|
|
.news-title {
|
|
|
width: 150px;
|
|
|
@@ -433,7 +450,7 @@ onMounted(() => {
|
|
|
font-weight: 800;
|
|
|
margin: 16px;
|
|
|
float: right;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
display: -webkit-box;
|
|
|
-webkit-line-clamp: 2;
|
|
|
-webkit-box-orient: vertical;
|
|
|
@@ -476,7 +493,7 @@ onMounted(() => {
|
|
|
/* 桌面端显示并美化滚动条 */
|
|
|
@media (min-width: 769px) {
|
|
|
scrollbar-width: thin;
|
|
|
- scrollbar-color: #B1967B #f1f1f1;
|
|
|
+ scrollbar-color: #b1967b #f1f1f1;
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
height: 8px;
|
|
|
@@ -488,7 +505,7 @@ onMounted(() => {
|
|
|
}
|
|
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
- background: #B1967B;
|
|
|
+ background: #b1967b;
|
|
|
border-radius: 4px;
|
|
|
}
|
|
|
|
|
|
@@ -527,7 +544,7 @@ onMounted(() => {
|
|
|
opacity: 0.8;
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
- background: #B1967B;
|
|
|
+ background: #b1967b;
|
|
|
|
|
|
.exhibition-title {
|
|
|
font-size: 16px;
|
|
|
@@ -569,9 +586,9 @@ onMounted(() => {
|
|
|
position: absolute;
|
|
|
bottom: 4px;
|
|
|
right: 8px;
|
|
|
- border: 1px solid #FCE39E;
|
|
|
+ border: 1px solid #fce39e;
|
|
|
border-radius: 50%;
|
|
|
- color: #FCE39E;
|
|
|
+ color: #fce39e;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
|
|
|
@@ -595,4 +612,4 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|