|
@@ -14,12 +14,12 @@
|
|
|
<NuxtLink to="/">首页</NuxtLink>
|
|
|
</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item>
|
|
|
- {{ newsDetail.con_title }}
|
|
|
+ {{ newsDetail.con_title ? newsDetail.con_title : bottomMenu[num]?.name }}
|
|
|
</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<!-- 资讯列表 -->
|
|
|
<div class="newsDetail">
|
|
|
<div class="inner">
|
|
@@ -36,21 +36,14 @@
|
|
|
导航列表
|
|
|
</li>
|
|
|
<li v-for="(item, index) in bottomMenu" :key="index">
|
|
|
- <NuxtLink :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
|
|
|
- v-if="item.id == pageId && item.id != 7" class="active">
|
|
|
+ <NuxtLink v-if="item.type == 0" :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
|
|
|
+ :class="item.id == pageId ? 'active' : ''">
|
|
|
{{ item.name }}
|
|
|
</NuxtLink>
|
|
|
- <NuxtLink :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
|
|
|
- v-else-if="item.id != pageId && item.id != 7">
|
|
|
+ <NuxtLink v-else-if="item.type == 1" :to="`/about/${item.name_pinyin}/list-1.html`"
|
|
|
+ :title="item.name" :class="item.id == pageId ? 'active' : ''">
|
|
|
{{ item.name }}
|
|
|
</NuxtLink>
|
|
|
- <NuxtLink :to="`/about/${item.name_pinyin}/list-1.html`" :title="item.name"
|
|
|
- v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">
|
|
|
- {{item.name }}
|
|
|
- </NuxtLink>
|
|
|
- <NuxtLink :to="`/about/${item.name_pinyin}/list-1.html`" :title="item.name" v-else-if="item.id == 7">
|
|
|
- {{ item.name}}
|
|
|
- </NuxtLink>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -74,10 +67,10 @@ const route = useRoute();
|
|
|
//获得当前的完整路径
|
|
|
const fullPath = route.path;
|
|
|
//拆分,取出来中间这一段,然后提取数字部分
|
|
|
-const segments = fullPath.split('/');
|
|
|
-const targetSegment = segments[2];
|
|
|
+const segments = fullPath.split('/');
|
|
|
+const targetSegment = segments[2];
|
|
|
//const numberPart = targetSegment.match(/\d+$/)?.[0];
|
|
|
-
|
|
|
+let num = ref(0)
|
|
|
let articleId;
|
|
|
let pageId;
|
|
|
//通过导航路径反向查询导航id
|
|
@@ -87,13 +80,13 @@ const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
|
|
|
'foot_pinyin': targetSegment,
|
|
|
},
|
|
|
});
|
|
|
-if(getRouteId.code == 200){
|
|
|
+if (getRouteId.code == 200) {
|
|
|
articleId = getRouteId.data.id;
|
|
|
pageId = getRouteId.data.id;
|
|
|
-}else{
|
|
|
+} else {
|
|
|
console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
console.log("错误位置:通过url路径查询导航池id")
|
|
|
- console.log("后端错误反馈:",getRouteId.message)
|
|
|
+ console.log("后端错误反馈:", getRouteId.message)
|
|
|
console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
}
|
|
|
|
|
@@ -109,11 +102,11 @@ const newsDetail = ref({})
|
|
|
const bottomMenu = ref([]);
|
|
|
|
|
|
async function getPageData() {
|
|
|
- const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
|
|
|
+ const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
|
|
|
method: 'GET',
|
|
|
query: {
|
|
|
'fcat_id': articleId,
|
|
|
- 'type':0
|
|
|
+ 'type': 0
|
|
|
},
|
|
|
});
|
|
|
newsDetail.value = mkdata.data;
|
|
@@ -121,11 +114,19 @@ async function getPageData() {
|
|
|
getPageData();
|
|
|
|
|
|
async function getPageMenu() {
|
|
|
- const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
|
|
|
+ const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
|
|
|
method: 'GET',
|
|
|
query: {},
|
|
|
});
|
|
|
- bottomMenu.value = mkdata.data;
|
|
|
+ if (mkdata.code == 200) {
|
|
|
+ bottomMenu.value = mkdata.data;
|
|
|
+
|
|
|
+ mkdata.data.forEach((item, index) => {
|
|
|
+ if (item.id == articleId) {
|
|
|
+ num.value = index;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
getPageMenu();
|
|
|
//2.页面数据 end ---------------------------------------->
|
|
@@ -133,7 +134,7 @@ getPageMenu();
|
|
|
|
|
|
//4.设置seo信息 start---------------------------------------->
|
|
|
//4.1 设置seo信息
|
|
|
-const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
|
|
|
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
|
|
|
method: 'GET',
|
|
|
query: {},
|
|
|
});
|
|
@@ -147,13 +148,13 @@ let seoName = setData.data.website_head.website_name;
|
|
|
useSeoMeta({
|
|
|
title: seoTitle + "_" + seoSuffix,
|
|
|
meta: [
|
|
|
- { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
|
|
|
- { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix , tagPriority: 10 }
|
|
|
+ { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
|
|
|
+ { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
|
|
|
]
|
|
|
});
|
|
|
//4.设置seo信息 end---------------------------------------->
|
|
|
|
|
|
-onMounted(async () => {
|
|
|
+onMounted(async () => {
|
|
|
//从客户端获取行政职能部门 加快打开速度
|
|
|
const { $webUrl, $CwebUrl } = useNuxtApp();
|
|
|
//广告1
|
|
@@ -167,7 +168,7 @@ onMounted(async () => {
|
|
|
});
|
|
|
const resultAd1 = await responseAd1.json();
|
|
|
adImg1.value = resultAd1.data[0];
|
|
|
-
|
|
|
+
|
|
|
//广告2
|
|
|
let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snscw_page_0002`
|
|
|
const responseAd2 = await fetch(url2, {
|
|
@@ -183,5 +184,5 @@ onMounted(async () => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
- @import '@/assets/css/about.less';
|
|
|
+@import '@/assets/css/about.less';
|
|
|
</style>
|