|
@@ -38,11 +38,7 @@
|
|
|
发布时间: <span>{{ time }}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="leftBottom"
|
|
|
- v-html="newsDetail.content"
|
|
|
- v-if="newsDetail.content"
|
|
|
- @click="openPreview">
|
|
|
+ <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content" @click="openPreview">
|
|
|
</div>
|
|
|
<div v-if="previewVisible" class="preview-modal" @click="closePreview">
|
|
|
<img :src="selectedImage" alt="Preview">
|
|
@@ -68,6 +64,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
|
|
|
<!-- 页面底部 -->
|
|
|
<HomeFoot1></HomeFoot1>
|
|
|
</template>
|
|
@@ -75,7 +72,7 @@
|
|
|
<script setup>
|
|
|
//1.页面依赖 start ---------------------------------------->
|
|
|
import { onMounted } from 'vue'
|
|
|
-import { ElBreadcrumb, ElBreadcrumbItem,ElRadio, ElRadioGroup,ElCheckbox,ElCheckboxGroup,ElMessage,ElInput } from 'element-plus'
|
|
|
+import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
|
|
|
import { ArrowRight } from '@element-plus/icons-vue'
|
|
|
//1.页面依赖 end ---------------------------------------->
|
|
|
|
|
@@ -92,12 +89,12 @@ const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
|
|
|
'pinyin': targetSegment,
|
|
|
},
|
|
|
});
|
|
|
-if(getRouteId.code == 200){
|
|
|
+if (getRouteId.code == 200) {
|
|
|
routeId = getRouteId.data.category_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 ---------->")
|
|
|
}
|
|
|
//2.页面路径 end ---------------------------------------->
|
|
@@ -114,7 +111,7 @@ let getParentNav = async () => {
|
|
|
'catid': routeId
|
|
|
},
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
if (listData.code == 200) {
|
|
|
parent_name.value = listData.data.alias;
|
|
|
parent_id.value = listData.data.parent_id;
|
|
@@ -144,15 +141,15 @@ const routLevelId = ref("");
|
|
|
const articleChoice = ref(false);
|
|
|
//4.5 获取详情
|
|
|
async function getPageData() {
|
|
|
- const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
|
|
|
+ const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
|
|
|
method: 'GET',
|
|
|
query: {
|
|
|
'articleid': articleId
|
|
|
},
|
|
|
});
|
|
|
- if(mkdata.code==200){
|
|
|
+ if (mkdata.code == 200) {
|
|
|
//判断是否显示投票
|
|
|
- if(mkdata.data.is_survey==1){
|
|
|
+ if (mkdata.data.is_survey == 1) {
|
|
|
console.log("本篇文章含有投票!")
|
|
|
articleChoice.value = true;
|
|
|
}
|
|
@@ -169,10 +166,10 @@ async function getPageData() {
|
|
|
} else {
|
|
|
routeNewsTtitle.value = newsDetail.value.title
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
console.log("错误位置:获取详情内容")
|
|
|
- console.log("后端错误反馈:",mkdata.message)
|
|
|
+ console.log("后端错误反馈:", mkdata.message)
|
|
|
console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
}
|
|
|
}
|
|
@@ -182,7 +179,8 @@ getPageData();
|
|
|
|
|
|
//5.广告 start ---------------------------------------->
|
|
|
let adImg1 = ref([]);
|
|
|
-onMounted(async () => {
|
|
|
+let adImg2 = ref([]);
|
|
|
+onMounted(async () => {
|
|
|
const { $webUrl, $CwebUrl } = useNuxtApp();
|
|
|
//广告1
|
|
|
let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0001`
|
|
@@ -195,17 +193,29 @@ onMounted(async () => {
|
|
|
});
|
|
|
const resultAd1 = await responseAd1.json();
|
|
|
adImg1.value = resultAd1.data[0];
|
|
|
+
|
|
|
+ //广告2
|
|
|
+ let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0002`
|
|
|
+ const responseAd2 = await fetch(url2, {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
+ 'Userurl': $CwebUrl,
|
|
|
+ 'Origin': $CwebUrl
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const resultAd2 = await responseAd2.json();
|
|
|
+ adImg2.value = resultAd2.data[0];
|
|
|
})
|
|
|
//5.广告 end ---------------------------------------->
|
|
|
|
|
|
//6.设置seo信息 start---------------------------------------->
|
|
|
-const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
|
|
|
+const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
|
|
|
method: 'GET',
|
|
|
query: {
|
|
|
'articleid': articleId
|
|
|
},
|
|
|
});
|
|
|
-if(setData.code==200){
|
|
|
+if (setData.code == 200) {
|
|
|
let seoTitle = setData.data.title;
|
|
|
let seoDescription = setData.data.introduce;
|
|
|
let seoKeywords = setData.data.keyword;
|
|
@@ -215,12 +225,12 @@ if(setData.code==200){
|
|
|
useSeoMeta({
|
|
|
title: seoTitle + "_" + seoName + "_" + 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 }
|
|
|
]
|
|
|
});
|
|
|
-}else{
|
|
|
- console.log("获取广告数据失败!",setData.message)
|
|
|
+} else {
|
|
|
+ console.log("获取广告数据失败!", setData.message)
|
|
|
}
|
|
|
//6.设置seo信息 end---------------------------------------->
|
|
|
|