优化
This commit is contained in:
+1
-13
@@ -33,16 +33,6 @@ const pcRoutes = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// ============================================ 服务与支撑 ============================================
|
|
||||||
{
|
|
||||||
path: '/services',
|
|
||||||
name: 'Services',
|
|
||||||
component: () => import('@/views/pc/services/index.vue'),
|
|
||||||
meta: {
|
|
||||||
title: '服务与支撑',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// ============================================ 新闻中心 ============================================
|
// ============================================ 新闻中心 ============================================
|
||||||
{
|
{
|
||||||
path: '/news',
|
path: '/news',
|
||||||
@@ -126,9 +116,7 @@ const pcToMobileMap = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 移动端 → PC 路由映射(反向)
|
// 移动端 → PC 路由映射(反向)
|
||||||
const mobileToPcMap = Object.fromEntries(
|
const mobileToPcMap = Object.fromEntries(Object.entries(pcToMobileMap).map(([k, v]) => [v, k]))
|
||||||
Object.entries(pcToMobileMap).map(([k, v]) => [v, k])
|
|
||||||
)
|
|
||||||
|
|
||||||
// 判断是否为移动端
|
// 判断是否为移动端
|
||||||
function checkIsMobile() {
|
function checkIsMobile() {
|
||||||
|
|||||||
@@ -26,14 +26,6 @@ const mobileRoutes = [
|
|||||||
meta: {title: '产品详情'},
|
meta: {title: '产品详情'},
|
||||||
},
|
},
|
||||||
|
|
||||||
// ============================================ 服务与支撑 ============================================
|
|
||||||
{
|
|
||||||
path: '/m/services',
|
|
||||||
name: 'MobileServices',
|
|
||||||
component: () => import('@/views/mobile/services/index.vue'),
|
|
||||||
meta: {title: '服务与支撑'},
|
|
||||||
},
|
|
||||||
|
|
||||||
// ============================================ 新闻中心 ============================================
|
// ============================================ 新闻中心 ============================================
|
||||||
{
|
{
|
||||||
path: '/m/news',
|
path: '/m/news',
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {onMounted, ref} from 'vue'
|
|||||||
import {useRoute, useRouter} from 'vue-router'
|
import {useRoute, useRouter} from 'vue-router'
|
||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import {getNewsDetail} from '@/api/index'
|
import {getNewsDetail} from '@/api/index'
|
||||||
|
// import {list as mockList, newsDetail as mockDetail} from './mock.js'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const detail = route.query
|
const detail = route.query
|
||||||
@@ -35,6 +36,20 @@ const getDetail = () => {
|
|||||||
.catch(() => { showLoad.value = false })
|
.catch(() => { showLoad.value = false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// onMounted(() => {
|
||||||
|
// const newsItem = mockList.find((item) => item.id == detail.id)
|
||||||
|
// const detailItem = mockDetail.find((item) => item.id == detail.id)
|
||||||
|
// if (newsItem) {
|
||||||
|
// newsTitle.value = newsItem.title
|
||||||
|
// newsTime.value = newsItem.datetime
|
||||||
|
// newsSubTitle.value = newsItem.snapshot
|
||||||
|
// }
|
||||||
|
// if (detailItem) {
|
||||||
|
// newsContent.value = detailItem.article
|
||||||
|
// }
|
||||||
|
// showLoad.value = false
|
||||||
|
// })
|
||||||
|
|
||||||
const toBack = () => {
|
const toBack = () => {
|
||||||
router.push('/m/news')
|
router.push('/m/news')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {ref, onMounted, nextTick, onActivated, onDeactivated} from 'vue'
|
|||||||
import Banner from '@/components/Banner/index.vue'
|
import Banner from '@/components/Banner/index.vue'
|
||||||
import {useRouter} from 'vue-router'
|
import {useRouter} from 'vue-router'
|
||||||
import {getNews} from '@/api/index'
|
import {getNews} from '@/api/index'
|
||||||
|
// import {list as mockList} from './mock.js'
|
||||||
|
|
||||||
const showLoad = ref(true)
|
const showLoad = ref(true)
|
||||||
const newList = ref([])
|
const newList = ref([])
|
||||||
@@ -20,15 +21,24 @@ async function getNewList() {
|
|||||||
.finally(() => { showLoad.value = false })
|
.finally(() => { showLoad.value = false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// onMounted(() => {
|
||||||
|
// newList.value = mockList
|
||||||
|
// showLoad.value = false
|
||||||
|
// })
|
||||||
|
|
||||||
const toDetail = (item) => {
|
const toDetail = (item) => {
|
||||||
router.push({path: '/m/news/detail', query: {id: item.id, slug: item.slug}})
|
router.push({path: '/m/news/detail', query: {id: item.id, slug: item.slug}})
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivated(async () => {
|
onActivated(async () => {
|
||||||
await nextTick()
|
await nextTick()
|
||||||
requestAnimationFrame(() => { window.scrollTo({top: scrollTop, behavior: 'instant'}) })
|
requestAnimationFrame(() => {
|
||||||
|
window.scrollTo({top: scrollTop, behavior: 'instant'})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
onDeactivated(() => {
|
||||||
|
scrollTop = document.documentElement.scrollTop || document.body.scrollTop
|
||||||
})
|
})
|
||||||
onDeactivated(() => { scrollTop = document.documentElement.scrollTop || document.body.scrollTop })
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -46,7 +56,8 @@ onDeactivated(() => { scrollTop = document.documentElement.scrollTop || document
|
|||||||
<div class="news-body">
|
<div class="news-body">
|
||||||
<div class="news-title">{{ item.title }}</div>
|
<div class="news-title">{{ item.title }}</div>
|
||||||
<div class="news-time">{{ item?.time }}</div>
|
<div class="news-time">{{ item?.time }}</div>
|
||||||
<div class="news-desc">{{ item.snapshot }}</div>
|
<div class="sub-label">{{ item?.subLabel }}</div>
|
||||||
|
<div class="text">{{ item.snapshot }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -57,10 +68,13 @@ onDeactivated(() => { scrollTop = document.documentElement.scrollTop || document
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page { width: 100%; }
|
.page {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.section {
|
.section {
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
|
margin-bottom: 20px;
|
||||||
.section-title {
|
.section-title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -91,17 +105,47 @@ onDeactivated(() => { scrollTop = document.documentElement.scrollTop || document
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: #eee;
|
background: #eee;
|
||||||
img { width: 100%; height: 100%; object-fit: cover; }
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-body {
|
.news-body {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.news-title { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
.news-title {
|
||||||
.news-time { font-size: 11px; color: #999; margin-bottom: 4px; }
|
font-size: 14px;
|
||||||
.news-desc { font-size: 12px; color: #666; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.news-time {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #999;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.sub-label,
|
||||||
|
.text {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-content { text-align: center; color: #999; font-size: 16px; padding: 40px 0; }
|
.no-content {
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 40px 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -14,6 +14,17 @@ const hardwareSystemList = window.hardwareSystemList
|
|||||||
const title = computed(() => findLabelByUrl(window.nav.header, navStore.navIndex))
|
const title = computed(() => findLabelByUrl(window.nav.header, navStore.navIndex))
|
||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
|
|
||||||
|
const projectList = [
|
||||||
|
{label: '智慧物流配送', img: 'product/1.png'},
|
||||||
|
{label: '要地防控', img: 'product/2.png'},
|
||||||
|
{label: '关键基础设施守护', img: 'product/3.png'},
|
||||||
|
{label: '规模化无人机巡检', img: 'product/4.png'},
|
||||||
|
{label: '城市低空交通管理', img: 'product/5.png'},
|
||||||
|
{label: '大型活动保障', img: 'product/7.png'},
|
||||||
|
{label: '区域低空监管组网', img: 'product/6.png'},
|
||||||
|
{label: '移动式低空安防', img: 'product/8.png'},
|
||||||
|
]
|
||||||
|
|
||||||
function titleClick(item) {
|
function titleClick(item) {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/m/product/detail',
|
path: '/m/product/detail',
|
||||||
@@ -50,6 +61,17 @@ function titleClick(item) {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Swiper>
|
</Swiper>
|
||||||
|
|
||||||
|
<!-- 应用案例 -->
|
||||||
|
<div class="section">
|
||||||
|
<h2 class="section-title">应用案例</h2>
|
||||||
|
<div class="project-grid">
|
||||||
|
<div v-for="item in projectList" :key="item.img" class="project-item">
|
||||||
|
<img :src="`./static/images/${item.img}`" />
|
||||||
|
<div class="project-label">{{ item.label }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -58,6 +80,38 @@ function titleClick(item) {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
padding: 0 12px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.section-title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
margin: 20px 0 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-item {
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.project-label {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #333;
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.card-item {
|
.card-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import PcIndex from '@/views/pc/services/index.vue'
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<PcIndex />
|
|
||||||
</template>
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import {ref, onMounted} from 'vue'
|
|
||||||
import Swiper from '@/components/swiper/index.vue'
|
|
||||||
import Banner from '@/components/Banner/index.vue'
|
|
||||||
|
|
||||||
const currentPage = ref(1)
|
|
||||||
|
|
||||||
onMounted(() => {})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="page">
|
|
||||||
<Banner class="banner" img="banner/services.png" />
|
|
||||||
<Swiper
|
|
||||||
id="one"
|
|
||||||
title="智能加载服务"
|
|
||||||
v-model="currentPage"
|
|
||||||
:data="[1, 2, 3, 4]"
|
|
||||||
:page-size="2"
|
|
||||||
:show-pagination="false"
|
|
||||||
:auto-play="false"
|
|
||||||
>
|
|
||||||
<template #default="{item, index, isActive}">
|
|
||||||
<div class="my-card" :class="{active: isActive}">
|
|
||||||
<h2>{{ item }}</h2>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</Swiper>
|
|
||||||
<Swiper
|
|
||||||
id="two"
|
|
||||||
title="智能加载服务"
|
|
||||||
v-model="currentPage"
|
|
||||||
:data="[1, 2, 3, 4]"
|
|
||||||
:page-size="2"
|
|
||||||
:show-pagination="false"
|
|
||||||
:auto-play="false"
|
|
||||||
>
|
|
||||||
<template #default="{item, index, isActive}">
|
|
||||||
<div class="my-card" :class="{active: isActive}">
|
|
||||||
<h2>{{ item }}</h2>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</Swiper>
|
|
||||||
<Swiper
|
|
||||||
id="three"
|
|
||||||
title="智能加载服务"
|
|
||||||
v-model="currentPage"
|
|
||||||
:data="[1, 2, 3, 4]"
|
|
||||||
:page-size="2"
|
|
||||||
:show-pagination="false"
|
|
||||||
:auto-play="false"
|
|
||||||
>
|
|
||||||
<template #default="{item, index, isActive}">
|
|
||||||
<div class="my-card" :class="{active: isActive}">
|
|
||||||
<h2>{{ item }}</h2>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</Swiper>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.my-card {
|
|
||||||
background: #d9d9d9;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user