Przeglądaj źródła

将路径修改为伪静态

Jing 3 miesięcy temu
rodzic
commit
c7ca280f65

+ 2 - 115
app.vue

@@ -2,125 +2,12 @@
   <div class="sannong">
     <NuxtLayout>
       <NuxtPage></NuxtPage>
-      <!-- <ul class="kefu">
-        <li>
-          <el-popover ref="popover" placement="right" :width="80" trigger="hover">
-            <template #reference>
-              <img src="./static/image/qq 1.png" alt="">
-            </template>
-            <p>联系QQ:</p>
-            <p>2909421493</p>
-            <p>213552413</p>
-          </el-popover>
-          <h6>QQ客服</h6>
-        </li>
-        <li>
-          <el-popover ref="popover" placement="right" :width="80" trigger="hover">
-            <template #reference>
-              <img src="./static/image/dianhua 1.png" alt="">
-            </template>
-            <p>联系电话:</p>
-            <p>010-56019387</p>
-          </el-popover>
-          <h6>电话客服</h6>
-        </li>
-      </ul> -->
-      <!-- <ul class="kefu">
-        <li>
-          <img src="./static//image/weixin 1.png" alt="">
-          <p>微信客服</p>
-        </li>
-        <li>
-          <img src="./static//image/qq 1.png" alt="">
-          <p>QQ客服</p>
-        </li>
-        <li>
-          <img src="./static//image/dianhua 1.png" alt="">
-          <p>电话客服</p>
-        </li>
-        <li @click="close">
-          <img src="./static//image/guanbi 1.png" alt="">
-          <p>关闭</p>
-        </li>
-      </ul> -->
-      <!-- <div class="kefu1">
-        <img src="./static//image/weixin 1.png" alt="">
-      </div> -->
     </NuxtLayout>
-    <!-- <div class="zhinengwenda">
-      <Zhinengqwnda></Zhinengqwnda>
-    </div> -->
-
   </div>
 </template>
 
 <script setup>
-import { ElPopover } from 'element-plus'
-let close = () => {
-  let kefu = document.querySelector('.kefu')
-  kefu.style.display = 'none'
-}
-</script>
-
-<style lang="less" scoped>
-.kefu {
-  width: 100px;
-  // height: 445px;
-  height: 200px;
-  position: fixed;
-  // bottom: 80px;
-  // right: 129px;
-  bottom: 50px;
-  right: 10px;
-
-  >li {
-    width: 100px;
-    height: 100px;
-    margin-bottom: 15px;
-    text-align: center;
-    background-color: #fff;
-    box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.1);
-    border-radius: 10px;
 
-    img {
-      width: 60px;
-      height: 60px;
-      margin-top: 10px;
-    }
-
-    h6 {
-      font-family: PingFang SC, PingFang SC;
-      font-weight: 500;
-      font-size: 14px;
-      color: #666666;
-      line-height: 16px;
-    }
-
-    p {
-      font-weight: 400;
-      font-size: 12px;
-    }
-  }
-}
-
-.kefu1 {
-  width: 70px;
-  height: 70px;
-  position: fixed;
-  bottom: 0px;
-  right: 220px;
-}
+</script>
 
-.zhinengwenda {
-  width: 360px;
-  height: 562px;
-  position: fixed;
-  bottom: 85px;
-  right: 220px;
-  // border: 1px solid #CCCCCC;
-  box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.1);
-  border-radius: 10px;
-  background-color: #fff;
-  z-index: 1000;
-}
-</style>
+<style></style>

+ 215 - 0
assets/css/detail.less

@@ -0,0 +1,215 @@
+//导航条
+.breadcrumb {
+    width: 100%;
+    height: 22px;
+    margin-bottom: 30px;
+    margin-top: 40px;
+    font-family: Microsoft YaHei, Microsoft YaHei;
+    font-weight: 400;
+    font-size: 20px;
+    color: #666666;
+    line-height: 23px;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+
+    .el-breadcrumb::v-deep {
+        display: inline-block;
+        vertical-align: -4px;
+    }
+
+    /deep/.el-breadcrumb__inner a,
+    /deep/.el-breadcrumb__inner.is-link {
+        color: #666666;
+        font-weight: 400;
+        text-decoration: none;
+        transition: var(--el-transition-color);
+    }
+
+    span {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+
+    span:hover {
+        color: #666666;
+    }
+
+    .location {
+        margin-right: 20px;
+        width: 100px;
+        height: 22px;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+}
+
+// 资讯列表
+.newsDetail {
+    width: 100%;
+    margin-bottom: 0px;
+
+    .inner {
+        width: 1200px;
+        overflow: hidden;
+        font-size: 16px;
+
+        .innerLeft {
+            width: 810px;
+            border-top: 1px solid #ccc;
+            margin-right: 40px;
+
+            .LeftTop {
+                margin-top: 50px;
+
+                >h1 {
+
+                    line-height: 40px;
+                    margin-bottom: 30px;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-weight: bold;
+                    font-size: 30px;
+                    color: #333333;
+                }
+
+                >p {
+                    height: 18px;
+                    line-height: 18px;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-weight: 400;
+                    font-size: 14px;
+                    color: #999999;
+
+                    span {
+                        margin-right: 40px;
+                    }
+                }
+
+                >img {
+                    width: 680px;
+                    height: 382px;
+                    padding: 50px 0px 60px 55px;
+                }
+            }
+
+            .leftBottom {
+                width: 790px;
+                font-size: 20px;
+                line-height: 38px;
+                margin-top: 30px;
+                margin-bottom: 30px;
+
+                ul>li img {
+                    width: 790px;
+                    height: 382px;
+                }
+
+                img {
+                    width: 790px;
+                    height: 382px;
+                }
+
+                p.tinymce-material {
+                    img {
+                        width: 790px;
+                    }
+                }
+
+                >h3,
+                >p {
+                    text-indent: 2em;
+                    width: 790px;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-size: 20px;
+                    color: #333333;
+                    line-height: 38px;
+                    padding-bottom: 30px;
+
+                    img {
+                        width: 790px;
+                    }
+                }
+
+                >h3 {
+                    font-weight: 600px;
+                }
+
+                >p {
+                    font-weight: 400;
+                }
+
+            }
+
+            .disclaimer {
+                width: 790px;
+                overflow: hidden;
+                border-top: 1px solid #e6e6e6;
+                padding: 30px 0px;
+                color: #999999;
+                font-size: 17px;
+
+                p {
+                    width: 790px;
+                    line-height: 30px;
+                }
+            }
+        }
+
+        .innerRight {
+            width: 350px;
+            height: 1248px;
+            border-top: 1px solid #ccc;
+            border-bottom: 1px solid #ccc;
+
+        }
+    }
+}
+
+.leftBottom::v-deep p img,
+.leftBottom::v-deep img,
+.leftBottom::v-deep video {
+    max-width: 700px;
+}
+
+.leftBottom::v-deep h1,
+.leftBottom::v-deep h2,
+.leftBottom::v-deep h3,
+.leftBottom::v-deep h4,
+.leftBottom::v-deep h5,
+.leftBottom::v-deep h6 {
+    font-size: 20px;
+    font-weight: 500;
+}
+
+//放大图片
+.preview-modal {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, 0.8);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    z-index: 1000;
+}
+
+.preview-modal img {
+    max-width: 100%;
+    max-height: 100%;
+    cursor: pointer;
+    /* 关闭按钮样式 */
+}

+ 2 - 2
assets/css/foot.less

@@ -115,7 +115,7 @@
     display: flex;
     width: 100%;
     // border-bottom: solid 2px #49A769;
-    padding-bottom: 35px;
+    padding-bottom: 20px;
 }
 
 .foot_frind_box span {
@@ -164,7 +164,7 @@
     box-sizing: border-box;
     padding: 0 19px;
     font-weight: bold;
-    border-left: solid 1px #5B8D54;
+    border-left: solid 2px #7e1c11;
     margin: 18px 0;
 }
 

+ 1 - 0
assets/css/index.less

@@ -1610,6 +1610,7 @@
                         .content_top_left {
                             float: left;
                             width: 350px;
+                            height: 484px;
 
                             .part5_photo_text {
                                 width: 350px;

+ 2 - 2
components/detail/HotNews.vue

@@ -10,7 +10,7 @@
                 <span class="jingxuan">精选</span>
                 <div class="hotlist_text">{{ item.title }}</div>
             </NuxtLink>
-            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+            <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">
                 <img :src="item.imgurl" alt="">
                 <span class="jingxuan">精选</span>
                 <div class="hotlist_text">{{ item.title }}</div>
@@ -19,7 +19,7 @@
         <ul class="message">
             <li class="messageList" v-for="(item, index) in hotNewsList" :key="index">
                 <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">{{ item.title }}</NuxtLink>
-                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">
                     {{ item.title }}
                 </NuxtLink>
             </li>

+ 10 - 3
components/detail/HotNews2.vue

@@ -6,7 +6,11 @@
         </div>
         <div class="hotNews_photo_text">
             <div class="photo_left" v-for="(item, index) in hotNewsListImg">
-                <NuxtLink :to="`/newsDetail/${item.id}`">
+                <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">
+                    <img :src="item.imgurl" alt="">
+                    <div class="hotNews_text">{{ item.title }}</div>
+                </NuxtLink>
+                <NuxtLink :to="`/${item.pinyin}/${item.id}.html`">
                     <img :src="item.imgurl" alt="">
                     <div class="hotNews_text">{{ item.title }}</div>
                 </NuxtLink>
@@ -14,8 +18,11 @@
         </div>
         <ul class="hotNews_message">
             <li class="hotNews_messageList" v-for="(item, index) in hotNewsList" :key="index">
-                <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">{{ item.title }}</NuxtLink>
-                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">{{ item.title }}
+                <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">
+                    {{ item.title }}
+                </NuxtLink>
+                <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">
+                    {{ item.title }}
                 </NuxtLink>
             </li>
         </ul>

+ 4 - 4
components/home/Advertising.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="adversing" v-if="imgurl">
         <div class="inner">
-            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank" :title="imgurl.place_name">
-                <img :src="imgurl.thumb" :title="imgurl.place_name">
+            <a href="http://nzgxw.org.cn/" v-if="imgurl.image_url==null" target="_blank" :title="imgurl.introduce">
+                <img :src="imgurl.thumb" :alt="imgurl.introduce" :id="imgurl.ad_tag"  data-tag="imgurl.ad_tag">
             </a>
-            <a :href="imgurl.image_url" v-else>
-                <img :src="imgurl.image_src" :title="imgurl.ad_name">
+            <a :href="imgurl.image_url" v-else :title="imgurl.introduce">
+                <img :src="imgurl.image_src" :alt="imgurl.introduce" :id="imgurl.ad_tag" data-tag="imgurl.ad_tag">
             </a>
         </div>
     </div>

+ 3 - 37
components/home/foot.vue

@@ -16,10 +16,10 @@
 
     <div class="call_us_box">
         <span v-for="(item, index) in bottomMenu" :key="index">
-            <NuxtLink :to="{ path: `/specialList/${item.id}` }" v-if="item.type == 1" :title="item.name">
+            <!-- <NuxtLink :to="{ path: `/specialList/${item.id}` }" v-if="item.type == 1" :title="item.name">
                 {{ item.name }}
-            </NuxtLink>
-            <NuxtLink :to="{ path: `/speciaArticle/${item.id}` }" v-if="item.type == 0" :title="item.name">
+            </NuxtLink> -->
+            <NuxtLink :to="{ path: `/about/${item.name_pinyin}/index.html` }" v-if="item.type == 0" :title="item.name">
                 {{ item.name }}
             </NuxtLink>
         </span>
@@ -56,40 +56,6 @@
                 <img :src="item.logo_url" :alt="item.title">
             </a>
         </div>
-
-        <!--在线客服-->
-        <!-- <div class="kefu">
-            <div class="kefu_itemKf">
-                <a :href="bottomBase.online_service" target="_blank">
-                    <img src="https://img.bjzxtw.org.cn/pre/public/image/online1.png">
-                    <p>在线客服</p>
-                </a>
-            </div>
-            <div class="kefu_itemQQ">
-                <img src="https://img.bjzxtw.org.cn/pre/public/image/qq1.png">
-                <p>QQ客服</p>
-                <div class="kefu_item_content_QQ">
-                    <div @click="addQQFriend(qq1)" class="qqadd">
-                        <img src="https://img.bjzxtw.org.cn/pre/public/index/tubiao1.png" width="100">
-                        <div class="qqfs">{{ bottomBase.customer_service_qq }}</div>
-                    </div>
-                    <div @click="addQQFriend(qq2)" class="qqadd">
-                        <img src="https://img.bjzxtw.org.cn/pre/public/index/tubiao2.png" width="100">
-                        <div class="qqfs">{{ bottomBase.communications }}</div>
-                    </div>
-                    <div class="arrow"></div>
-                </div>
-            </div>
-            <div class="kefu_itemPhone">
-                <img src="https://img.bjzxtw.org.cn/pre/public/image/dianhua1.png">
-                <p>电话客服</p>
-                <div class="kefu_item_content_phone">
-                    <div class="kefu_item_content_phone_title">联系电话:</div>
-                    <div>{{ bottomBase.customer_service }}</div>
-                    <div class="arrow"></div>
-                </div>
-            </div>
-        </div> -->
     </footer>
 </template>
 

+ 1 - 16
components/home/foot1.vue

@@ -1,25 +1,10 @@
 <template>
-    <!-- <footer class="index_foot">
-        <div class="foot_img_box">
-            <a :href="item.url" v-for="(item, index) in bottomLink" :title="item.title" target="_blank">
-                <img :src="item.logo_url" :alt="item.title">
-            </a>
-        </div>
-        <div class="foot_frind_box">
-            <span>友情链接</span>
-            <div>
-                <a :href="item.url" v-for="(item, index) in bottomText" :key="index" :title="item.title"
-                    target="_blank">{{ item.title }}</a>
-            </div>
-        </div>
-    </footer> -->
-
     <div class="call_us_box">
         <span v-for="(item, index) in bottomMenu" :key="index">
             <NuxtLink :to="{ path: `/specialList/${item.id}` }" v-if="item.type == 1" :title="item.name">
                 {{ item.name }}
             </NuxtLink>
-            <NuxtLink :to="{ path: `/speciaArticle/${item.id}` }" v-if="item.type == 0" :title="item.name">
+            <NuxtLink :to="{ path: `/about/${item.name_pinyin}/index.html` }" v-if="item.type == 0" :title="item.name">
                 {{ item.name }}
             </NuxtLink>
         </span>

+ 7 - 7
components/home/pageHead.vue

@@ -337,7 +337,7 @@ getAdData();
 /* 页面头部 */
 header {
     width: 100%;
-    height: 201px;
+    height: 180px;
     font-size: 12px;
     font-family: PingFang SC-Regular;
     color: #666666;
@@ -430,12 +430,12 @@ header {
 
 /* // 头部logo */
 .headerLogo {
-    height: 185px;
+    height: 145px;
     position: relative;
     //background: url("../../public/head/topBg.png") no-repeat center;
     .titlead {
         position: absolute;
-        bottom: 33px;
+        bottom: 14px;
         right: 26px;
         width: 830px;
         height: 110px;
@@ -448,17 +448,17 @@ header {
         }
         img {
             width: 100%;
-            height:120px;
+            height:110px;
         }
     }
     .inner {
         position: relative;
-        height: 185px;
+        height: 145px;
     }
     .inner>img {
         width: 297px;
-        height: 114px;
-        margin-top: 33px;
+        height: 110px;
+        margin-top: 20px;
         cursor: pointer;
     }
 

+ 15 - 18
components/home/pageNavigation.vue

@@ -17,14 +17,14 @@
                 </div>
                 <ul class="navigationOne" v-if="navigation1.length > 0">
                     <li v-for="(item, index) in navigation1" :key="index">
-                        <NuxtLink :to="getLinkPath(item)">
+                        <NuxtLink :to="getLinkPath(item)" :target="item.is_url == 1 ? '_blank' : '_self'">
                             <span>{{ item.alias }}</span>
                         </NuxtLink>
                     </li>
                 </ul>
                 <div class="navRight" v-if="navigation2.length > 0">
-                    <div class="nav111" v-for="(item, index) in navigation2">
-                        <NuxtLink :to="getLinkPath(item)">
+                    <div class="nav111" v-for="(item, index) in navigation2" :key="index">
+                        <NuxtLink :to="getLinkPath(item)" :target="item.is_url == 1 ? '_blank' : '_self'">
                             <span>{{ item.alias }}</span>
                         </NuxtLink>
                     </div>
@@ -37,8 +37,8 @@
                     深度服务
                 </h3>
                 <ul class="partTwoTitle" v-if="navigation3.length > 0">
-                    <li class="titleList" v-for="(item, index) in navigation3">
-                        <NuxtLink :to="getLinkPath(item)">
+                    <li class="titleList" v-for="(item, index) in navigation3" :key="index">
+                        <NuxtLink :to="getLinkPath(item)" :target="item.is_url == 1 ? '_blank' : '_self'">
                             <span>{{ item.alias }}</span>
                         </NuxtLink>
                     </li>
@@ -53,15 +53,15 @@
             <div class="inner">
                 <img src="../../public/index/hdpt.png" alt="">
                 <ul class="leftPart" v-if="navigation4.length > 0">
-                    <li class="navList" v-for="item in navigation4">
-                        <NuxtLink :to="getLinkPath(item)">
+                    <li class="navList" v-for="item in navigation4" :key="index">
+                        <NuxtLink :to="getLinkPath(item)" :target="item.is_url == 1 ? '_blank' : '_self'">
                             <span>{{ item.alias }}</span>
                         </NuxtLink>
                     </li>
                 </ul>
                 <ul class="rightPart" v-if="navigation4data2.length > 0">
-                    <li class="navList" v-for="item in navigation4data2">
-                        <NuxtLink :to="getLinkPath(item)">
+                    <li class="navList" v-for="item in navigation4data2" :key="index">
+                        <NuxtLink :to="getLinkPath(item)" :target="item.is_url == 1 ? '_blank' : '_self'">
                             <span>{{ item.alias }}</span>
                         </NuxtLink>
                     </li>
@@ -79,16 +79,13 @@
 //2.页面公用方法 start ---------------------------------------->
 const getLinkPath = (item) => {
     if (item.is_url == 1) {
-        return {
-            url: item.web_url,
-            target: '_blank'
-        }
+        return `${item.web_url}`;
+    } else if (item.children_count == 0) {
+        //return `/newsList/${item.category_id}?page=1`;
+        return `/${item.aLIas_pinyin}/list-1.html`;
     } else {
-        if (item.children_count != 0) {
-            return { path: `/primaryNavigation/${item.category_id}` }
-        } else {
-            return { path: `/newsList/${item.category_id}` }
-        }
+        //return `/primaryNavigation/${item.aLIas_pinyin}/`;
+        return `/${item.aLIas_pinyin}/index.html`;
     }
 }
 //搜索跳转

+ 626 - 0
pages/[dir]/[dir]/[id].vue

@@ -0,0 +1,626 @@
+<template>
+    <!-- 页面头部 -->
+    <HomePageHead></HomePageHead>
+    <!-- 页面导航 -->
+    <HomePageNavigation></HomePageNavigation>
+    <!-- 广告1 -->
+    <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+
+    <!-- 面包屑导航 -->
+    <div class="breadcrumb">
+        <div class="inner">
+            <span class="location">当前位置:</span>
+            <el-breadcrumb :separator-icon="ArrowRight">
+                <el-breadcrumb-item>
+                    <NuxtLink to="/">首页</NuxtLink>
+                </el-breadcrumb-item>
+                <el-breadcrumb-item>
+                    <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
+                </el-breadcrumb-item>
+                <el-breadcrumb-item>
+                    <NuxtLink :to="`list-1.html`">{{ routLevelTitle }}</NuxtLink>
+                </el-breadcrumb-item>
+                <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
+            </el-breadcrumb>
+        </div>
+    </div>
+
+    <!-- 资讯列表 -->
+    <div class="newsDetail">
+        <div class="inner">
+            <div class="innerLeft">
+                <div class="LeftTop">
+                    <h1>{{ newsDetail.title }}</h1>
+                    <p>
+                        来源: <span>{{ newsDetail.copyfrom }}</span>
+                        作者: <span>{{ newsDetail.author }}</span>
+                        发布时间: <span>{{ time }}</span>
+                    </p>
+                </div>
+                <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">
+                </div>
+
+                <!-- 免责声明: -->
+                <div class="disclaimer" v-if="newsDetail.fromurl">
+                    <p>原文链接:{{ newsDetail.fromurl }}</p>
+                    <p>[免责声明]本文来源于网络转载,仅供学习交流使用,不构成商业目的。 版权归原作者所有,如涉及作品内容,版权和其他问题,请在30日与本网联系,我们将第一时间处理。</p>
+                </div>
+                <div v-if="articleChoice">
+                    <!-- 投票 start ---------------------------------------->
+                    <div class="index_3_box_vote" v-if="articleChoice">
+                        <div class="voteTitle">投票区</div>
+                        <div class="inquire">
+                            <p v-if="voteList.length > 0">{{ voteList[0].survey_name }}</p>
+                            <div class="radioBox">
+                                <!--投票选项-->
+                                <div v-if="!isDisabled">
+                                    <div class="radio" v-if="isRadio">
+                                        <el-radio-group v-model="radio1" @change="handleRadioChange">
+                                            <el-radio v-for="item in voteList" :key="item.id" :value="item.id"
+                                                size="large">
+                                                <span v-if="item.is_other == 0">{{ item.choice_name }}</span>
+                                                <span v-else>其他</span>
+                                            </el-radio>
+                                        </el-radio-group>
+                                        <el-input v-if="showUserChoice" v-model="userChoice" :rows="2" type="textarea"
+                                            resize="none" placeholder="请输入.." />
+                                    </div>
+                                    <div class="checkInputBox" v-else>
+                                        <el-checkbox-group v-model="check1" @change="handleCheckboxChange">
+                                            <span v-for="item in voteList" :key="item.id">
+                                                <span v-if="item.is_other == 0">
+                                                    <el-checkbox size="large" :label="item.choice_name"
+                                                        :value="item.id" />
+                                                </span>
+                                                <span v-else>
+                                                    <el-checkbox size="large" label="其他" :value="item.id" />
+                                                </span>
+                                            </span>
+                                        </el-checkbox-group>
+                                        <el-input v-if="showUserChoice" v-model="userChoice" :rows="2" type="textarea"
+                                            resize="none" placeholder="请输入.." />
+                                    </div>
+                                </div>
+                                <!--投票结果-->
+                                <div class="inquireData" v-else>
+                                    <div v-for="item in websiteSurveyData.data" :key="item.id">
+                                        <div class="inquireDataItem active" v-if="item.status == 1">
+                                            <div class="inquireDataItemTitle">
+                                                <span v-if="item.choice_name == ''">其他</span>
+                                                <span v-else>{{ item.choice_name }}</span>
+                                            </div>
+                                            <div class="inquireDataItemNum">{{ item.results }}票</div>
+                                        </div>
+                                        <div class="inquireDataItem" v-else>
+                                            <div class="inquireDataItemTitle">
+                                                <span v-if="item.choice_name == ''">其他</span>
+                                                <span v-else>{{ item.choice_name }}</span>
+                                            </div>
+                                            <div class="inquireDataItemNum">{{ item.results }}票</div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="btn">
+                                <button class="voting" @click="addWebsiteSurvey" :disabled="isDisabled"
+                                    v-if="!isDisabled">投票</button>
+                            </div>
+                        </div>
+                    </div>
+                    <!-- 投票 end ---------------------------------------->
+                </div>
+            </div>
+            <div class="innerRight">
+                <!-- 热点资讯1 -->
+                <div class="hotList1">
+                    <DetailHotNews></DetailHotNews>
+                </div>
+                <!-- 热点资讯2 -->
+                <div class="hotList2">
+                    <DetailHotNews2></DetailHotNews2>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <!-- 页面底部 -->
+    <HomeFoot1></HomeFoot1>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { onMounted } from 'vue'
+import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+
+
+//1.1 获得跳转过来的id
+const route = useRoute();
+const articleId = parseInt(route.params.id);  //获得该页面的id
+
+//1.2 获得父级栏目的名称、id
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/');
+const targetSegment = segments[1];
+// const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+// const routeId = numberPart;
+
+
+let routeId;
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+if (getRouteId.code == 200) {
+    routeId = getRouteId.data.category_id
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:", getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+
+//面包屑导航
+const parent_name = ref("");
+const parent_id = ref("");
+const parent_pinyin = ref("");
+let getParentNav = async () => {
+    const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'catid': routeId
+        },
+    });
+
+    if (listData.code == 200) {
+        parent_name.value = listData.data.alias;
+        parent_id.value = listData.data.parent_id;
+        parent_pinyin.value = listData.data.aLIas_pinyin;
+
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取面包屑导航")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//获得父级栏目详情
+getParentNav();
+//1.页面依赖 end ---------------------------------------->
+
+//2.页面数据 start ---------------------------------------->
+//2.1 资讯详情
+const newsDetail = ref({})
+const routeNewsTtitle = ref("");
+//2.2 发布日期
+const time = ref("");
+//2.3 路径
+const routLevelTitle = ref("");
+const routLevelId = ref("");
+//是否展示投票
+const articleChoice = ref(false);
+//2.4获取详情
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+        method: 'GET',
+        query: {
+            'articleid': articleId
+        },
+    });
+    if (mkdata.code == 200) {
+        //判断是否显示投票
+        if (mkdata.data.is_survey == 1) {
+            console.log("本篇文章含有投票!")
+            articleChoice.value = true;
+            getVoteList();
+        }
+        //获取内容
+        newsDetail.value = mkdata.data;
+        //获取路径
+        routLevelTitle.value = newsDetail.value.cat_name;
+        routLevelId.value = newsDetail.value.category_id;
+        //获取发布时间
+        time.value = newsDetail.value.updated_at.split(' ')[0];
+        //修正标题长度
+        if (newsDetail.value.title.length >= 30) {
+            routeNewsTtitle.value = newsDetail.value.title.substr(0, 30) + "...";
+        } else {
+            routeNewsTtitle.value = newsDetail.value.title
+        }
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情内容")
+        console.log("后端错误反馈:", mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+getPageData();
+
+//2.5 获得广告
+//广告列表
+let adImg1 = ref([]);
+// async function getAdData(){
+//     const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'DETAIL'}});
+//     if(adData.code==200){
+//         for(let item of adData.data){
+//             if(item.ad_tag == 'DETAIL_0001'){
+//                 adImg1.value = item;
+//             }
+//         }
+//     }else{
+//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+//         console.log("错误位置:获取详情页广告列表")
+//         console.log("后端错误反馈:",adData.message)
+//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+//     }
+// }
+// getAdData();
+
+onMounted(async () => {
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_detail_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+})
+
+//2.页面数据 end ---------------------------------------->
+
+//3.设置seo信息 start---------------------------------------->
+//3.1 设置seo信息
+const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+    method: 'GET',
+    query: {
+        'articleid': articleId
+    },
+});
+if (setData.code == 200) {
+    let seoTitle = setData.data.title;
+    let seoDescription = setData.data.introduce;
+    let seoKeywords = setData.data.keyword;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoName + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置详情页面SEO数据")
+    console.log("后端错误反馈:", setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+//3.设置seo信息 end---------------------------------------->
+
+//4.投票 start---------------------------------------->
+const radio1 = ref(''); //单选
+const check1 = ref([]); //多选
+const isDisabled = ref(false);//是否禁用提交按钮
+const isRadio = ref(true);//是否渲染单选
+
+const userSurId = ref('');//投票属于哪一篇文章
+const userChoice = ref('');//用于判断用户选择了其他选项以后,输入的值
+const userIsChoice = ref('');//用于判断其他选项目前是什么值
+const showUserChoice = ref(false);//是否显示其他输入框
+const websiteSurveyData = ref([]);//投票结果
+
+//4.1获得投票列表
+let voteList = ref([]);
+async function getVoteList() {
+    const voteData = await requestHome('/web/getWebsiteSurvey', { method: 'GET', query: { 'art_id': articleId } });
+    console.log(778899)
+    console.log(voteData)
+    if (voteData.code == 200) {
+        voteList.value = voteData.data;
+        console.log(voteList.value)
+        //判断显示单选还是多选
+        //survey_type 0是单选 1是多选
+        if (voteData.data[0].survey_type == 0) {
+            isRadio.value = true;
+            console.log("1111")
+        } else {
+            isRadio.value = false;
+        }
+        //把最后一个的值拿出来 用于判断用户是否选择了其他
+        for (let item of voteData.data) {
+            //如果含有其他
+            if (item.is_other == 1) {
+                userIsChoice.value = item.id;
+            }
+        }
+        //用户投票属于哪一篇文章
+        userSurId.value = voteData.data[0].sur_id;
+
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:首页投票")
+        console.log("后端错误反馈:", voteData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+
+
+//4.2当用户选择了选项,判断是否展示其他输入框
+const handleRadioChange = (value) => {
+    if (value == userIsChoice.value) {
+        showUserChoice.value = true;
+    } else {
+        showUserChoice.value = false;
+    }
+}
+
+const handleCheckboxChange = (value) => {
+    if (value.includes(userIsChoice.value)) {
+        showUserChoice.value = true;
+    } else {
+        showUserChoice.value = false;
+    }
+}
+
+//4.3发起投票
+async function addWebsiteSurvey() {
+    //判断当前是单选还是多选
+    console.log(isRadio.value)
+    if (isRadio.value) {
+        console.log("用户单选!")
+        if (radio1.value != '') {
+            //先判断一下是否使用了其他选项
+            if (showUserChoice.value) {
+                if (userChoice.value != '') {
+                    //文章id
+                    // console.log(userSurId.value)
+                    // 用户输入的值
+                    // console.log(userChoice.value)
+                    //如果使用了其他,其他的选项需要增加进去
+                    const ChoiceData = await requestHome('/web/addWebsiteSurveyOption', {
+                        method: 'GET',
+                        query: {
+                            'sur_id': userSurId.value,//投票的新闻id
+                            'choice_name': userChoice.value,//投票的选项id
+                        }
+                    });
+                    if (ChoiceData.code == 200) {
+                        //提交完其他选项以后,再正式发起投票
+                        const mkData = await requestHome('/web/addWebsiteSurveyVote', {
+                            method: 'GET',
+                            query: {
+                                'sur_id': userSurId.value,
+                                'choice_id': ChoiceData.data
+                            }
+                        });
+                        if (mkData.code == 200) {
+                            ElMessage.success('投票成功!')
+                            //把投票结果显示到页面上 禁用投票按钮
+                            isDisabled.value = true;
+                            websiteSurveyData.value = mkData.data;
+                            //遍历一下,把用户选中的那个设置status为1
+                            let data = mkData.data;
+                            //遍历一下,把用户选中的那个设置status为1
+                            for (let item of data.data) {
+                                for (let i of data.choice) {
+                                    if (item.id == i) {
+                                        console.log(item.id)
+                                        item.status = 1;
+                                    }
+                                }
+                            }
+                            websiteSurveyData.value = data;
+                        } else {
+                            ElMessage.error(mkData.message)
+                        }
+                    } else {
+                        ElMessage.error('其他投票失败!')
+                    }
+                } else {
+                    ElMessage.error('请输入选项内容!')
+                }
+            } else {
+                //如果没选择其他,直接提交选择的内容
+                const mkData = await requestHome('/web/addWebsiteSurveyVote', {
+                    method: 'GET',
+                    query: {
+                        'sur_id': userSurId.value,
+                        'choice_id': radio1.value
+                    }
+                });
+                if (mkData.code == 200) {
+                    ElMessage.success('投票成功!')
+                    //把投票结果显示到页面上 禁用投票按钮
+                    isDisabled.value = true;
+                    let data = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    for (let item of data.data) {
+                        for (let i of data.choice) {
+                            if (item.id == i) {
+                                item.status = 1;
+                            }
+                        }
+                    }
+                    websiteSurveyData.value = data;
+                } else {
+                    ElMessage.error('投票失败!')
+                }
+            }
+        } else {
+            ElMessage.error('请选择一个选项')
+        }
+    } else {
+        console.log("多选!")
+        //多选
+        if (check1.value != []) {
+            //先判断一下是否使用了其他选项
+            if (showUserChoice.value) {
+                if (userChoice.value != '') {
+                    //判断用户是否只选择了一个其他
+                    if (check1.value.length == 1) {
+                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption', {
+                            method: 'GET',
+                            query: {
+                                'sur_id': userSurId.value,//投票的新闻id
+                                'choice_name': userChoice.value,//用户输入的其他选项文字
+                            }
+                        });
+                        if (ChoiceData.code == 200) {
+                            //提交完其他选项以后,再正式发起投票
+                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote', {
+                                method: 'GET',
+                                query: {
+                                    'sur_id': userSurId.value,
+                                    'choice_id': ChoiceData.data
+                                }
+                            });
+                            if (mkData.code == 200) {
+                                ElMessage.success('投票成功!')
+                                //把投票结果显示到页面上 禁用投票按钮
+                                isDisabled.value = true;
+                                websiteSurveyData.value = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                let data = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                for (let item of data.data) {
+                                    for (let i of data.choice) {
+                                        if (item.id == i) {
+                                            console.log(item.id)
+                                            item.status = 1;
+                                        }
+                                    }
+                                }
+                                websiteSurveyData.value = data;
+                            } else {
+                                ElMessage.error(mkData.message)
+                            }
+                        } else {
+                            ElMessage.error('其他投票失败!')
+                        }
+
+                    } else {
+                        //用户选择了除了其他以外,还包括别的选项
+                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption', {
+                            method: 'GET',
+                            query: {
+                                'sur_id': userSurId.value,//投票的新闻id
+                                'choice_name': userChoice.value,//用户输入的其他选项文字
+                            }
+                        });
+                        if (ChoiceData.code == 200) {
+                            let data = check1.value;
+                            //找到多选的数组,把其他默认值给替换掉
+                            for (let i = 0; i < data.length; i++) {
+                                if (data[i] == userIsChoice.value) {
+                                    data[i] = ChoiceData.data;
+                                }
+                            }
+                            let jsonArray = JSON.stringify(data);
+                            //提交完其他选项以后,再正式发起投票
+                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote', {
+                                method: 'GET',
+                                query: {
+                                    'sur_id': userSurId.value,
+                                    'choice_id': jsonArray
+                                }
+                            });
+
+                            if (mkData.code == 200) {
+                                ElMessage.success('投票成功!')
+                                //把投票结果显示到页面上 禁用投票按钮
+                                isDisabled.value = true;
+                                websiteSurveyData.value = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                let data = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                for (let item of data.data) {
+                                    for (let i of data.choice) {
+                                        if (item.id == i) {
+                                            //console.log(item.id)
+                                            item.status = 1;
+                                        }
+                                    }
+                                }
+                                websiteSurveyData.value = data;
+                            } else {
+                                ElMessage.error(mkData.message)
+                            }
+                        } else {
+                            ElMessage.error('其他投票失败!')
+                        }
+
+                    }
+                } else {
+                    ElMessage.error('请输入选项内容!')
+                }
+            } else {
+                let jsonArray = JSON.stringify(check1.value);
+                //如果没选择其他,直接提交选择的内容
+                const mkData = await requestDataPromise('/web/addWebsiteSurveyVote', {
+                    method: 'GET',
+                    query: {
+                        'sur_id': userSurId.value,
+                        'choice_id': jsonArray
+                    }
+                });
+                if (mkData.code == 200) {
+                    ElMessage.success('投票成功!')
+                    //把投票结果显示到页面上 禁用投票按钮
+                    isDisabled.value = true;
+                    websiteSurveyData.value = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    let data = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    for (let item of data.data) {
+                        for (let i of data.choice) {
+                            if (item.id == i) {
+                                console.log(item.id)
+                                item.status = 1;
+                            }
+                        }
+                    }
+                    websiteSurveyData.value = data;
+                } else {
+                    ElMessage.error('投票失败!')
+                }
+            }
+        } else {
+            ElMessage.error('请选择一个选项')
+        }
+    }
+}
+//4.投票 end---------------------------------------->
+
+//5.页面图片放大 start---------------------------------------->
+const previewVisible = ref(false)
+const selectedImage = ref(' ')
+
+const openPreview = (event) => {
+    if (event.target.tagName === 'IMG') {
+        selectedImage.value = event.target.src;
+        previewVisible.value = true;
+    }
+}
+const closePreview = () => {
+    previewVisible.value = false;
+}
+//5.页面图片放大 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/detail.less');
+</style>

+ 55 - 74
pages/newsList/[id].vue → pages/[dir]/[dir]/list-[id].vue

@@ -7,24 +7,15 @@
         <!-- 广告1 -->
         <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
 
-        <!-- 当前页面中的一级标题 -->
-        <!-- <div class="nav1" v-if="parent_name != ''">
-            <div class="inner">
-                <h2 class="nav1_title">
-                    <NuxtLink :to="`/primaryNavigation/${parent_id}`"> {{ parent_name }}</NuxtLink>
-                </h2>
-            </div>
-        </div> -->
-
         <!-- 二级导航列表 -->
         <div class="nav2top" v-if="parent_name != ''"></div>
         <div class="nav2" v-if="parent_name != ''">
             <ul class="inner">
                 <li class="home">
-                    <a :href="`/primaryNavigation/${parent_id}`">{{ parent_name }}</a>
+                    <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
                 </li>
                 <li class="titleList" v-for="(item, index) in secondNav" :key="index">
-                    <NuxtLink :to="{ path: `/newsList/${item.category_id}` }">
+                    <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html` }">
                         <span class="nav2_title">{{ item.alias }}</span>
                     </NuxtLink>
                 </li>
@@ -41,7 +32,7 @@
                         <NuxtLink to="/">首页</NuxtLink>
                     </el-breadcrumb-item>
                     <el-breadcrumb-item v-if="parent_name != ''">
-                        <NuxtLink :to="`/primaryNavigation/${parent_id}`"> {{ parent_name }}</NuxtLink>
+                        <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
                     </el-breadcrumb-item>
                     <el-breadcrumb-item>{{ name }}</el-breadcrumb-item>
                 </el-breadcrumb>
@@ -53,11 +44,7 @@
                 <div class="innerLeft">
                     <ul class="list">
                         <li v-for="(item, index) in newsList" :key="index">
-                            <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">
-                                <span class="listTitle">{{ item.title }}</span>
-                                <span class="time">{{ getTime(item.updated_at, 'month', 1) }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.alias">
                                 <span class="listTitle">{{ item.title }}</span>
                                 <span class="time">{{ getTime(item.updated_at, 'month', 1) }}</span>
                             </NuxtLink>
@@ -89,40 +76,61 @@ import { onMounted } from 'vue';
 import { ElBreadcrumb, ElBreadcrumbItem, ElPagination, ElMessage } from 'element-plus'
 import { ArrowRight } from '@element-plus/icons-vue'
 
-// const nuxtApp = useNuxtApp();
-// const axios = nuxtApp.$axios;
 
+//格式化跳转路径
+const getLinkPathDetail = (item) => {
+    if (item.islink == 1) {
+        return `${item.linkurl}`;
+    } else {
+        //return `/${item.aLIas_pinyin}/${item.id}`;
+        //return `/newsDetail/${item.id}`
+        return `/${item.pinyin}/${item.id}.html`;
+    }
+}
 
 //1.获得路由id start ---------------------------------------->
 const route = useRoute();
 let articleId = 0;//路由id
-let page = useState("page", () => 1)
-let total = useState("total", () => 0)
-let pageSize = useState("pageSize", () => 20)
-
-//判断用户是由于别名跳转还是直接访问二级分类,正常来说只会从别名访问
-const getRoute = () => {
-    if (route.meta.isAlias) {
-        //如果有别名,跳转是这样的:http://localhost:3000/zhaogongzhaopin20/1.html
-        //如果用户从别名访问,数据需要从meta中获取
-        articleId = route.meta.routeId;
-        // 获取route.params.id中的数字部分
-        const idString = route.params.id;
-        const idNumber = parseInt(idString.replace(/\D/g, ''), 10);
-        page.value = idNumber;
+let pageNum = ref(2);
+let total = ref(1);
+let page = ref(1);
+let pageSize = ref(20);
 
-    } else {
-        //如果没有别名 跳转是这样的:http://localhost:3000/newsList/20?page=1
-        articleId = route.params.id;
-        // page.value = route.query.page;
-    }
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/');
+const targetSegment = segments[2];
+const targetRoute = segments[1];
+
+
+//const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//let routeId = 20 //排除路径错误可以打开这个
+//articleId = numberPart;
+
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+if (getRouteId.code == 200) {
+    articleId = getRouteId.data.category_id
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:", getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
 }
+//获得html前的数字
+// const pageUrl = segments[3]; 
+// const pageNumber = pageUrl.split('.')[0];
+// console.log("当前URL中的页码:")
+// console.log(pageNumber)//2
+// pageNum.value = parseInt(pageNumber);
+pageNum.value = parseInt(route.params.id);
 
-// 监听路由变化
-watch(() => route.path, (newPath) => {
-    //每当路径变化的时候重新获取routeId
-    getRoute()
-}, { immediate: true })
 //1.获得路由id end ---------------------------------------->
 
 //2.页面数据 start ---------------------------------------->
@@ -191,6 +199,7 @@ getPageName();
 //3.1通过id获取父栏目
 const parent_name = ref([]);
 const parent_id = ref([]);
+const parent_pinyin = ref("");
 let getParentNav = async () => {
     const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
         method: 'GET',
@@ -199,9 +208,11 @@ let getParentNav = async () => {
         },
     });
     if (listData.code == 200) {
+        console.log(111999)
         console.log(listData.data);
         parent_name.value = listData.data.parent_name;
         parent_id.value = listData.data.parent_id;
+        parent_pinyin.value = listData.data.parent_pinyin;
     } else {
         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
         console.log("错误位置:获取新闻列表")
@@ -210,7 +221,7 @@ let getParentNav = async () => {
     }
     getSecondNav();
 }
-//获得列表
+//获得父级栏目详情
 getParentNav();
 
 // 3.2获取二级栏目
@@ -313,36 +324,6 @@ onMounted(async () => {
     overflow: hidden;
 }
 
-.nav1 {
-    width: 100%;
-    height: 214px;
-    background: #fff;
-
-    .inner {
-        width: 1200px;
-        height: 214px;
-        margin: 0 auto;
-
-        .nav1_title {
-            width: 1120px;
-            height: 214px;
-            margin-left: 40px;
-            line-height: 217px;
-            text-align: center;
-            font-family: DingTalk JinBuTi, DingTalk JinBuTi;
-            font-weight: 400;
-            font-size: 50px;
-            color: #6D2512;
-            background: url(/_nuxt/public/index/title_bg.png) no-repeat 0;
-
-            a {
-                color: #6D2512;
-            }
-        }
-
-    }
-}
-
 .nav2top {
     width: 1250px;
     height: 3px;

+ 611 - 0
pages/[dir]/[id].vue

@@ -0,0 +1,611 @@
+<template>
+    <!-- 页面头部 -->
+    <HomePageHead></HomePageHead>
+    <!-- 页面导航 -->
+    <HomePageNavigation></HomePageNavigation>
+    <!-- 广告1 -->
+    <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+
+    <!-- 面包屑导航 -->
+    <div class="breadcrumb">
+        <div class="inner">
+            <span class="location">当前位置:</span>
+            <el-breadcrumb :separator-icon="ArrowRight">
+                <el-breadcrumb-item>
+                    <NuxtLink to="/">首页</NuxtLink>
+                </el-breadcrumb-item>
+                <el-breadcrumb-item>
+                    <NuxtLink :to="`/${parent_pinyin}/index.html`">
+                        {{ routLevelTitle }}
+                    </NuxtLink>
+                </el-breadcrumb-item>
+                <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
+            </el-breadcrumb>
+        </div>
+    </div>
+
+    <!-- 资讯列表 -->
+    <div class="newsDetail">
+        <div class="inner">
+            <div class="innerLeft">
+                <div class="LeftTop">
+                    <h1>{{ newsDetail.title }}</h1>
+                    <p>
+                        来源: <span>{{ newsDetail.copyfrom }}</span>
+                        作者: <span>{{ newsDetail.author }}</span>
+                        发布时间: <span>{{ time }}</span>
+                    </p>
+                </div>
+                <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">
+                </div>
+
+                <!-- 免责声明: -->
+                <div class="disclaimer" v-if="newsDetail.fromurl">
+                    <p>原文链接:{{ newsDetail.fromurl }}</p>
+                    <p>[免责声明]本文来源于网络转载,仅供学习交流使用,不构成商业目的。 版权归原作者所有,如涉及作品内容,版权和其他问题,请在30日与本网联系,我们将第一时间处理。</p>
+                </div>
+                <div v-if="articleChoice">
+                    <!-- 投票 start ---------------------------------------->
+                    <div class="index_3_box_vote" v-if="articleChoice">
+                        <div class="voteTitle">投票区</div>
+                        <div class="inquire">
+                            <p v-if="voteList.length > 0">{{ voteList[0].survey_name }}</p>
+                            <div class="radioBox">
+                                <!--投票选项-->
+                                <div v-if="!isDisabled">
+                                    <div class="radio" v-if="isRadio">
+                                        <el-radio-group v-model="radio1" @change="handleRadioChange">
+                                            <el-radio v-for="item in voteList" :key="item.id" :value="item.id"
+                                                size="large">
+                                                <span v-if="item.is_other == 0">{{ item.choice_name }}</span>
+                                                <span v-else>其他</span>
+                                            </el-radio>
+                                        </el-radio-group>
+                                        <el-input v-if="showUserChoice" v-model="userChoice" :rows="2" type="textarea"
+                                            resize="none" placeholder="请输入.." />
+                                    </div>
+                                    <div class="checkInputBox" v-else>
+                                        <el-checkbox-group v-model="check1" @change="handleCheckboxChange">
+                                            <span v-for="item in voteList" :key="item.id">
+                                                <span v-if="item.is_other == 0">
+                                                    <el-checkbox size="large" :label="item.choice_name"
+                                                        :value="item.id" />
+                                                </span>
+                                                <span v-else>
+                                                    <el-checkbox size="large" label="其他" :value="item.id" />
+                                                </span>
+                                            </span>
+                                        </el-checkbox-group>
+                                        <el-input v-if="showUserChoice" v-model="userChoice" :rows="2" type="textarea"
+                                            resize="none" placeholder="请输入.." />
+                                    </div>
+                                </div>
+                                <!--投票结果-->
+                                <div class="inquireData" v-else>
+                                    <div v-for="item in websiteSurveyData.data" :key="item.id">
+                                        <div class="inquireDataItem active" v-if="item.status == 1">
+                                            <div class="inquireDataItemTitle">
+                                                <span v-if="item.choice_name == ''">其他</span>
+                                                <span v-else>{{ item.choice_name }}</span>
+                                            </div>
+                                            <div class="inquireDataItemNum">{{ item.results }}票</div>
+                                        </div>
+                                        <div class="inquireDataItem" v-else>
+                                            <div class="inquireDataItemTitle">
+                                                <span v-if="item.choice_name == ''">其他</span>
+                                                <span v-else>{{ item.choice_name }}</span>
+                                            </div>
+                                            <div class="inquireDataItemNum">{{ item.results }}票</div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="btn">
+                                <button class="voting" @click="addWebsiteSurvey" :disabled="isDisabled"
+                                    v-if="!isDisabled">投票</button>
+                            </div>
+                        </div>
+                    </div>
+                    <!-- 投票 end ---------------------------------------->
+                </div>
+            </div>
+            <div class="innerRight">
+                <!-- 热点资讯1 -->
+                <div class="hotList1">
+                    <DetailHotNews></DetailHotNews>
+                </div>
+                <!-- 热点资讯2 -->
+                <div class="hotList2">
+                    <DetailHotNews2></DetailHotNews2>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <!-- 页面底部 -->
+    <HomeFoot1></HomeFoot1>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { onMounted } from 'vue'
+import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+
+//1.1 获得跳转过来的id
+const route = useRoute();
+//获得详情id
+const articleId = parseInt(route.params.id); //获得该页面的id
+
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/');
+const targetSegment = segments[1];
+// const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+// let routeId = 20 //排除路径错误可以打开这个
+// const routeId = numberPart;
+let routeId;
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+if (getRouteId.code == 200) {
+    routeId = getRouteId.data.category_id
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:", getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+
+
+//1.2 获得父级栏目的名称、id
+const parent_name = ref([]);
+const parent_id = ref([]);
+const parent_pinyin = ref("");
+const parent_children_count = ref(0)
+let getParentNav = async () => {
+    const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'catid': routeId
+        },
+    });
+    console.log("获取父级栏目数据")
+    console.log(listData)
+    if (listData.code == 200) {
+        console.log(listData.data);
+        parent_name.value = listData.data.alias;
+        parent_id.value = listData.data.parent_id;
+        parent_pinyin.value = listData.data.aLIas_pinyin;
+        parent_children_count = listData.data.children_coun;
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取面包屑导航")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//获得父级栏目详情
+getParentNav();
+//1.页面依赖 end ---------------------------------------->
+
+//2.页面数据 start ---------------------------------------->
+//2.1 资讯详情
+const newsDetail = ref({})
+const routeNewsTtitle = ref("");
+//2.2 发布日期
+const time = ref("");
+//2.3 路径
+const routLevelTitle = ref("");
+const routLevelId = ref("");
+//是否展示投票
+const articleChoice = ref(false);
+//2.4获取详情
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+        method: 'GET',
+        query: {
+            'articleid': articleId
+        },
+    });
+    if (mkdata.code == 200) {
+        //判断是否显示投票
+        if (mkdata.data.is_survey == 1) {
+            console.log("本篇文章含有投票!")
+            articleChoice.value = true;
+            getVoteList();
+        }
+        //获取内容
+        newsDetail.value = mkdata.data;
+        //获取路径
+        routLevelTitle.value = newsDetail.value.cat_name;
+        routLevelId.value = newsDetail.value.category_id;
+        //获取发布时间
+        time.value = newsDetail.value.updated_at.split(' ')[0];
+        //修正标题长度
+        if (newsDetail.value.title.length >= 30) {
+            routeNewsTtitle.value = newsDetail.value.title.substr(0, 30) + "...";
+        } else {
+            routeNewsTtitle.value = newsDetail.value.title
+        }
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取详情内容")
+        console.log("后端错误反馈:", mkdata.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+getPageData();
+
+//2.5 获得广告
+//广告列表
+let adImg1 = ref([]);
+
+onMounted(async () => {
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_detail_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+})
+
+//2.页面数据 end ---------------------------------------->
+
+//3.设置seo信息 start---------------------------------------->
+//3.1 设置seo信息
+const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
+    method: 'GET',
+    query: {
+        'articleid': articleId
+    },
+});
+if (setData.code == 200) {
+    let seoTitle = setData.data.title;
+    let seoDescription = setData.data.introduce;
+    let seoKeywords = setData.data.keyword;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoName + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置详情页面SEO数据")
+    console.log("后端错误反馈:", setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+//3.设置seo信息 end---------------------------------------->
+
+//4.投票 start---------------------------------------->
+const radio1 = ref(''); //单选
+const check1 = ref([]); //多选
+const isDisabled = ref(false);//是否禁用提交按钮
+const isRadio = ref(true);//是否渲染单选
+
+const userSurId = ref('');//投票属于哪一篇文章
+const userChoice = ref('');//用于判断用户选择了其他选项以后,输入的值
+const userIsChoice = ref('');//用于判断其他选项目前是什么值
+const showUserChoice = ref(false);//是否显示其他输入框
+const websiteSurveyData = ref([]);//投票结果
+
+//3.2获得投票列表
+let voteList = ref([]);
+async function getVoteList() {
+    const voteData = await requestHome('/web/getWebsiteSurvey', { method: 'GET', query: { 'art_id': articleId } });
+    console.log(778899)
+    console.log(voteData)
+    if (voteData.code == 200) {
+        voteList.value = voteData.data;
+        console.log(voteList.value)
+        //判断显示单选还是多选
+        //survey_type 0是单选 1是多选
+        if (voteData.data[0].survey_type == 0) {
+            isRadio.value = true;
+            console.log("1111")
+        } else {
+            isRadio.value = false;
+        }
+        //把最后一个的值拿出来 用于判断用户是否选择了其他
+        for (let item of voteData.data) {
+            //如果含有其他
+            if (item.is_other == 1) {
+                userIsChoice.value = item.id;
+            }
+        }
+        //用户投票属于哪一篇文章
+        userSurId.value = voteData.data[0].sur_id;
+
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:首页投票")
+        console.log("后端错误反馈:", voteData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+
+
+//3.2当用户选择了选项,判断是否展示其他输入框
+const handleRadioChange = (value) => {
+    if (value == userIsChoice.value) {
+        showUserChoice.value = true;
+    } else {
+        showUserChoice.value = false;
+    }
+}
+
+const handleCheckboxChange = (value) => {
+    if (value.includes(userIsChoice.value)) {
+        showUserChoice.value = true;
+    } else {
+        showUserChoice.value = false;
+    }
+}
+
+//3.2发起投票
+async function addWebsiteSurvey() {
+    //判断当前是单选还是多选
+    console.log(isRadio.value)
+    if (isRadio.value) {
+        console.log("用户单选!")
+        if (radio1.value != '') {
+            //先判断一下是否使用了其他选项
+            if (showUserChoice.value) {
+                if (userChoice.value != '') {
+                    //文章id
+                    // console.log(userSurId.value)
+                    // 用户输入的值
+                    // console.log(userChoice.value)
+                    //如果使用了其他,其他的选项需要增加进去
+                    const ChoiceData = await requestHome('/web/addWebsiteSurveyOption', {
+                        method: 'GET',
+                        query: {
+                            'sur_id': userSurId.value,//投票的新闻id
+                            'choice_name': userChoice.value,//投票的选项id
+                        }
+                    });
+                    if (ChoiceData.code == 200) {
+                        //提交完其他选项以后,再正式发起投票
+                        const mkData = await requestHome('/web/addWebsiteSurveyVote', {
+                            method: 'GET',
+                            query: {
+                                'sur_id': userSurId.value,
+                                'choice_id': ChoiceData.data
+                            }
+                        });
+                        if (mkData.code == 200) {
+                            ElMessage.success('投票成功!')
+                            //把投票结果显示到页面上 禁用投票按钮
+                            isDisabled.value = true;
+                            websiteSurveyData.value = mkData.data;
+                            //遍历一下,把用户选中的那个设置status为1
+                            let data = mkData.data;
+                            //遍历一下,把用户选中的那个设置status为1
+                            for (let item of data.data) {
+                                for (let i of data.choice) {
+                                    if (item.id == i) {
+                                        console.log(item.id)
+                                        item.status = 1;
+                                    }
+                                }
+                            }
+                            websiteSurveyData.value = data;
+                        } else {
+                            ElMessage.error(mkData.message)
+                        }
+                    } else {
+                        ElMessage.error('其他投票失败!')
+                    }
+                } else {
+                    ElMessage.error('请输入选项内容!')
+                }
+            } else {
+                //如果没选择其他,直接提交选择的内容
+                const mkData = await requestHome('/web/addWebsiteSurveyVote', {
+                    method: 'GET',
+                    query: {
+                        'sur_id': userSurId.value,
+                        'choice_id': radio1.value
+                    }
+                });
+                if (mkData.code == 200) {
+                    ElMessage.success('投票成功!')
+                    //把投票结果显示到页面上 禁用投票按钮
+                    isDisabled.value = true;
+                    let data = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    for (let item of data.data) {
+                        for (let i of data.choice) {
+                            if (item.id == i) {
+                                item.status = 1;
+                            }
+                        }
+                    }
+                    websiteSurveyData.value = data;
+                } else {
+                    ElMessage.error('投票失败!')
+                }
+            }
+        } else {
+            ElMessage.error('请选择一个选项')
+        }
+    } else {
+        console.log("多选!")
+        //多选
+        if (check1.value != []) {
+            //先判断一下是否使用了其他选项
+            if (showUserChoice.value) {
+                if (userChoice.value != '') {
+                    //判断用户是否只选择了一个其他
+                    if (check1.value.length == 1) {
+                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption', {
+                            method: 'GET',
+                            query: {
+                                'sur_id': userSurId.value,//投票的新闻id
+                                'choice_name': userChoice.value,//用户输入的其他选项文字
+                            }
+                        });
+                        if (ChoiceData.code == 200) {
+                            //提交完其他选项以后,再正式发起投票
+                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote', {
+                                method: 'GET',
+                                query: {
+                                    'sur_id': userSurId.value,
+                                    'choice_id': ChoiceData.data
+                                }
+                            });
+                            if (mkData.code == 200) {
+                                ElMessage.success('投票成功!')
+                                //把投票结果显示到页面上 禁用投票按钮
+                                isDisabled.value = true;
+                                websiteSurveyData.value = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                let data = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                for (let item of data.data) {
+                                    for (let i of data.choice) {
+                                        if (item.id == i) {
+                                            console.log(item.id)
+                                            item.status = 1;
+                                        }
+                                    }
+                                }
+                                websiteSurveyData.value = data;
+                            } else {
+                                ElMessage.error(mkData.message)
+                            }
+                        } else {
+                            ElMessage.error('其他投票失败!')
+                        }
+
+                    } else {
+                        //用户选择了除了其他以外,还包括别的选项
+                        const ChoiceData = await requestDataPromise('/web/addWebsiteSurveyOption', {
+                            method: 'GET',
+                            query: {
+                                'sur_id': userSurId.value,//投票的新闻id
+                                'choice_name': userChoice.value,//用户输入的其他选项文字
+                            }
+                        });
+                        if (ChoiceData.code == 200) {
+                            let data = check1.value;
+                            //找到多选的数组,把其他默认值给替换掉
+                            for (let i = 0; i < data.length; i++) {
+                                if (data[i] == userIsChoice.value) {
+                                    data[i] = ChoiceData.data;
+                                }
+                            }
+                            let jsonArray = JSON.stringify(data);
+                            //提交完其他选项以后,再正式发起投票
+                            const mkData = await requestDataPromise('/web/addWebsiteSurveyVote', {
+                                method: 'GET',
+                                query: {
+                                    'sur_id': userSurId.value,
+                                    'choice_id': jsonArray
+                                }
+                            });
+
+                            if (mkData.code == 200) {
+                                ElMessage.success('投票成功!')
+                                //把投票结果显示到页面上 禁用投票按钮
+                                isDisabled.value = true;
+                                websiteSurveyData.value = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                let data = mkData.data;
+                                //遍历一下,把用户选中的那个设置status为1
+                                for (let item of data.data) {
+                                    for (let i of data.choice) {
+                                        if (item.id == i) {
+                                            //console.log(item.id)
+                                            item.status = 1;
+                                        }
+                                    }
+                                }
+                                websiteSurveyData.value = data;
+                            } else {
+                                ElMessage.error(mkData.message)
+                            }
+                        } else {
+                            ElMessage.error('其他投票失败!')
+                        }
+
+                    }
+                } else {
+                    ElMessage.error('请输入选项内容!')
+                }
+            } else {
+                let jsonArray = JSON.stringify(check1.value);
+                //如果没选择其他,直接提交选择的内容
+                const mkData = await requestDataPromise('/web/addWebsiteSurveyVote', {
+                    method: 'GET',
+                    query: {
+                        'sur_id': userSurId.value,
+                        'choice_id': jsonArray
+                    }
+                });
+                if (mkData.code == 200) {
+                    ElMessage.success('投票成功!')
+                    //把投票结果显示到页面上 禁用投票按钮
+                    isDisabled.value = true;
+                    websiteSurveyData.value = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    let data = mkData.data;
+                    //遍历一下,把用户选中的那个设置status为1
+                    for (let item of data.data) {
+                        for (let i of data.choice) {
+                            if (item.id == i) {
+                                console.log(item.id)
+                                item.status = 1;
+                            }
+                        }
+                    }
+                    websiteSurveyData.value = data;
+                } else {
+                    ElMessage.error('投票失败!')
+                }
+            }
+        } else {
+            ElMessage.error('请选择一个选项')
+        }
+    }
+}
+//4.投票 end---------------------------------------->
+
+//5.页面图片放大 start---------------------------------------->
+const previewVisible = ref(false)
+const selectedImage = ref(' ')
+
+const openPreview = (event) => {
+    if (event.target.tagName === 'IMG') {
+        selectedImage.value = event.target.src;
+        previewVisible.value = true;
+    }
+}
+const closePreview = () => {
+    previewVisible.value = false;
+}
+//5.页面图片放大 end---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/detail.less');
+</style>

+ 243 - 134
pages/primaryNavigation/[id].vue → pages/[dir]/index.html.vue

@@ -7,13 +7,6 @@
         <!-- 广告一 -->
         <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
 
-        <!-- 当前页面中的一级标题 -->
-        <!-- <div class="nav1">
-            <div class="inner">
-                <h2 class="nav1_title">{{ title }}</h2>
-            </div>
-        </div> -->
-
         <!-- 二级导航列表 -->
         <div class="nav2top"></div>
         <div class="nav2">
@@ -377,41 +370,54 @@ import { ref, onMounted } from 'vue';
 //格式化跳转路径 - 标题
 //首页分类栏目标题,不需要考虑外链
 const getLinkPath = (item) => {
-    //return `/${item.url}/1.html`;
-    return `/newsList/${item.cid}?page=1`;
+    // console.log('item111',item)
+    // return `/${item.url}/1.html`;
+    // return `/newsList/${item.cid}?page=1`;
+    return `/${item.aLIas_pinyin}/list-1.html`;
 }
 //首页跳转到详情,这里需要考虑外链
 const getLinkPathDetail = (item) => {
+    console.log('item111', item)
     if (item.islink == 1) {
         return `${item.linkurl}`;
     } else {
         //return `/${item.aLIas_pinyin}/${item.id}`;
-        return `/newsDetail/${item.id}?page=1`
+        // return `/newsDetail/${item.id}?page=1`
+        return `/${item.pinyin}/${item.id}.html`;
     }
 }
 //0.加载页面依赖 end ---------------------------------------->
 
 //1.获得路由id start ---------------------------------------->
 const route = useRoute();
-let routeId = 0;//路由id
 
-//判断用户是由于别名跳转还是直接访问二级分类,正常来说只会从别名访问
-const getRoute = () => {
-    if (route.meta.isAlias) {
-        //如果用户从别名访问,数据需要从meta中获取
-        routeId = route.meta.routeId;
-    } else {
-        routeId = route.params.id;
-    }
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/');
+const targetSegment = segments[1];
+//let routeId = 11 //排除路径错误可以打开这个
+//const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//let routeId = numberPart;
+let routeId;
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+if (getRouteId.code == 200) {
+    routeId = getRouteId.data.category_id
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:", getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
 }
-
-// 监听路由变化
-watch(() => route.path, (newPath) => {
-    //每当路径变化的时候重新获取routeId
-    getRoute()
-}, { immediate: true })
 //1.获得路由id end ---------------------------------------->
 
+
 //2.页面交互效果 start ---------------------------------------->
 //2.1 
 const title = ref("")
@@ -493,7 +499,7 @@ onMounted(async () => {
     adImg3.value = resultAd3.data[0];
 
     //广告4
-    let url4 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_category_0004`
+    let url4 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_category_0004`
     const responseAd4 = await fetch(url4, {
         headers: {
             'Content-Type': 'application/json',
@@ -543,7 +549,7 @@ try {
                 cid: navigateData.data[index].category_id,
                 children_count: navigateData.data[index].children_count,
                 alias: navigateData.data[index].alias,
-                url: navigateData.data[index].aLIas_pinyin,
+                aLIas_pinyin: targetSegment + "/" + navigateData.data[index].aLIas_pinyin,
                 data: [],
                 data1: [],
                 data2: [],
@@ -566,14 +572,26 @@ try {
             }
         }
         //导航池加载完毕,开始申请模块数据
-        await getPageData1();
-        await getPageData2();
-        await getPageData3();
-        await getPageData4();
-        await getPageData5();
-        await getPageData6();
-        await getPageData7();
-        await getPageData8();
+        // await getPageData1();
+        // await getPageData2();
+        // await getPageData3();
+        // await getPageData4();
+        // await getPageData5();
+        // await getPageData6();
+        // await getPageData7();
+        // await getPageData8();
+        let getJson = [
+            { "parent": routeId + ",0,0", "child": pageData.value[0].cid + ",3,10" },//模块1理论前沿
+            { "parent": routeId + ",0,0", "child": pageData.value[1].cid + ",2,6" },//模块2典型经验
+            { "parent": routeId + ",0,0", "child": pageData.value[2].cid + ",3,10" },//模块3农业天地
+            { "parent": routeId + ",0,0", "child": pageData.value[3].cid + ",2,6" },//模块4美丽乡村
+            { "parent": routeId + ",0,0", "child": pageData.value[4].cid + ",1,10" },//模块5农民之家
+            { "parent": routeId + ",0,0", "child": pageData.value[5].cid + ",3,10" },//模块6农业天地
+            { "parent": routeId + ",0,0", "child": pageData.value[6].cid + ",3,10" },//模块7农村建设
+            { "parent": routeId + ",0,0", "child": pageData.value[7].cid + ",3,13" },//模块8高端资讯
+        ]
+        let jsonString = JSON.stringify(getJson);
+        getPageAllData(jsonString);
     } else {
         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
         console.log("错误位置:分类页导航池")
@@ -587,127 +605,217 @@ try {
     console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
 }
 
-
-//获得模块数据
-async function getPageData(catid, img_num, text_num, modulesNum, childNavNum, childImgNum, childTextNum) {
-    const mkdata = await requestDataPromise('/web/getWebsiteCatidArticle', {
+async function getPageAllData(jsonString) {
+    const mkdata = await requestDataPromise('/web/getWebsiteAllArticle', {
         method: 'GET',
         query: {
-            'catid': catid, //catid
-            'img_num': img_num, //图片数量
-            'text_num': text_num, //文字数量
-            'child_catnum': childNavNum,//子级栏目菜单数量
-            'child_imgnum': childImgNum,//子栏目展示图片新闻数量
-            'child_textnum': childTextNum//子栏目展示文字新闻数量
+            'id': jsonString
         },
     });
-    if (modulesNum == 1) {
-        for (let i in mkdata.data.img) {
-            if (i < 1) {
-                pageData.value[0].data.push(mkdata.data.img[i]);
-            } else {
-                pageData.value[0].data1.push(mkdata.data.img[i]);
-            }
+
+    if (mkdata.code == 200) {
+        console.log(778899)
+        console.log(mkdata.data)
+        //模块1理论前沿
+        if (mkdata.data[0].child.imgnum.length > 0) {
+            pageData.value[0].data.push(mkdata.data[0].child.imgnum[0]);
         }
-        pageData.value[0].data2 = mkdata.data.text;
-    }
-    if (modulesNum == 2) {
-        pageData.value[1].data = mkdata.data.img;
-        pageData.value[1].data1 = mkdata.data.text;
-    }
-    if (modulesNum == 3) {
-        for (let i in mkdata.data.img) {
-            if (i < 1) {
-                pageData.value[2].data.push(mkdata.data.img[i]);
-            } else {
-                pageData.value[2].data1.push(mkdata.data.img[i]);
-            }
+        if (mkdata.data[0].child.imgnum.length > 1) {
+            pageData.value[0].data1.push(mkdata.data[0].child.imgnum[1]);
         }
-        pageData.value[2].data2 = mkdata.data.text;
-    }
-    if (modulesNum == 4) {
-        pageData.value[3].data = mkdata.data.img;
-        pageData.value[3].data2 = mkdata.data.text;
-    }
-    if (modulesNum == 5) {
-        pageData.value[4].data = mkdata.data.img;
-        for (let i in mkdata.data.text) {
+        if (mkdata.data[0].child.imgnum.length > 2) {
+            pageData.value[0].data1.push(mkdata.data[0].child.imgnum[2]);
+        }
+        pageData.value[0].data2 = mkdata.data[0].child.textnum;
+        //模块2典型经验
+        pageData.value[1].data = mkdata.data[1].child.imgnum;
+        pageData.value[1].data1 = mkdata.data[1].child.textnum;
+        //模块3农业天地
+        if (mkdata.data[2].child.imgnum.length > 0) {
+            pageData.value[2].data.push(mkdata.data[2].child.imgnum[0]);
+        }
+        if (mkdata.data[2].child.imgnum.length > 1) {
+            pageData.value[2].data1.push(mkdata.data[2].child.imgnum[1]);
+        }
+        if (mkdata.data[2].child.imgnum.length > 2) {
+            pageData.value[2].data1.push(mkdata.data[2].child.imgnum[2]);
+        }
+        pageData.value[2].data2 = mkdata.data[2].child.textnum;
+        //模块4美丽乡村
+        pageData.value[3].data = mkdata.data[3].child.imgnum;
+        pageData.value[3].data2 = mkdata.data[3].child.textnum;
+        //模块5农民之家
+        pageData.value[4].data = mkdata.data[4].child.imgnum;
+        for (let i in mkdata.data[4].child.textnum) {
             if (i < 5) {
-                pageData.value[4].data1.push(mkdata.data.text[i]);
+                pageData.value[4].data1.push(mkdata.data[4].child.textnum[i]);
             } else {
-                pageData.value[4].data2.push(mkdata.data.text[i]);
+                pageData.value[4].data2.push(mkdata.data[4].child.textnum[i]);
             }
         }
-    }
-    if (modulesNum == 6) {
-        for (let i in mkdata.data.img) {
-            if (i < 1) {
-                pageData.value[5].data.push(mkdata.data.img[i]);
-            } else {
-                pageData.value[5].data1.push(mkdata.data.img[i]);
-            }
+        //模块6农业天地
+        if (mkdata.data[5].child.imgnum.length > 0) {
+            pageData.value[5].data.push(mkdata.data[5].child.imgnum[0]);
         }
-        pageData.value[5].data2 = mkdata.data.text;
-    }
-    if (modulesNum == 7) {
-        for (let i in mkdata.data.img) {
-            if (i < 1) {
-                pageData.value[6].data.push(mkdata.data.img[i]);
-            } else {
-                pageData.value[6].data1.push(mkdata.data.img[i]);
-            }
+        if (mkdata.data[5].child.imgnum.length > 1) {
+            pageData.value[5].data1.push(mkdata.data[5].child.imgnum[1]);
         }
-        pageData.value[6].data2 = mkdata.data.text;
-    }
-    //模块8 向后移动一个位置
-    if (modulesNum == 8) {
-        pageData.value[7].data = mkdata.data.img;
-        for (let i in mkdata.data.text) {
+        if (mkdata.data[5].child.imgnum.length > 2) {
+            pageData.value[5].data1.push(mkdata.data[5].child.imgnum[2]);
+        }
+        pageData.value[5].data2 = mkdata.data[5].child.textnum;
+        //模块7农村建设
+        if (mkdata.data[6].child.imgnum.length > 0) {
+            pageData.value[6].data.push(mkdata.data[6].child.imgnum[0]);
+        }
+        if (mkdata.data[6].child.imgnum.length > 1) {
+            pageData.value[6].data1.push(mkdata.data[6].child.imgnum[1]);
+        }
+        if (mkdata.data[6].child.imgnum.length > 2) {
+            pageData.value[6].data1.push(mkdata.data[6].child.imgnum[2]);
+        }
+        pageData.value[6].data2 = mkdata.data[6].child.textnum;
+        //模块8高端资讯
+        pageData.value[7].data2 = mkdata.data[7].child.imgnum;
+        for (let i in mkdata.data[4].child.textnum) {
             if (i < 7) {
-                pageData.value[7].data1.push(mkdata.data.text[i]);
+                pageData.value[7].data1.push(mkdata.data[4].child.textnum[i]);
             } else if (i < 9) {
-                pageData.value[7].data2.push(mkdata.data.text[i]);
+                pageData.value[7].data2.push(mkdata.data[4].child.textnum[i]);
             } else if (i < 11) {
-                pageData.value[7].data3.push(mkdata.data.text[i]);
+                pageData.value[7].data3.push(mkdata.data[4].child.textnum[i]);
             } else {
-                pageData.value[7].data4.push(mkdata.data.text[i]);
+                pageData.value[7].data4.push(mkdata.data[4].child.textnum[i]);
             }
         }
+
+    } else {
+        ElMessage.error(mkdata.message)
     }
 }
+
+
+//获得模块数据
+// async function getPageData(catid, img_num, text_num, modulesNum, childNavNum, childImgNum, childTextNum) {
+//     const mkdata = await requestDataPromise('/web/getWebsiteCatidArticle', {
+//         method: 'GET',
+//         query: {
+//             'catid': catid, //catid
+//             'img_num': img_num, //图片数量
+//             'text_num': text_num, //文字数量
+//             'child_catnum': childNavNum,//子级栏目菜单数量
+//             'child_imgnum': childImgNum,//子栏目展示图片新闻数量
+//             'child_textnum': childTextNum//子栏目展示文字新闻数量
+//         },
+//     });
+//     if (modulesNum == 1) {
+//         for (let i in mkdata.data.img) {
+//             if (i < 1) {
+//                 pageData.value[0].data.push(mkdata.data.img[i]);
+//             } else {
+//                 pageData.value[0].data1.push(mkdata.data.img[i]);
+//             }
+//         }
+//         pageData.value[0].data2 = mkdata.data.text;
+//     }
+//     if (modulesNum == 2) {
+//         pageData.value[1].data = mkdata.data.img;
+//         pageData.value[1].data1 = mkdata.data.text;
+//     }
+//     if (modulesNum == 3) {
+//         for (let i in mkdata.data.img) {
+//             if (i < 1) {
+//                 pageData.value[2].data.push(mkdata.data.img[i]);
+//             } else {
+//                 pageData.value[2].data1.push(mkdata.data.img[i]);
+//             }
+//         }
+//         pageData.value[2].data2 = mkdata.data.text;
+//     }
+//     if (modulesNum == 4) {
+//         pageData.value[3].data = mkdata.data.img;
+//         pageData.value[3].data2 = mkdata.data.text;
+//     }
+//     //模块5
+//     if (modulesNum == 5) {
+//         pageData.value[4].data = mkdata.data.img;
+//         for (let i in mkdata.data.text) {
+//             if (i < 5) {
+//                 pageData.value[4].data1.push(mkdata.data.text[i]);
+//             } else {
+//                 pageData.value[4].data2.push(mkdata.data.text[i]);
+//             }
+//         }
+//     }
+//     if (modulesNum == 6) {
+//         for (let i in mkdata.data.img) {
+//             if (i < 1) {
+//                 pageData.value[5].data.push(mkdata.data.img[i]);
+//             } else {
+//                 pageData.value[5].data1.push(mkdata.data.img[i]);
+//             }
+//         }
+//         pageData.value[5].data2 = mkdata.data.text;
+//     }
+//     if (modulesNum == 7) {
+//         for (let i in mkdata.data.img) {
+//             if (i < 1) {
+//                 pageData.value[6].data.push(mkdata.data.img[i]);
+//             } else {
+//                 pageData.value[6].data1.push(mkdata.data.img[i]);
+//             }
+//         }
+//         pageData.value[6].data2 = mkdata.data.text;
+//     }
+//     //模块8 
+//     if (modulesNum == 8) {
+//         pageData.value[7].data = mkdata.data.img;
+//         for (let i in mkdata.data.text) {
+//             if (i < 7) {
+//                 pageData.value[7].data1.push(mkdata.data.text[i]);
+//             } else if (i < 9) {
+//                 pageData.value[7].data2.push(mkdata.data.text[i]);
+//             } else if (i < 11) {
+//                 pageData.value[7].data3.push(mkdata.data.text[i]);
+//             } else {
+//                 pageData.value[7].data4.push(mkdata.data.text[i]);
+//             }
+//         }
+//     }
+// }
 //新农村
 //模块1 理论前沿
-async function getPageData1() {
-    await getPageData(pageData.value[0].cid, 3, 10, 1, 0, 0, 0);
-}
-//模块2 典型经验
-async function getPageData2() {
-    await getPageData(pageData.value[1].cid, 2, 6, 2, 0, 0, 0);
-}
-//模块3 农业天地
-async function getPageData3() {
-    await getPageData(pageData.value[2].cid, 3, 10, 3, 0, 0, 0);
-}
-//模块4 美丽乡村
-async function getPageData4() {
-    await getPageData(pageData.value[3].cid, 2, 6, 4, 0, 0, 0);
-}
-//模块5 农民之家
-async function getPageData5() {
-    await getPageData(pageData.value[4].cid, 1, 10, 5, 0, 0, 0);
-}
-//模块6 农业天地
-async function getPageData6() {
-    await getPageData(pageData.value[5].cid, 3, 10, 6, 0, 0, 0);
-}
-//模块7 农村建设
-async function getPageData7() {
-    await getPageData(pageData.value[6].cid, 3, 10, 7, 0, 0, 0);
-}
-//模块8 高端资讯
-async function getPageData8() {
-    await getPageData(pageData.value[7].cid, 3, 13, 8, 0, 0, 0);
-}
+// async function getPageData1() {
+//     await getPageData(pageData.value[0].cid, 3, 10, 1, 0, 0, 0);
+// }
+// //模块2 典型经验
+// async function getPageData2() {
+//     await getPageData(pageData.value[1].cid, 2, 6, 2, 0, 0, 0);
+// }
+// //模块3 农业天地
+// async function getPageData3() {
+//     await getPageData(pageData.value[2].cid, 3, 10, 3, 0, 0, 0);
+// }
+// //模块4 美丽乡村
+// async function getPageData4() {
+//     await getPageData(pageData.value[3].cid, 2, 6, 4, 0, 0, 0);
+// }
+// //模块5 农民之家
+// async function getPageData5() {
+//     await getPageData(pageData.value[4].cid, 1, 10, 5, 0, 0, 0);
+// }
+// //模块6 农业天地
+// async function getPageData6() {
+//     await getPageData(pageData.value[5].cid, 3, 10, 6, 0, 0, 0);
+// }
+// //模块7 农村建设
+// async function getPageData7() {
+//     await getPageData(pageData.value[6].cid, 3, 10, 7, 0, 0, 0);
+// }
+// //模块8 高端资讯
+// async function getPageData8() {
+//     await getPageData(pageData.value[7].cid, 3, 13, 8, 0, 0, 0);
+// }
 // 注意,为了保持模块的数量,当前固定为8个
 // 所以这里的农业天地,合并了原来是下面的7号模块
 // 而原本是7号模块的地方现在变成了8号模块
@@ -1596,6 +1704,7 @@ function getTime(date, part, digits) {
                         .content_top_left {
                             float: left;
                             width: 350px;
+                            height: 484px;
 
                             .part3_photo_text {
                                 width: 350px;

+ 823 - 0
pages/[dir]/list-[id].vue

@@ -0,0 +1,823 @@
+<template>
+    <div id="newsList">
+        <!-- 页面头部 -->
+        <HomePageHead></HomePageHead>
+        <!-- 页面导航 -->
+        <HomePageNavigation></HomePageNavigation>
+        <!-- 广告1 -->
+        <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+
+        <!-- 二级导航列表 -->
+        <div class="nav2top" v-if="parent_name != ''"></div>
+        <div class="nav2" v-if="parent_name != ''">
+            <ul class="inner">
+                <li class="home">
+                    <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
+                </li>
+                <li class="titleList" v-for="(item, index) in secondNav" :key="index">
+                    <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html` }">
+                        <span class="nav2_title">{{ item.alias }}</span>
+                    </NuxtLink>
+                </li>
+            </ul>
+        </div>
+        <div class="nav2btm" v-if="parent_name != ''"></div>
+
+        <!-- 面包屑导航 -->
+        <div class="breadcrumb">
+            <div class="inner">
+                <span class="location">当前位置:</span>
+                <el-breadcrumb :separator-icon="ArrowRight">
+                    <el-breadcrumb-item>
+                        <NuxtLink to="/">首页</NuxtLink>
+                    </el-breadcrumb-item>
+                    <el-breadcrumb-item v-if="parent_name != ''">
+                        <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
+                    </el-breadcrumb-item>
+                    <el-breadcrumb-item>{{ name }}</el-breadcrumb-item>
+                </el-breadcrumb>
+            </div>
+        </div>
+        <!-- 资讯列表 -->
+        <div class="newsList">
+            <div class="inner">
+                <div class="innerLeft">
+                    <ul class="list">
+                        <li v-for="(item, index) in newsList" :key="index">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.alias">
+                                <span class="listTitle">{{ item.title }}</span>
+                                <span class="time">{{ getTime(item.updated_at, 'month', 1) }}</span>
+                            </NuxtLink>
+                        </li>
+                    </ul>
+                    <!-- 分页器 -->
+                    <div class="pagination" v-if="total">
+                        <el-pagination size="small" background layout="prev, pager, next" :total="total" class="mt-4"
+                            v-model:page-size="pageSize" prev-text="上一页" next-text="下一页" @change="changePage" />
+                    </div>
+                </div>
+                <div class="innerRight">
+                    <DetailHotNews></DetailHotNews>
+                    <DetailHotNews2></DetailHotNews2>
+                </div>
+            </div>
+        </div>
+
+        <!-- 列表页广告二 -->
+        <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
+
+        <!-- 页面底部 -->
+        <HomeFoot1></HomeFoot1>
+    </div>
+</template>
+
+<script setup>
+import { onMounted } from 'vue';
+import { ElBreadcrumb, ElBreadcrumbItem, ElPagination, ElMessage } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+
+// const nuxtApp = useNuxtApp();
+// const axios = nuxtApp.$axios;
+
+
+//1.获得路由id start ---------------------------------------->
+const route = useRoute();
+let articleId = 0;//路由id
+let pageNum = ref(2);
+let total = ref(1);
+let pageSize = ref(20);
+
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[1]; 
+//const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+//let routeId = 20 //排除路径错误可以打开这个
+
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'pinyin': targetSegment,
+    },
+});
+if(getRouteId.code == 200){
+    articleId = getRouteId.data.category_id
+}else{
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:",getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+
+//获得html前的数字
+// const pageUrl = segments[2]; 
+// const pageNumber = pageUrl.split('.')[0];
+// console.log("当前URL中的页码:")
+// console.log(pageNumber)//2
+// pageNum.value = parseInt(pageNumber);
+pageNum.value = parseInt(route.params.id);
+
+//1.获得路由id end ---------------------------------------->
+
+//2.页面数据 start ---------------------------------------->
+//2.2新闻列表
+const newsList = ref([]);
+let newslists = async () => {
+    const listData = await requestDataPromise('/web/getWebsiteArticleList', {
+        method: 'GET',
+        query: {
+            'page': page.value,
+            'pageSize': pageSize.value,
+            'catid': articleId
+        },
+    });
+    if (listData.code == 200) {
+        newsList.value = listData.data.rows;
+        total.value = listData.data.count;
+        console.log('news111111', newsList.value);
+
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取新闻列表")
+        console.log("后端错误反馈1111:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//获得列表
+newslists();
+
+//分页事件
+let changePage = (value) => {
+    console.log("当前页码", value);
+    page.value = value
+
+    //判断是否为真路径
+    // if (route.meta.isAlias) {
+    //     navigateTo(`${route.meta.path}${page.value}.html`)
+    // } else {
+    //     navigateTo(`/newsList/${articleId}?page=${page.value}`)
+    // }
+    newslists();
+}
+
+//2.3获得页面名称
+const name = ref('')
+let getPageName = async () => {
+    const pageName = await requestDataPromise('/web/getOneWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'catid': articleId
+        },
+    });
+    if (pageName.code == 200) {
+        name.value = pageName.data.alias
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:设置页面标题")
+        console.log("后端错误反馈:", pageName.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//获得列表
+getPageName();
+//2.页面数据 end ---------------------------------------->
+//3.二级栏目 start ---------------------------------------->
+//3.1通过id获取父栏目
+const parent_name = ref([]);
+const parent_id = ref([]);
+const parent_pinyin = ref("");
+let getParentNav = async () => {
+    const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
+        method: 'GET',
+        query: {
+            'catid': articleId
+        },
+    });
+    if (listData.code == 200) {
+        // console.log(111999)
+        // console.log(listData.data);
+        parent_name.value = listData.data.parent_name;
+        parent_id.value = listData.data.parent_id;
+        parent_pinyin.value = listData.data.parent_pinyin;
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取新闻列表")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+    getSecondNav();
+}
+//获得父级栏目详情
+getParentNav();
+
+// 3.2获取二级栏目
+const secondNav = ref([]);
+let getSecondNav = async () => {
+    const listData = await requestDataPromise('/web/getWebsiteModelCategory', {
+        method: 'GET',
+        query: {
+            'placeid': 1,
+            'pid': parent_id.value,
+            'num': 8,
+        },
+    });
+    console.log('listData', listData);
+    // secondNav.value = listData.data;
+
+    if (listData.code == 200) {
+        secondNav.value = listData.data;
+        console.log('secondNav', secondNav.value);
+    } else {
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+        console.log("错误位置:获取新闻列表")
+        console.log("后端错误反馈:", listData.message)
+        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    }
+}
+//3.二级栏目 end ---------------------------------------->
+
+//4.设置seo信息 start---------------------------------------->
+//4.1 设置seo信息
+const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
+    method: 'GET',
+    query: {
+        'catid': articleId
+    },
+});
+
+if (setData.code == 200) {
+    let seoTitle = setData.data.seo_title;
+    let seoDescription = setData.data.seo_description;
+    let seoKeywords = setData.data.seo_keywords;
+    let seoSuffix = setData.data.suffix;
+    let seoName = setData.data.website_name;
+
+    useSeoMeta({
+        title: seoTitle + "_" + seoName + "_" + seoSuffix,
+        meta: [
+            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
+            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
+        ]
+    });
+} else {
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:设置列表页面SEO数据")
+    console.log("后端错误反馈:", setData.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+//4.设置seo信息 end---------------------------------------->
+
+//5.广告 start---------------------------------------->
+let adImg1 = ref({});
+let adImg2 = ref({});
+
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_list_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+    console.log('adImg1', adImg1.value);
+
+
+
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_list_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---------------------------------------->
+
+
+</script>
+
+<style lang="less" scoped>
+#newsList {
+    width: 100%;
+    overflow: hidden;
+}
+
+.nav2top {
+    width: 1250px;
+    height: 3px;
+    margin: 0 auto;
+    background-color: #a01c0e;
+}
+
+.nav2btm {
+    width: 1200px;
+    height: 3px;
+    margin: 0 auto;
+    background-color: #a01c0e;
+}
+
+.nav2 {
+    width: 100%;
+    height: 48px;
+    background-color: #a01c0e;
+
+    .inner {
+        width: 1250px;
+        height: 48px;
+        line-height: 48px;
+        padding: 0 45px;
+        margin: 0 auto;
+        box-sizing: border-box;
+        display: flex;
+        // justify-content: space-between;
+
+        .titleList {
+            font-family: Microsoft YaHei, Microsoft YaHei;
+            font-weight: bold;
+            font-size: 14px;
+            color: #FFFFFF;
+
+            .nav2_title {
+                display: inline-block;
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: bold;
+                font-size: 14px;
+                color: #FFFFFF;
+            }
+
+            a {
+                padding: 0 38px;
+                color: #FFFFFF;
+                border-left: 1px solid #7E1C11;
+            }
+
+            //鼠标点击后的样式
+            .nav2_title_active {
+                display: inline-block;
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: bold;
+                font-size: 14px;
+                color: #FFFFFF;
+                border-bottom: 1px solid #FFFFFF;
+            }
+        }
+
+        .titleList:hover {
+            a {
+                color: #a01c0e;
+
+                .nav2_title {
+                    border-bottom: 1px solid #FFFFFF;
+                }
+            }
+        }
+
+        .home {
+            width: 100px;
+            font-family: Microsoft YaHei, Microsoft YaHei;
+            font-weight: bold;
+            font-size: 14px;
+            color: #F8ECD2;
+
+            a {
+                color: #F8ECD2;
+                margin-right: 39px;
+            }
+        }
+    }
+}
+
+//导航条
+.breadcrumb {
+    width: 100%;
+    height: 22px;
+    margin-bottom: 30px;
+    font-family: Microsoft YaHei, Microsoft YaHei;
+    font-weight: 400;
+    font-size: 20px;
+    color: #666666;
+    line-height: 23px;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+    margin-top: 40px;
+
+    :deep(.el-breadcrumb) {
+        display: inline-block;
+        vertical-align: -4px;
+    }
+
+    :deep(.el-breadcrumb__inner a),
+    :deep(.el-breadcrumb__inner.is-link) {
+        color: #666666;
+        font-weight: 400;
+        text-decoration: none;
+        transition: var(--el-transition-color);
+    }
+
+    span {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+
+    span:hover {
+        color: #666666;
+    }
+
+    .location {
+        margin-right: 20px;
+        width: 100px;
+        height: 22px;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+}
+
+// 资讯列表
+.newsList {
+    width: 100%;
+    // height: 675px;
+    overflow: hidden;
+    margin-bottom: 70px;
+
+    .inner {
+        width: 1200px;
+
+        .innerLeft,
+        .innerRight {
+            border-top: 1px solid #ccc;
+        }
+
+        .innerLeft {
+            width: 820px;
+            margin-right: 30px;
+
+            .list {
+                margin-bottom: 70px;
+
+                li {
+                    width: 820px;
+                    padding: 15px 0;
+
+                    a {
+                        display: flex;
+                        justify-content: space-between;
+                    }
+
+                    .listTitle {
+                        // float: left;
+                        display: inline-block;
+                        width: 486px;
+                        white-space: nowrap;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                        font-family: Microsoft YaHei, Microsoft YaHei;
+                        font-weight: 400;
+                        font-size: 20px;
+                        color: #333333;
+                        text-align: left;
+                        font-style: normal;
+                        text-transform: none;
+                    }
+
+                    .time {
+                        // float: right;
+                        font-family: Microsoft YaHei, Microsoft YaHei;
+                        font-weight: 400;
+                        font-size: 18px;
+                        color: #333333;
+                    }
+
+                }
+
+                >li:hover .listTitle {
+                    color: #a01c0e;
+                }
+
+                >li:nth-child(5n) {
+                    border-bottom: 1px solid #D9D9D9;
+                    padding-bottom: 30px;
+                }
+
+                >li:nth-child(5n+1) {
+                    span {
+                        font-weight: bold;
+                    }
+
+                    font-weight: bold;
+                    padding-top: 30px;
+
+                }
+            }
+
+            >.pagination {
+                width: 800px;
+                height: 34px;
+                margin-left: 141px;
+                display: flex;
+                justify-content: center;
+                margin: 0;
+
+                // 鼠标移入后字体颜色
+                .el-pagination::v-deep :hover {
+                    color: #a01c0e;
+                }
+
+                .el-pagination.is-background::v-deep .btn-next,
+                .el-pagination.is-background::v-deep .btn-prev {
+                    width: 70px;
+                    height: 34px;
+                    margin: 0px 10px;
+                    border-radius: 4px;
+                }
+
+                .el-pagination.is-background::v-deep .el-pager li {
+                    margin: 0px 10px;
+                    width: 38px;
+                    height: 34px;
+                    border-radius: 4px;
+                }
+
+                .el-pagination.is-background::v-deep .btn-next.is-active,
+                .el-pagination.is-background::v-deep .btn-prev.is-active,
+                .el-pagination.is-background::v-deep .el-pager li.is-active {
+                    background-color: #a01c0e;
+                    color: #fff;
+                }
+
+
+            }
+        }
+
+        .innerRight {
+            width: 350px;
+            height: 1242px;
+            border-bottom: 1px solid #ccc;
+            // height: 605px;
+        }
+    }
+}
+
+//资讯推荐
+.zixuntuijian {
+    width: 100%;
+    height: 290px;
+    margin-bottom: 70px;
+
+    .innerLeft {
+
+        // 左侧
+        .zixunLeft {
+            margin-right: 30px;
+        }
+
+        .zixunRight,
+        .zixunLeft {
+            float: left;
+            width: 380px;
+            height: 290px;
+
+            // 标题部分
+            >.title {
+                width: 380px;
+            }
+
+            >.title>h3 {
+                height: 36px;
+                font-family: Source Han Sans, Source Han Sans;
+                font-weight: bold;
+                font-size: 24px;
+                color: #000000;
+                line-height: 28px;
+                text-align: left;
+                font-style: normal;
+                text-transform: none;
+                border-bottom: 1px solid #a01c0e;
+
+            }
+
+            >.title>h3>span {
+                float: right;
+                width: 56px;
+                height: 20px;
+                line-height: 24px;
+                font-weight: 400;
+                font-size: 14px;
+                color: #999999;
+                font-style: normal;
+                text-transform: none;
+            }
+
+            .photo_text {
+
+                >li:first-child {
+                    width: 380px;
+                    height: 120px;
+                    margin-top: 20px;
+                    margin-bottom: 15px;
+                    position: relative;
+
+                    >img {
+                        float: left;
+                        width: 160px;
+                        height: 120px;
+                    }
+
+                    >div {
+                        float: left;
+                        width: 220px;
+                        height: 120px;
+                        padding-left: 15px;
+                        padding-top: 6px;
+                        box-sizing: border-box;
+                        background-color: #f6f6f6;
+
+
+                        >h5 {
+                            width: 200px;
+                            height: 54px;
+                            display: -webkit-box;
+                            -webkit-box-orient: vertical;
+                            -webkit-line-clamp: 2;
+                            overflow: hidden;
+                            text-overflow: ellipsis;
+                            word-break: break-all;
+                            font-family: Source Han Sans, Source Han Sans;
+                            font-weight: 500;
+                            font-size: 18px;
+                            color: #333333;
+                            line-height: 26px;
+                            text-align: left;
+                            font-style: normal;
+                            text-transform: none;
+                        }
+
+                        >p {
+                            width: 200px;
+                            height: 22px;
+                            line-height: 20px;
+                            position: absolute;
+                            bottom: 5px;
+                            right: 0;
+
+                            >span {
+                                display: inline-block;
+                                // width: 100px;
+                                height: 18px;
+                                font-family: Source Han Sans, Source Han Sans;
+                                font-weight: 400;
+                                font-size: 12px;
+                                color: #999999;
+                                text-align: left;
+                                line-height: 14px;
+                                font-style: normal;
+                                text-transform: none;
+                            }
+
+                            >span:last-child {
+                                // width: 90px;
+                                text-align: right;
+                                margin-left: 20px;
+                            }
+
+                        }
+                    }
+                }
+
+                >li {
+                    width: 380px;
+                    height: 25px;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                    font-family: PingFang SC, PingFang SC;
+                    font-weight: 500;
+                    font-size: 18px;
+                    color: #333333;
+                    line-height: 21px;
+                    text-align: left;
+                    font-style: normal;
+                    text-transform: none;
+                    margin-bottom: 10px;
+
+                    em {
+                        display: inline-block;
+                        width: 8px;
+                        height: 8px;
+                        border-radius: 8px;
+                        margin-right: 10px;
+                        background-color: #d9d9d9;
+                    }
+                }
+
+                >li:hover {
+                    color: #a01c0e;
+                }
+
+                >li:hover em {
+                    background-color: #a01c0e;
+                }
+            }
+        }
+    }
+
+    .innerRight {
+        width: 381px;
+        height: 290px;
+        background-color: #fbfbfb;
+
+        >.title {
+            width: 380px;
+            height: 40px;
+            line-height: 40px;
+            border-top: 1px solid #a01c0e;
+            border-bottom: 1px solid #e7e7e7;
+
+            >h4 {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: 400;
+                margin-left: 20px;
+                font-size: 20px;
+                color: #000000;
+                text-align: left;
+                font-style: normal;
+                text-transform: none;
+
+                >span {
+                    float: right;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-weight: 400;
+                    font-size: 14px;
+                    margin-right: 10px;
+                    color: #999999;
+                    text-align: left;
+                    font-style: normal;
+                    text-transform: none;
+                }
+            }
+
+        }
+
+        .rightList {
+            height: 540px;
+            margin-top: 20px;
+
+            >li {
+                height: 100px;
+                margin-bottom: 10px;
+
+                >img {
+                    width: 150px;
+                    height: 100px;
+                }
+
+                >p {
+                    width: 219px;
+                    height: 100px;
+                    padding-left: 12px;
+                    font-family: PingFang SC, PingFang SC;
+                    font-weight: 400;
+                    font-size: 16px;
+                    color: #333333;
+                    line-height: 22px;
+                    text-align: left;
+                    font-style: normal;
+                    text-transform: none;
+
+                }
+
+                >p:hover {
+                    box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.1);
+                }
+            }
+        }
+
+    }
+}
+</style>

+ 60 - 57
pages/speciaArticle/[id].vue → pages/about/[dir]/[dir]/[id].vue

@@ -14,9 +14,9 @@
                 <el-breadcrumb-item>
                     <NuxtLink to="/">首页</NuxtLink>
                 </el-breadcrumb-item>
-                <el-breadcrumb-item v-show="name">
+                <!-- <el-breadcrumb-item v-show="name">
                     <NuxtLink :to="{ path: `/primaryNavigation/${listid}`}">{{name}}</NuxtLink>
-                </el-breadcrumb-item>
+                </el-breadcrumb-item> -->
                 <el-breadcrumb-item>
                     {{ newsDetail.con_title }}
                 </el-breadcrumb-item>
@@ -40,12 +40,13 @@
                         导航列表
                     </li>
                     <li v-for="(item, index) in bottomMenu" :key="index">
-                        <NuxtLink :to="`/speciaArticle/${item.id}`" v-if="item.id == pageId && item.id != 7"
-                            class="active">
+                        <NuxtLink :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
+                            v-if="item.id == pageId && item.id != 7" class="active">
                             {{ item.name }}
                         </NuxtLink>
-                        <NuxtLink :to="`/speciaArticle/${item.id}`" v-else-if="item.id != pageId && item.id != 7">
-                            {{item.name }}
+                        <NuxtLink :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
+                            v-else-if="item.id != pageId && item.id != 7">
+                            {{ item.name }}
                         </NuxtLink>
                     </li>
                 </ul>
@@ -69,60 +70,61 @@ import { ref, onMounted } from 'vue';
 
 //获得跳转过来的id
 const route = useRoute();
-const articleId = route.params.id; //获得该页面的id
-const listid = route.query.listId; //获得该页面的id
-const name = route.query.listName; //获得该页面的id
-const pageId = route.params.id; //获得该页面的id
-const routeHref = route.href;
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+//const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+
+let articleId;
+let pageId;
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'foot_pinyin': targetSegment,
+    },
+});
+if(getRouteId.code == 200){
+    articleId = getRouteId.data.id;
+    pageId = getRouteId.data.id;
+}else{
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:",getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+
 //1.页面依赖 end ---------------------------------------->
 
 //2.页面数据 start ---------------------------------------->
 //广告列表
 let adImg1 = ref([]);
 let adImg2 = ref([]);
-// async function getAdData(){
-//     const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'PAGE'}});
-//     adList.value = adData.data;
-//     if(adData.code==200){
-//         for(let item of adData.data){
-//             if(item.ad_tag == 'PAGE_0001'){
-//                 adImg1.value = item;
-//             }
-//             if(item.ad_tag == 'PAGE_0002'){
-//                 adImg2.value = item;
-//             }
-//         }
-//     }else{
-//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-//         console.log("错误位置:获取详情页广告列表")
-//         console.log("后端错误反馈:",adData.message)
-//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-//     }
-// }
-// getAdData();
 
 //获取详情
 const newsDetail = 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'
         },
     });
     console.log('newsDetail.value', mkdata.data);
 
     newsDetail.value = mkdata.data;
     console.log('newsDetail.value', newsDetail.value);
-    
+
 }
 getPageData();
 
 //获得底部导航
 const bottomMenu = ref([]);
 async function getPageMenu() {
-    const mkdata =  await requestDataPromise('/web/getWebsiteFooterCategory', {
+    const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
         method: 'GET',
         query: {},
     });
@@ -132,7 +134,7 @@ getPageMenu();
 //2.页面数据 end ---------------------------------------->
 //4.设置seo信息 start---------------------------------------->
 //4.1 设置seo信息
-const setData =  await requestDataPromise('/web/getWebsiteFootInfo', {
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
     method: 'GET',
     query: {},
 });
@@ -146,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
@@ -166,7 +168,7 @@ onMounted(async ()  => {
     });
     const resultAd1 = await responseAd1.json();
     adImg1.value = resultAd1.data[0];
-    
+
     //广告2
     let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_page_0002`
     const responseAd2 = await fetch(url2, {
@@ -263,13 +265,14 @@ onMounted(async ()  => {
             .headImg {
                 width: 1086px;
                 height: 10px;
-                background: url("../../public/special/head11.png") no-repeat 100% 100%;
+                // background: url("../../public/special/head11.png") no-repeat 100% 100%;
+                background: url("../../../../public/special/head11.png") no-repeat 100% 100%;
             }
 
             .footImg {
                 width: 1086px;
                 height: 7px;
-                background: url("../../public/special/foot01.png") no-repeat 100% 100%;
+                background: url("../../../../public/special/foot01.png") no-repeat 100% 100%;
             }
 
             .innerDetail1 {
@@ -278,13 +281,13 @@ onMounted(async ()  => {
                 padding: 30px 50px 40px;
                 box-sizing: border-box;
                 border-left: 1px solid #DBBE9E;
-                background: url("../../public/special/mid01.png") repeat-y 100% 100%;
+                background: url("../../../../public/special/mid01.png") repeat-y 100% 100%;
             }
 
-           .leftBottom::v-deep {
+            .leftBottom::v-deep {
                 font-size: 16px;
-                line-height: 40px;  
-           }
+                line-height: 40px;
+            }
         }
 
 
@@ -295,17 +298,17 @@ onMounted(async ()  => {
             top: 3px;
             left: -155px;
 
-            .rightMenuTitle {
-                width: 279px;
-                height: 69px;
-                font-size: 22px;
-                font-weight: bold;
-                line-height: 58px;
-                text-align: center;
-                color: #fff;
-                background: url("../../public/special/projectMoreTitle.png") no-repeat;
-                margin-bottom: 30px;
-            }
+            // .rightMenuTitle {
+            //     width: 279px;
+            //     height: 69px;
+            //     font-size: 22px;
+            //     font-weight: bold;
+            //     line-height: 58px;
+            //     text-align: center;
+            //     color: #fff;
+            //     background: url("../../../../public/special/projectMoreTitle.png") no-repeat;
+            //     margin-bottom: 30px;
+            // }
 
             ul {
                 li {

+ 350 - 0
pages/about/[dir]/index.html.vue

@@ -0,0 +1,350 @@
+<template>
+    <!-- 页面头部 -->
+    <HomePageHead></HomePageHead>
+
+    <HomePageNavigation></HomePageNavigation>
+    <!-- 广告位 1 -->
+    <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+
+    <!-- 面包屑导航 -->
+    <div class="breadcrumb">
+        <div class="inner">
+            <span class="location">当前位置:</span>
+            <el-breadcrumb :separator-icon="ArrowRight">
+                <el-breadcrumb-item>
+                    <NuxtLink to="/">首页</NuxtLink>
+                </el-breadcrumb-item>
+                <el-breadcrumb-item>
+                    {{ newsDetail.con_title }}
+                </el-breadcrumb-item>
+            </el-breadcrumb>
+        </div>
+    </div>
+
+    <!-- 资讯列表 -->
+    <div class="newsDetail">
+        <div class="inner">
+            <div class="innerDetail">
+                <div class="headImg"></div>
+                <div class="innerDetail1">
+                    <div class="leftBottom" v-html="newsDetail.content"></div>
+                </div>
+                <div class="footImg"></div>
+            </div>
+            <div class="innerLeft">
+                <ul>
+                    <li>
+                        导航列表
+                    </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">
+                            {{ item.name }}
+                        </NuxtLink>
+                        <NuxtLink :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
+                            v-else-if="item.id != pageId && item.id != 7">
+                            {{ item.name }}
+                        </NuxtLink>
+                    </li>
+                </ul>
+            </div>
+            <div style="clear: both;"></div>
+        </div>
+    </div>
+
+    <!-- 广告位 2 -->
+    <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
+
+    <!-- 页面底部 -->
+    <HomeFoot1></HomeFoot1>
+</template>
+
+<script setup>
+//1.页面依赖 start ---------------------------------------->
+import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
+import { ArrowRight } from '@element-plus/icons-vue'
+import { ref, onMounted } from 'vue';
+
+//获得跳转过来的id
+const route = useRoute();
+//获得当前的完整路径
+const fullPath = route.path;
+//拆分,取出来中间这一段,然后提取数字部分
+const segments = fullPath.split('/'); 
+const targetSegment = segments[2]; 
+//const numberPart = targetSegment.match(/\d+$/)?.[0]; 
+
+let articleId;
+let pageId;
+//通过导航路径反向查询导航id
+const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
+    method: 'GET',
+    query: {
+        'foot_pinyin': targetSegment,
+    },
+});
+if(getRouteId.code == 200){
+    articleId = getRouteId.data.id;
+    pageId = getRouteId.data.id;
+}else{
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    console.log("错误位置:通过url路径查询导航池id")
+    console.log("后端错误反馈:",getRouteId.message)
+    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+}
+
+//1.页面依赖 end ---------------------------------------->
+
+//2.页面数据 start ---------------------------------------->
+//广告列表
+let adImg1 = ref([]);
+let adImg2 = ref([]);
+
+//获取详情
+const newsDetail = ref({})
+async function getPageData() {
+    const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
+        method: 'GET',
+        query: {
+            'fcat_id': articleId,
+            'type': '0'
+        },
+    });
+    console.log('newsDetail.value', mkdata.data);
+
+    newsDetail.value = mkdata.data;
+    console.log('newsDetail.value', newsDetail.value);
+
+}
+getPageData();
+
+//获得底部导航
+const bottomMenu = ref([]);
+async function getPageMenu() {
+    const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
+        method: 'GET',
+        query: {},
+    });
+    bottomMenu.value = mkdata.data;
+}
+getPageMenu();
+//2.页面数据 end ---------------------------------------->
+//4.设置seo信息 start---------------------------------------->
+//4.1 设置seo信息
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
+    method: 'GET',
+    query: {},
+});
+
+let seoTitle = setData.data.website_head.title;
+let seoDescription = setData.data.website_head.description;
+let seoKeywords = setData.data.website_head.keywords;
+let seoSuffix = setData.data.website_head.suffix;
+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 }
+    ]
+});
+//4.设置seo信息 end---------------------------------------->
+
+onMounted(async () => {
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+    //广告1
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_page_0001`
+    const responseAd1 = await fetch(url, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd1 = await responseAd1.json();
+    adImg1.value = resultAd1.data[0];
+
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_page_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];
+})
+
+</script>
+
+<style lang="less" scoped>
+//导航条
+.breadcrumb {
+    width: 1200px;
+    margin: 0 auto;
+    height: 22px;
+    padding-bottom: 40px;
+    margin-top: 40px;
+    margin-bottom: 60px;
+    border-bottom: 1px solid #d9d9d9;
+    font-family: Microsoft YaHei, Microsoft YaHei;
+    font-weight: 400;
+    font-size: 20px;
+    color: #666666;
+    line-height: 23px;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+
+    .el-breadcrumb::v-deep {
+        display: inline-block;
+        vertical-align: -4px;
+    }
+
+    /deep/.el-breadcrumb__inner a,
+    /deep/.el-breadcrumb__inner.is-link {
+        color: #666666;
+        font-weight: 400;
+        text-decoration: none;
+        transition: var(--el-transition-color);
+    }
+
+    span {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+
+    span:hover {
+        color: #666666;
+    }
+
+    .location {
+        margin-right: 20px;
+        width: 100px;
+        height: 22px;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-weight: 400;
+        font-size: 20px;
+        color: #666666;
+        line-height: 23px;
+        text-align: left;
+        font-style: normal;
+        text-transform: none;
+    }
+}
+
+// 资讯列表
+.newsDetail {
+    width: 100%;
+    // height: 1400px;
+    // margin-bottom: 70px;
+
+    .inner {
+        width: 1200px;
+        font-size: 16px;
+        position: relative;
+
+        .innerDetail {
+            width: 1080px;
+            margin: 0 auto;
+            margin-bottom: 60px;
+
+            .headImg {
+                width: 1086px;
+                height: 10px;
+                background: url("../../../public/special/head11.png") no-repeat 100% 100%;
+            }
+
+            .footImg {
+                width: 1086px;
+                height: 7px;
+                background: url("../../../public/special/foot01.png") no-repeat 100% 100%;
+            }
+
+            .innerDetail1 {
+                width: 1086px;
+                margin: 0 auto;
+                padding: 30px 50px 40px;
+                box-sizing: border-box;
+                border-left: 1px solid #DBBE9E;
+                background: url("../../../public/special/mid01.png") repeat-y 100% 100%;
+            }
+
+            .leftBottom::v-deep {
+                font-size: 16px;
+                line-height: 40px;
+            }
+        }
+
+
+
+        .innerLeft {
+            width: 279px;
+            position: absolute;
+            top: 3px;
+            left: -155px;
+
+            // .rightMenuTitle {
+            //     width: 279px;
+            //     height: 69px;
+            //     font-size: 22px;
+            //     font-weight: bold;
+            //     line-height: 58px;
+            //     text-align: center;
+            //     color: #fff;
+            //     background: url("../../../../public/special/projectMoreTitle.png") no-repeat;
+            //     margin-bottom: 30px;
+            // }
+
+            ul {
+                li {
+                    a {
+                        display: inline-block;
+                        width: 144px;
+                        height: 60px;
+                        line-height: 60px;
+                        text-align: center;
+                        background-color: #F4F4F4;
+                        border-top: 1px #fff solid;
+                        font-family: Microsoft YaHei, Microsoft YaHei;
+                        font-weight: 400;
+                        font-size: 16px;
+                        color: #000000;
+                    }
+                }
+
+                li:nth-child(1) {
+                    width: 144px;
+                    height: 60px;
+                    line-height: 60px;
+                    text-align: center;
+                    background-color: #F4F4F4;
+                    border-top: 1px #fff solid;
+                    font-family: Microsoft YaHei, Microsoft YaHei;
+                    font-weight: 400;
+                    font-size: 16px;
+                    color: #a01c0e;
+                }
+
+            }
+
+            .active {
+                // border-left: 0;
+                // border: 1px solid #028E21;
+                background: #a01c0e;
+                color: #fff;
+            }
+        }
+    }
+}
+</style>

+ 145 - 354
pages/index.vue

@@ -12,22 +12,14 @@
                 <div class="toutiao" v-if="tabsData == 1">
                     <div class="xwtt">
                         <span class="ttlogo">新闻头条</span>
-                        <NuxtLink :to="headlinelist[0].linkurl" v-if="headlinelist[0].islink == 1"
-                            :title="headlinelist[0].title">
-                            <span class="tttitle">{{ headlinelist[0].title }}</span>
-                        </NuxtLink>
-                        <NuxtLink :to="`/newsDetail/${headlinelist[0].id}`" v-if="headlinelist[0].islink == 0"
-                            :title="headlinelist[0].title">
+                        <NuxtLink :href="getLinkPathDetail(headlinelist[0])" :title="headlinelist[0].title"
+                            :target="headlinelist[0].islink == 1 ? '_blank' : '_self'">
                             <span class="tttitle">{{ headlinelist[0].title }}</span>
                         </NuxtLink>
                     </div>
                     <div class="toutiao1">
-                        <NuxtLink :to="headlinelist[1].linkurl" v-if="headlinelist[1].islink == 1"
-                            :title="headlinelist[1].title">
-                            <span class="tttitle">{{ headlinelist[1].title }}</span>
-                        </NuxtLink>
-                        <NuxtLink :to="`/newsDetail/${headlinelist[1].id}`" v-if="headlinelist[1].islink == 0"
-                            :title="headlinelist[1].title">
+                        <NuxtLink :href="getLinkPathDetail(headlinelist[1])" :title="headlinelist[1].title"
+                            :target="headlinelist[1].islink == 1 ? '_blank' : '_self'">
                             <span class="tttitle">{{ headlinelist[1].title }}</span>
                         </NuxtLink>
                     </div>
@@ -35,22 +27,14 @@
                 <div class="toutiao" v-if="tabsData == 2">
                     <div class="xwtt">
                         <span class="ttlogo">新闻头条</span>
-                        <NuxtLink :to="headlinelist[2].linkurl" v-if="headlinelist[2].islink == 1"
-                            :title="headlinelist[2].title">
-                            <span class="tttitle">{{ headlinelist[2].title }}</span>
-                        </NuxtLink>
-                        <NuxtLink :to="`/newsDetail/${headlinelist[2].id}`" v-if="headlinelist[2].islink == 0"
-                            :title="headlinelist[2].title">
+                        <NuxtLink :href="getLinkPathDetail(headlinelist[2])" :title="headlinelist[2].title"
+                            :target="headlinelist[2].islink == 1 ? '_blank' : '_self'">
                             <span class="tttitle">{{ headlinelist[2].title }}</span>
                         </NuxtLink>
                     </div>
                     <div class="toutiao1">
-                        <NuxtLink :to="headlinelist[3].linkurl" v-if="headlinelist[3].islink == 1"
-                            :title="headlinelist[3].title">
-                            <span class="tttitle">{{ headlinelist[3].title }}</span>
-                        </NuxtLink>
-                        <NuxtLink :to="`/newsDetail/${headlinelist[3].id}`" v-if="headlinelist[3].islink == 0"
-                            :title="headlinelist[3].title">
+                        <NuxtLink :href="getLinkPathDetail(headlinelist[3])" :title="headlinelist[3].title"
+                            :target="headlinelist[3].islink == 1 ? '_blank' : '_self'">
                             <span class="tttitle">{{ headlinelist[3].title }}</span>
                         </NuxtLink>
                     </div>
@@ -58,22 +42,14 @@
                 <div class="toutiao" v-if="tabsData == 3">
                     <div class="xwtt">
                         <span class="ttlogo">新闻头条</span>
-                        <NuxtLink :to="headlinelist[4].linkurl" v-if="headlinelist[4].islink == 1"
-                            :title="headlinelist[4].title">
-                            <span class="tttitle">{{ headlinelist[4].title }}</span>
-                        </NuxtLink>
-                        <NuxtLink :to="`/newsDetail/${headlinelist[4].id}`" v-if="headlinelist[4].islink == 0"
-                            :title="headlinelist[4].title">
+                        <NuxtLink :href="getLinkPathDetail(headlinelist[4])" :title="headlinelist[4].title"
+                            :target="headlinelist[4].islink == 1 ? '_blank' : '_self'">
                             <span class="tttitle">{{ headlinelist[4].title }}</span>
                         </NuxtLink>
                     </div>
                     <div class="toutiao1">
-                        <NuxtLink :to="headlinelist[5].linkurl" v-if="headlinelist[5].islink == 1"
-                            :title="headlinelist[5].title">
-                            <span class="tttitle">{{ headlinelist[5].title }}</span>
-                        </NuxtLink>
-                        <NuxtLink :to="`/newsDetail/${headlinelist[5].id}`" v-if="headlinelist[5].islink == 0"
-                            :title="headlinelist[5].title">
+                        <NuxtLink :href="getLinkPathDetail(headlinelist[5])" :title="headlinelist[5].title"
+                            :target="headlinelist[5].islink == 1 ? '_blank' : '_self'">
                             <span class="tttitle">{{ headlinelist[5].title }}</span>
                         </NuxtLink>
                     </div>
@@ -111,10 +87,8 @@
                     </div>
                     <ul class="leftContent">
                         <li class="context" v-for="(item, index) in boxData1" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                {{ item.title }}
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 {{ item.title }}
                             </NuxtLink>
                         </li>
@@ -134,11 +108,8 @@
                             </h2>
                             <ul class="navContext">
                                 <li class="Contextlist" v-for="(item, index) in boxData2" :key="index">
-                                    <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                        {{ item.title }}
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                        :title="item.title">
+                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                         {{ item.title }}
                                     </NuxtLink>
                                 </li>
@@ -154,11 +125,8 @@
                             </h2>
                             <ul class="navContext">
                                 <li class="Contextlist" v-for="(item, index) in boxData3" :key="index">
-                                    <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                        {{ item.title }}
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                        :title="item.title">
+                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                         {{ item.title }}
                                     </NuxtLink>
                                 </li>
@@ -252,25 +220,16 @@
                     <div class="part1_content">
                         <div class="context_left">
                             <div class="top" v-if="boxData4data1.length > 0">
-                                <NuxtLink :to="boxData4data1[0].linkurl" v-if="boxData4data1[0].islink == 1"
-                                    :title="boxData4data1[0].title">
-                                    <img :src="boxData4data1[0].imgurl" alt="">
-                                    <span class="title1">{{ boxData4data1[0].title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${boxData4data1[0].id}`" v-if="boxData4data1[0].islink == 0"
-                                    :title="boxData4data1[0].title">
+                                <NuxtLink :href="getLinkPathDetail(boxData4data1[0])" :title="boxData4data1[0].title"
+                                    :target="boxData4data1[0].islink == 1 ? '_blank' : '_self'">
                                     <img :src="boxData4data1[0].imgurl" alt="item.title">
                                     <span class="title1">{{ boxData4data1[0].title }}</span>
                                 </NuxtLink>
                             </div>
                             <div class="bottom_context">
                                 <div class="bottom_left" v-for="(item, index) in boxData4data2" :key="index">
-                                    <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                        <img :src="item.imgurl" alt="" class="">
-                                        <span class="title2">{{ item.title }}</span>
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                        :title="item.title">
+                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                         <img :src="item.imgurl" alt="item.title" class="">
                                         <span class="title2">{{ item.title }}</span>
                                     </NuxtLink>
@@ -280,11 +239,8 @@
                         <div class="context_right">
                             <ul class="rightContent">
                                 <li class="context1" v-for="(item, index) in boxData4" :key="index">
-                                    <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                        {{ item.title }}
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                        :title="item.title">
+                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                         {{ item.title }}
                                     </NuxtLink>
                                 </li>
@@ -324,11 +280,8 @@
                     </div>
                     <div class="part1_right_content" v-if="tabsData1 == 1">
                         <div class="part1_right_content_top" v-for="(item, index) in boxData5" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" alt="">
-                                <span class="content_top_title2">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" alt="">
                                 <span class="content_top_title2">{{ item.title }}</span>
                             </NuxtLink>
@@ -338,10 +291,8 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="sec_title">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="sec_content">{{ item.title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="sec_content">{{ item.title }}</span>
                                 </NuxtLink>
                             </li>
@@ -349,11 +300,8 @@
                     </div>
                     <div class="part1_right_content" v-if="tabsData1 == 2">
                         <div class="part1_right_content_top" v-for="(item, index) in boxData6" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" alt="">
-                                <span class="content_top_title2">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" alt="">
                                 <span class="content_top_title2">{{ item.title }}</span>
                             </NuxtLink>
@@ -363,10 +311,8 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="sec_title">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="sec_content">{{ item.title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="sec_content">{{ item.title }}</span>
                                 </NuxtLink>
                             </li>
@@ -374,11 +320,8 @@
                     </div>
                     <div class="part1_right_content" v-if="tabsData1 == 3">
                         <div class="part1_right_content_top" v-for="(item, index) in boxData7" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" alt="">
-                                <span class="content_top_title2">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" alt="">
                                 <span class="content_top_title2">{{ item.title }}</span>
                             </NuxtLink>
@@ -388,10 +331,8 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="sec_title">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="sec_content">{{ item.title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="sec_content">{{ item.title }}</span>
                                 </NuxtLink>
                             </li>
@@ -425,11 +366,8 @@
                         <div class="part2_content_left">
                             <ul class="content_a">
                                 <li class="context111" v-for="(item, index) in boxData8" :key="index">
-                                    <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                        {{ item.title }}
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                        :title="item.title">
+                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                         {{ item.title }}
                                     </NuxtLink>
                                 </li>
@@ -437,25 +375,16 @@
                         </div>
                         <div class="part2_content_right">
                             <div class="right_top" v-if="boxData8data1.length > 0">
-                                <NuxtLink :to="boxData8data1[0].linkurl" v-if="boxData8data1[0].islink == 1"
-                                    :title="boxData8data1[0].title">
-                                    <img :src="boxData8data1[0].imgurl" alt="">
-                                    <span class="title11">{{ boxData8data1[0].title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${boxData8data1[0].id}`" v-if="boxData8data1[0].islink == 0"
-                                    :title="boxData8data1[0].title">
+                                <NuxtLink :href="getLinkPathDetail(boxData8data1[0])" :title="boxData8data1[0].title"
+                                    :target="boxData8data1[0].islink == 1 ? '_blank' : '_self'">
                                     <img :src="boxData8data1[0].imgurl" alt="item.title">
-                                    <span class="title11">{{ boxData4data1[0].title }}</span>
+                                    <span class="title11">{{ boxData8data1[0].title }}</span>
                                 </NuxtLink>
                             </div>
                             <div class="right_bottom">
                                 <div class="bottom_left" v-for="(item, index) in boxData8data2" :key="index">
-                                    <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                        <img :src="item.imgurl" :alt="item.title">
-                                        <span class="title22">{{ item.title }}</span>
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                        :title="item.title">
+                                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                        :target="item.islink == 1 ? '_blank' : '_self'">
                                         <img :src="item.imgurl" :alt="item.title">
                                         <span class="title22">{{ item.title }}</span>
                                     </NuxtLink>
@@ -496,11 +425,8 @@
                     </div>
                     <div class="part2_right_content" v-if="tabsData2 == 1">
                         <div class="part2_right_content_top" v-for="(item, index) in boxData9" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" :alt="item.title">
-                                <span class="content_top_title22">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" :alt="item.title">
                                 <span class="content_top_title22">{{ item.title }}</span>
                             </NuxtLink>
@@ -510,10 +436,8 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="sec_title_part2">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="sec_content_part2">{{ item.title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="sec_content_part2">{{ item.title }}</span>
                                 </NuxtLink>
                             </li>
@@ -521,11 +445,8 @@
                     </div>
                     <div class="part2_right_content" v-if="tabsData2 == 2">
                         <div class="part2_right_content_top" v-for="(item, index) in boxData10" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" :alt="item.title">
-                                <span class="content_top_title22">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" :alt="item.title">
                                 <span class="content_top_title22">{{ item.title }}</span>
                             </NuxtLink>
@@ -535,10 +456,8 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="sec_title_part2">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="sec_content_part2">{{ item.title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="sec_content_part2">{{ item.title }}</span>
                                 </NuxtLink>
                             </li>
@@ -546,11 +465,8 @@
                     </div>
                     <div class="part2_right_content" v-if="tabsData2 == 3">
                         <div class="part2_right_content_top" v-for="(item, index) in boxData11" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" :alt="item.title">
-                                <span class="content_top_title22">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" :alt="item.title">
                                 <span class="content_top_title22">{{ item.title }}</span>
                             </NuxtLink>
@@ -560,10 +476,8 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="sec_title_part2">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="sec_content_part2">{{ item.title }}</span>
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="sec_content_part2">{{ item.title }}</span>
                                 </NuxtLink>
                             </li>
@@ -590,21 +504,16 @@
                             <em></em>
                         </h2>
                         <div class="part3_photo_text" v-for="(item, index) in boxData12data1" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" :alt="item.title">
-                                <span class="part3_text">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" :alt="item.title">
                                 <span class="part3_text">{{ item.title }}</span>
                             </NuxtLink>
                         </div>
                         <ul class="part3_content">
                             <li class="part3_contentList" v-for="(item, index) in boxData12" :key="index">
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    {{ item.title }}
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     {{ item.title }}
                                 </NuxtLink>
                             </li>
@@ -620,21 +529,16 @@
                             <em></em>
                         </h2>
                         <div class="part3_photo_text" v-for="(item, index) in boxData13data1" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <img :src="item.imgurl" :alt="item.title">
-                                <span class="part3_text">{{ item.title }}</span>
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <img :src="item.imgurl" :alt="item.title">
                                 <span class="part3_text">{{ item.title }}</span>
                             </NuxtLink>
                         </div>
                         <ul class="part3_content">
                             <li class="part3_contentList" v-for="(item, index) in boxData13" :key="index">
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    {{ item.title }}
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     {{ item.title }}
                                 </NuxtLink>
                             </li>
@@ -715,33 +619,24 @@
                 <div class="part4_left">
                     <ul class="part4_left_top">
                         <li class="left_top_newsList" v-for="item in boxData14data1">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                {{ item.title }}
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 {{ item.title }}
                             </NuxtLink>
                         </li>
                     </ul>
                     <ul class="part4_left_bottom">
                         <li class="left_btm_newsList" v-for="item in boxData14data2">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                {{ item.title }}
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 {{ item.title }}
                             </NuxtLink>
                         </li>
                     </ul>
                 </div>
                 <div class="part4_right" v-for="(item, index) in boxData14" :key="index">
-                    <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                        <img :src="item.imgurl" alt="">
-                        <span class="part4_right_title">
-                            {{ item.title }}
-                        </span>
-                    </NuxtLink>
-                    <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                        :target="item.islink == 1 ? '_blank' : '_self'">
                         <img :src="item.imgurl" alt="">
                         <span class="part4_right_title">
                             {{ item.title }}
@@ -782,12 +677,8 @@
                             <div class="part5_left_content_top" v-if="tabsData3 == 1">
                                 <div class="content_top_left">
                                     <div class="part5_photo_text" v-for="(item, index) in boxData15" :key="index">
-                                        <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                            <img :src="item.imgurl" alt="">
-                                            <span class="part5_text">{{ item.title }}</span>
-                                        </NuxtLink>
-                                        <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                            :title="item.title">
+                                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                            :target="item.islink == 1 ? '_blank' : '_self'">
                                             <img :src="item.imgurl" alt="">
                                             <span class="part5_text">{{ item.title }}</span>
                                         </NuxtLink>
@@ -795,11 +686,8 @@
                                     </div>
                                     <ul class="part5_content">
                                         <li class="part5_content_list" v-for="item in boxData15data1">
-                                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                                {{ item.title }}
-                                            </NuxtLink>
-                                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                                :title="item.title">
+                                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                                :target="item.islink == 1 ? '_blank' : '_self'">
                                                 {{ item.title }}
                                             </NuxtLink>
                                         </li>
@@ -814,12 +702,8 @@
                                                 <span class="day">{{ getTime(item.updated_at, 'month', 1) }}</span>
                                             </div>
                                             <div class="time_left_content">
-                                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1"
-                                                    :title="item.title">
-                                                    {{ item.title }}
-                                                </NuxtLink>
-                                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                                    :title="item.title">
+                                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                                     {{ item.title }}
                                                 </NuxtLink>
                                             </div>
@@ -830,12 +714,8 @@
                             <div class="part5_left_content_top" v-if="tabsData3 == 2">
                                 <div class="content_top_left">
                                     <div class="part5_photo_text" v-for="(item, index) in boxData16" :key="index">
-                                        <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                            <img :src="item.imgurl" alt="">
-                                            <span class="part5_text">{{ item.title }}</span>
-                                        </NuxtLink>
-                                        <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                            :title="item.title">
+                                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                            :target="item.islink == 1 ? '_blank' : '_self'">
                                             <img :src="item.imgurl" alt="">
                                             <span class="part5_text">{{ item.title }}</span>
                                         </NuxtLink>
@@ -843,11 +723,8 @@
                                     </div>
                                     <ul class="part5_content">
                                         <li class="part5_content_list" v-for="item in boxData16data1">
-                                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                                {{ item.title }}
-                                            </NuxtLink>
-                                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                                :title="item.title">
+                                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                                :target="item.islink == 1 ? '_blank' : '_self'">
                                                 {{ item.title }}
                                             </NuxtLink>
                                         </li>
@@ -862,12 +739,8 @@
                                                 <span class="day">{{ getTime(item.updated_at, 'month', 1) }}</span>
                                             </div>
                                             <div class="time_left_content">
-                                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1"
-                                                    :title="item.title">
-                                                    {{ item.title }}
-                                                </NuxtLink>
-                                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                                    :title="item.title">
+                                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                                     {{ item.title }}
                                                 </NuxtLink>
                                             </div>
@@ -901,25 +774,17 @@
                         <div class="part5_left_content1" v-if="tabsData4 == 1">
                             <div class="content_bottom_left">
                                 <div class="content_top" v-if="boxData17data1.length > 0">
-                                    <NuxtLink :to="boxData17data1[0].linkurl" v-if="boxData17data1[0].islink == 1"
-                                        :title="boxData17data1[0].title">
-                                        <img :src="boxData17data1[0].imgurl" alt="">
-                                        <span class="part5_text">{{ boxData17data1[0].title }}</span>
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${boxData17data1[0].id}`"
-                                        v-if="boxData17data1[0].islink == 0" :title="boxData17data1[0].title">
+                                    <NuxtLink :href="getLinkPathDetail(boxData17data1[0])"
+                                        :title="boxData17data1[0].title"
+                                        :target="boxData17data1[0].islink == 1 ? '_blank' : '_self'">
                                         <img :src="boxData17data1[0].imgurl" alt="item.title">
                                         <span class="part5_text">{{ boxData17data1[0].title }}</span>
                                     </NuxtLink>
                                 </div>
                                 <div class="content_bottom">
                                     <div class="content_bottom_1" v-for="(item, index) in boxData17data2" :key="index">
-                                        <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                            <img :src="item.imgurl" alt="">
-                                            <span class="part5_text">{{ item.title }}</span>
-                                        </NuxtLink>
-                                        <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                            :title="item.title">
+                                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                            :target="item.islink == 1 ? '_blank' : '_self'">
                                             <img :src="item.imgurl" alt="">
                                             <span class="part5_text">{{ item.title }}</span>
                                         </NuxtLink>
@@ -929,11 +794,8 @@
                             <div class="content_bottom_right">
                                 <ul class="bottom_content_1">
                                     <li class="bottom_content_list" v-for="(item, index) in boxData17" :key="index">
-                                        <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                            {{ item.title }}
-                                        </NuxtLink>
-                                        <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                            :title="item.title">
+                                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                            :target="item.islink == 1 ? '_blank' : '_self'">
                                             {{ item.title }}
                                         </NuxtLink>
                                     </li>
@@ -943,25 +805,17 @@
                         <div class="part5_left_content1" v-if="tabsData4 == 2">
                             <div class="content_bottom_left">
                                 <div class="content_top" v-if="boxData18data1.length > 0">
-                                    <NuxtLink :to="boxData18data1[0].linkurl" v-if="boxData18data1[0].islink == 1"
-                                        :title="boxData18data1[0].title">
-                                        <img :src="boxData18data1[0].imgurl" alt="">
-                                        <span class="part5_text">{{ boxData18data1[0].title }}</span>
-                                    </NuxtLink>
-                                    <NuxtLink :to="`/newsDetail/${boxData18data1[0].id}`"
-                                        v-if="boxData18data1[0].islink == 0" :title="boxData18data1[0].title">
+                                    <NuxtLink :href="getLinkPathDetail(boxData18data1[0])"
+                                        :title="boxData18data1[0].title"
+                                        :target="boxData18data1[0].islink == 1 ? '_blank' : '_self'">
                                         <img :src="boxData18data1[0].imgurl" alt="item.title">
-                                        <span class="part5_text">{{ boxData17data1[0].title }}</span>
+                                        <span class="part5_text">{{ boxData18data1[0].title }}</span>
                                     </NuxtLink>
                                 </div>
                                 <div class="content_bottom">
                                     <div class="content_bottom_1" v-for="(item, index) in boxData18data2" :key="index">
-                                        <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                            <img :src="item.imgurl" alt="">
-                                            <span class="part5_text">{{ item.title }}</span>
-                                        </NuxtLink>
-                                        <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                            :title="item.title">
+                                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                            :target="item.islink == 1 ? '_blank' : '_self'">
                                             <img :src="item.imgurl" alt="">
                                             <span class="part5_text">{{ item.title }}</span>
                                         </NuxtLink>
@@ -971,11 +825,8 @@
                             <div class="content_bottom_right">
                                 <ul class="bottom_content_1">
                                     <li class="bottom_content_list" v-for="(item, index) in boxData18" :key="index">
-                                        <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                            {{ item.title }}
-                                        </NuxtLink>
-                                        <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0"
-                                            :title="item.title">
+                                        <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                            :target="item.islink == 1 ? '_blank' : '_self'">
                                             {{ item.title }}
                                         </NuxtLink>
                                     </li>
@@ -1009,22 +860,16 @@
                     <div v-if="tabsData5 == 1">
                         <ul class="part5_right_content_top">
                             <li class="part5_right_contentlist_top" v-for="(item, index) in boxData19" :key="index">
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="numStyle">{{ index + 1 }}</span>
-                                    {{ item.title }}
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="numStyle">{{ index + 1 }}</span>
                                     {{ item.title }}
                                 </NuxtLink>
                             </li>
                         </ul>
                         <div class="part5_photo_text_right" v-for="(item, index) in boxData19data1" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <span class="part5_text11">{{ item.title }}</span>
-                                <img :src="item.imgurl" alt="">
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <span class="part5_text11">{{ item.title }}</span>
                                 <img :src="item.imgurl" alt="">
                             </NuxtLink>
@@ -1034,45 +879,34 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="erjibiaoti">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    {{ item.title }}
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     {{ item.title }}
                                 </NuxtLink>
                             </li>
                         </ul>
                         <div class="part5_photo_text_right" v-for="(item, index) in boxData19data2" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <span class="part5_text11">{{ item.title }}</span>
-                                <img :src="item.imgurl" alt="">
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <span class="part5_text11">{{ item.title }}</span>
                                 <img :src="item.imgurl" alt="">
                             </NuxtLink>
                         </div>
                     </div>
-                    <!-- 招工招聘 -->
+                    <!-- 招工求职 -->
                     <div v-if="tabsData5 == 2">
                         <ul class="part5_right_content_top">
                             <li class="part5_right_contentlist_top" v-for="(item, index) in boxData20" :key="index">
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    <span class="numStyle">{{ index + 1 }}</span>
-                                    {{ item.title }}
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     <span class="numStyle">{{ index + 1 }}</span>
                                     {{ item.title }}
                                 </NuxtLink>
                             </li>
                         </ul>
                         <div class="part5_photo_text_right" v-for="(item, index) in boxData20data1" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <span class="part5_text11">{{ item.title }}</span>
-                                <img :src="item.imgurl" alt="">
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <span class="part5_text11">{{ item.title }}</span>
                                 <img :src="item.imgurl" alt="">
                             </NuxtLink>
@@ -1082,20 +916,15 @@
                                 <NuxtLink :href="getLinkPath1(item)" :title="item.alias">
                                     <span class="erjibiaoti">{{ item.alias }}</span>
                                 </NuxtLink>
-                                <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                    {{ item.title }}
-                                </NuxtLink>
-                                <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                                <NuxtLink :href="getLinkPathDetail1(item)" :title="item.title"
+                                    :target="item.islink == 1 ? '_blank' : '_self'">
                                     {{ item.title }}
                                 </NuxtLink>
                             </li>
                         </ul>
                         <div class="part5_photo_text_right" v-for="(item, index) in boxData20data2" :key="index">
-                            <NuxtLink :to="item.linkurl" v-if="item.islink == 1" :title="item.title">
-                                <span class="part5_text11">{{ item.title }}</span>
-                                <img :src="item.imgurl" alt="">
-                            </NuxtLink>
-                            <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
                                 <span class="part5_text11">{{ item.title }}</span>
                                 <img :src="item.imgurl" alt="">
                             </NuxtLink>
@@ -1103,11 +932,12 @@
                     </div>
                     <!-- 广告5 -->
                     <div class="adBox1" v-if="adImg5">
-                        <a href="http://nzgxw.org.cn/" v-if="adImg5.image_url == null" target="_blank">
-                            <img :src="adImg5.thumb" :title="adImg5.place_name">
+                        <a href="http://nzgxw.org.cn/" v-if="adImg5.image_url == null" target="_blank"
+                            :title="adImg5.introduce">
+                            <img :src="adImg5.thumb" :title="adImg5.introduce" :id="adImg5.ad_tag" data-tag="adImg5.ad_tag">
                         </a>
-                        <a :href="adImg5.image_url" v-else>
-                            <img :src="adImg5.image_src" :title="adImg5.ad_name">
+                        <a :href="adImg5.image_url" :title="adImg5.introduce" v-else>
+                            <img :src="adImg5.image_src" :alt="adImg5.introduce" :id="adImg5.ad_tag" data-tag="adImg5.ad_tag">
                         </a>
                     </div>
                 </div>
@@ -1145,7 +975,6 @@
                             </li>
                         </ul>
                     </div>
-
                 </div>
                 <div class="part6_right">
                     <h2 class="part6_right_title">土乡特色</h2>
@@ -1200,25 +1029,37 @@ import { ElMessage } from 'element-plus';
 //1.页面必备方法 start ---------------------------------------->
 //获得跳转链接
 const getLinkPath = (item) => {
-    // console.log('item', item);
+    console.log('item', item);
 
     if (item.children_count == 0) {
-        return `/newsList/${item.cid}?page=1`;
+        //return `/newsList/${item.cid}?page=1`;
+        return `/${item.url}/list-1.html`;
     } else {
-        return `/primaryNavigation/${item.cid}`;
+        //return `/primaryNavigation/${item.cid}`;
+        return `/${item.url}/index.html`;
     }
-
-    // if (item.children_count == 0) {
-    //     return `/newsList/${item.cid}?page=1`;
-    // } else {
-    //     return `/${item.url}/`;
-    // }
 }
 const getLinkPath1 = (item) => {
-    // console.log('item111', item);
-    //return `/${item.url}/1.html`;
+    console.log('item111', item);
+    // return `/${item.url}/1.html`;
     // return `/newsList/${item.category_id}?page=1`;
-    return `/newsList/${item.category_id}`;
+    // return `/newsList/${item.category_id}`;
+    return `/${item.aLIas_pinyin}/list-1.html`;
+}
+//首页跳转到详情,这里需要考虑外链
+const getLinkPathDetail = (item) => {
+    if (item.islink == 1) {
+        return `${item.linkurl}`;
+    } else {
+        return `/${item.pinyin}/${item.id}.html`;
+    }
+}
+const getLinkPathDetail1 = (item) => {
+    if (item.islink == 1) {
+        return `${item.linkurl}`;
+    } else {
+        return `/${item.aLIas_pinyin}/${item.id}.html`;
+    }
 }
 //1.页面必备方法 end ---------------------------------------->
 
@@ -1363,74 +1204,54 @@ try {
                 cid: navigateData.data[index].category_id,
                 children_count: navigateData.data[index].children_count,
                 alias: navigateData.data[index].alias,
-                // url: navigateData.data[index].aLIas_pinyin
+                url: navigateData.data[index].aLIas_pinyin
             };
             //主体渲染 
             //第一层
             //三农资讯445
-            // if (navigateData.data[index].category_id == 11) { pageData.value[0] = data }
             if (navigateData.data[index].category_id == 445) { pageData.value[0] = data }
             //三农服务27
-            // if (navigateData.data[index].category_id == 317) { pageData.value[1] = data }
             if (navigateData.data[index].category_id == 27) { pageData.value[1] = data }
             //网站公告410
-            // if (navigateData.data[index].category_id == 1) { pageData.value[2] = data }
             if (navigateData.data[index].category_id == 410) { pageData.value[2] = data }
             //第二层
             //乡村招商325
-            // if (navigateData.data[index].category_id == 2) { pageData.value[3] = data }
             if (navigateData.data[index].category_id == 325) { pageData.value[3] = data }
             //乡村建设320
-            // if (navigateData.data[index].category_id == 5) { pageData.value[4] = data }
             if (navigateData.data[index].category_id == 320) { pageData.value[4] = data }
             //乡村管理319
-            // if (navigateData.data[index].category_id == 12) { pageData.value[5] = data }
             if (navigateData.data[index].category_id == 319) { pageData.value[5] = data }
             //乡村文化321
-            // if (navigateData.data[index].category_id == 13) { pageData.value[6] = data }
             if (navigateData.data[index].category_id == 321) { pageData.value[6] = data }
             //第三层
             //三农投资408 12
-            // if (navigateData.data[index].category_id == 24) { pageData.value[7] = data }
             if (navigateData.data[index].category_id == 12) { pageData.value[7] = data }
             // if (navigateData.data[index].category_id ==408) { pageData.value[7] = data }
             //乡村生活322
-            // if (navigateData.data[index].category_id == 14) { pageData.value[8] = data }
             if (navigateData.data[index].category_id == 322) { pageData.value[8] = data }
             //乡村经济323
-            // if (navigateData.data[index].category_id == 15) { pageData.value[9] = data }
             if (navigateData.data[index].category_id == 323) { pageData.value[9] = data }
             //乡村风采318
-            // if (navigateData.data[index].category_id == 27) { pageData.value[10] = data }
             if (navigateData.data[index].category_id == 318) { pageData.value[10] = data }
             //第四层
             //乡村名企407
-            // if (navigateData.data[index].category_id == 16) { pageData.value[11] = data }
             if (navigateData.data[index].category_id == 407) { pageData.value[11] = data }
             //特色乡村331
-            // if (navigateData.data[index].category_id == 18) { pageData.value[12] = data }
             if (navigateData.data[index].category_id == 331) { pageData.value[12] = data }
             //产业集群330
-            // if (navigateData.data[index].category_id == 21) { pageData.value[13] = data }
             if (navigateData.data[index].category_id == 330) { pageData.value[13] = data }
             //第五层
             //三农人物18
-            // if (navigateData.data[index].category_id == 153) { pageData.value[14] = data }
             if (navigateData.data[index].category_id == 18) { pageData.value[14] = data }
             //三农名企335
-            // if (navigateData.data[index].category_id == 26) { pageData.value[15] = data }
             if (navigateData.data[index].category_id == 335) { pageData.value[15] = data }
             //农技推广348
-            // if (navigateData.data[index].category_id == 27) { pageData.value[16] = data }
             if (navigateData.data[index].category_id == 348) { pageData.value[16] = data }
             //致富信息23
-            // if (navigateData.data[index].category_id == 28) { pageData.value[17] = data }
             if (navigateData.data[index].category_id == 23) { pageData.value[17] = data }
             //三农探索16
-            // if (navigateData.data[index].category_id == 317) { pageData.value[18] = data }
             if (navigateData.data[index].category_id == 16) { pageData.value[18] = data }
             //招工求职344
-            // if (navigateData.data[index].category_id == 15) { pageData.value[19] = data }
             if (navigateData.data[index].category_id == 344) { pageData.value[19] = data }
         }
     } else {
@@ -1446,30 +1267,9 @@ try {
     console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
 }
 
-// 三农资讯网
+
 let getJson = [
-    // { "parent": "11,0,20", "child": "11,0,0" },//模块1 三农资讯328
-    // { "parent": "317,0,4", "child": "" },//模块2 三农服务27
-    // { "parent": "2,0,4", "child": "" },//模块3 网站公告410
-    // { "parent": "5,3,10", "child": "5,0,0" },//模块4 乡村招商325
-    // { "parent": "12,2,0", "child": "" },//模块5 乡村建设320
-    // { "parent": "13,2,0", "child": "" },//模块6 乡村管理319
-    // { "parent": "24,2,0", "child": "" },//模块7 乡村文化321
-    // { "parent": "12,3,10", "child": "5,0,0" },//模块8 三农投资408
-    // { "parent": "14,2,0", "child": "" },//模块9 乡村生活322
-    // { "parent": "15,2,0", "child": "" },//模块10 乡村经济323
-    // { "parent": "27,2,0", "child": "" },//模块11 乡村风采318
-    // { "parent": "13,1,5", "child": "" },//模块12 乡村名企407
-    // { "parent": "24,1,5", "child": "" },//模块13 特色乡村331 
-    // { "parent": "14,1,13", "child": "14,0,0" },//模块14 产业集群330
-    // { "parent": "15,1,10", "child": "" },//模块15 三农人物18
-    // { "parent": "27,1,10", "child": "" },//模块16 三农名企335
-    // { "parent": "16,3,10", "child": "" },//模块17 农技推广348
-    // { "parent": "18,3,10", "child": "" },//模块18 致富信息23
-    // { "parent": "15,2,7", "child": "" },//模块19 三农探索16
-    // { "parent": "26,2,7", "child": "" },//模块20 招工求职344
 
-    // 乡村网
     { "parent": "445,0,20", "child": "445,0,0" },//模块1 三农资讯328
     { "parent": "27,0,4", "child": "" },//模块2 三农服务27
     { "parent": "410,0,4", "child": "" },//模块3 网站公告410
@@ -1511,7 +1311,7 @@ async function getPageAllData() {
         //模块1 三农资讯
         boxData1.value = mkdata.data[0].textnum;
         if (mkdata.data[0].child) {
-            boxData1menu.value = mkdata.data[0].child.all_childcat; 
+            boxData1menu.value = mkdata.data[0].child.all_childcat;
         }
         //模块2 三农服务
         boxData2.value = mkdata.data[1].textnum;
@@ -1648,15 +1448,6 @@ getPageAllData();
 
 //获取模块下的特殊数据
 let getJson1 = [
-    // { "parent": "11,0,6" },//模块1 三农资讯328
-    // { "parent": "317,0,6" },//模块2 三农服务27
-    // { "parent": "2,0,6" },//模块3 网站公告410
-    // { "parent": "5,0,6" },//模块4 乡村招商325
-    // { "parent": "12,0,6" },//模块8 三农投资408
-    // { "parent": "13,0,6" },//模块12 乡村名企407
-    // { "parent": "24,0,2" },//模块13 特色乡村331 
-    // { "parent": "14,0,2" },//模块14 产业集群330
-
     { "parent": "320,0,6", "child": "" },//模块5 乡村建设320
     { "parent": "319,0,6", "child": "" },//模块6 乡村管理319
     { "parent": "321,0,6", "child": "" },//模块7 乡村文化321

+ 0 - 429
pages/newsDetail/[id].vue

@@ -1,429 +0,0 @@
-<template>
-    <!-- 页面头部 -->
-    <HomePageHead></HomePageHead>
-    <!-- 页面导航 -->
-    <HomePageNavigation></HomePageNavigation>
-    <!-- 广告1 -->
-    <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
-
-    <!-- 面包屑导航 -->
-    <div class="breadcrumb">
-        <div class="inner">
-            <span class="location">当前位置:</span>
-            <el-breadcrumb :separator-icon="ArrowRight">
-                <el-breadcrumb-item>
-                    <NuxtLink to="/">首页</NuxtLink>
-                </el-breadcrumb-item>
-                <el-breadcrumb-item>
-                    <NuxtLink :to="{ path: `/newsList/${routLevelId}` }">
-                        {{ routLevelTitle }}
-                    </NuxtLink>
-                </el-breadcrumb-item>
-                <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
-            </el-breadcrumb>
-        </div>
-    </div>
-
-    <!-- 资讯列表 -->
-    <div class="newsDetail">
-        <div class="inner">
-            <div class="innerLeft">
-                <div class="LeftTop">
-                    <h1>{{ newsDetail.title }}</h1>
-                    <p>
-                        来源: <span>{{ newsDetail.copyfrom }}</span>
-                        作者: <span>{{ newsDetail.author }}</span>
-                        发布时间: <span>{{ time }}</span>
-                    </p>
-                </div>
-                <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">
-                </div>
-
-                <!-- 免责声明: -->
-                <div class="disclaimer" v-if="newsDetail.fromurl">
-                    <p>原文链接:{{ newsDetail.fromurl }}</p>
-                    <p>[免责声明]本文来源于网络转载,仅供学习交流使用,不构成商业目的。 版权归原作者所有,如涉及作品内容,版权和其他问题,请在30日与本网联系,我们将第一时间处理。</p>
-                </div>
-            </div>
-            <div class="innerRight">
-                <!-- 热点资讯1 -->
-                <div class="hotList1">
-                    <DetailHotNews></DetailHotNews>
-                </div>
-                <!-- 热点资讯2 -->
-                <div class="hotList2">
-                    <DetailHotNews2></DetailHotNews2>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!-- 页面底部 -->
-    <HomeFoot1></HomeFoot1>
-</template>
-
-<script setup>
-//1.页面依赖 start ---------------------------------------->
-import { onMounted } from 'vue'
-import { ElBreadcrumb, ElBreadcrumbItem} from 'element-plus'
-import { ArrowRight } from '@element-plus/icons-vue'
-
-
-//获得跳转过来的id
-const route = useRoute();
-const articleId = route.params.id; //获得该页面的id
-//1.页面依赖 end ---------------------------------------->
-
-//2.页面数据 start ---------------------------------------->
-//2.1 资讯详情
-const newsDetail = ref({})
-const routeNewsTtitle = ref("");
-//2.2 发布日期
-const time = ref("");
-//2.3 路径
-const routLevelTitle = ref("");
-const routLevelId = ref("");
-//是否展示投票
-const articleChoice = ref(false);
-//2.4获取详情
-async function getPageData() {
-    const mkdata = await requestDataPromise('/web/selectWebsiteArticleInfo', {
-        method: 'GET',
-        query: {
-            'articleid': articleId
-        },
-    });
-    if (mkdata.code == 200) {
-        //判断是否显示投票
-        if (mkdata.data.is_survey == 1) {
-            console.log("本篇文章含有投票!")
-            articleChoice.value = true;
-            getVoteList();
-        }
-        //获取内容
-        newsDetail.value = mkdata.data;
-        //获取路径
-        routLevelTitle.value = newsDetail.value.cat_name;
-        routLevelId.value = newsDetail.value.category_id;
-        //获取发布时间
-        time.value = newsDetail.value.updated_at.split(' ')[0];
-        //修正标题长度
-        if (newsDetail.value.title.length >= 30) {
-            routeNewsTtitle.value = newsDetail.value.title.substr(0, 30) + "...";
-        } else {
-            routeNewsTtitle.value = newsDetail.value.title
-        }
-    } else {
-        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-        console.log("错误位置:获取详情内容")
-        console.log("后端错误反馈:", mkdata.message)
-        console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-    }
-}
-getPageData();
-
-//2.5 获得广告
-//广告列表
-let adImg1 = ref([]);
-// async function getAdData(){
-//     const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'DETAIL'}});
-//     if(adData.code==200){
-//         for(let item of adData.data){
-//             if(item.ad_tag == 'DETAIL_0001'){
-//                 adImg1.value = item;
-//             }
-//         }
-//     }else{
-//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-//         console.log("错误位置:获取详情页广告列表")
-//         console.log("后端错误反馈:",adData.message)
-//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-//     }
-// }
-// getAdData();
-
-onMounted(async () => {
-    const { $webUrl, $CwebUrl } = useNuxtApp();
-    //广告1
-    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_detail_0001`
-    const responseAd1 = await fetch(url, {
-        headers: {
-            'Content-Type': 'application/json',
-            'Userurl': $CwebUrl,
-            'Origin': $CwebUrl
-        }
-    });
-    const resultAd1 = await responseAd1.json();
-    adImg1.value = resultAd1.data[0];
-})
-
-//2.页面数据 end ---------------------------------------->
-
-//3.设置seo信息 start---------------------------------------->
-//3.1 设置seo信息
-const setData = await requestDataPromise('/web/selectWebsiteArticleInfo', {
-    method: 'GET',
-    query: {
-        'articleid': articleId
-    },
-});
-if (setData.code == 200) {
-    let seoTitle = setData.data.title;
-    let seoDescription = setData.data.introduce;
-    let seoKeywords = setData.data.keyword;
-    let seoSuffix = setData.data.suffix;
-    let seoName = setData.data.website_name;
-
-    useSeoMeta({
-        title: seoTitle + "_" + seoName + "_" + seoSuffix,
-        meta: [
-            { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
-            { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
-        ]
-    });
-} else {
-    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-    console.log("错误位置:设置详情页面SEO数据")
-    console.log("后端错误反馈:", setData.message)
-    console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-}
-//3.设置seo信息 end---------------------------------------->
-//5.页面图片放大 start---------------------------------------->
-const previewVisible = ref(false)
-const selectedImage = ref(' ')
-
-const openPreview = (event) => {
-    if (event.target.tagName === 'IMG') {
-        selectedImage.value = event.target.src;
-        previewVisible.value = true;
-    }
-}
-const closePreview = () => {
-    previewVisible.value = false;
-}
-//5.页面图片放大 end---------------------------------------->
-</script>
-
-<style lang="less" scoped>
-//导航条
-.breadcrumb {
-    width: 100%;
-    height: 22px;
-    margin-bottom: 30px;
-    margin-top: 40px;
-    font-family: Microsoft YaHei, Microsoft YaHei;
-    font-weight: 400;
-    font-size: 20px;
-    color: #666666;
-    line-height: 23px;
-    text-align: left;
-    font-style: normal;
-    text-transform: none;
-
-    .el-breadcrumb::v-deep {
-        display: inline-block;
-        vertical-align: -4px;
-    }
-
-    /deep/.el-breadcrumb__inner a,
-    /deep/.el-breadcrumb__inner.is-link {
-        color: #666666;
-        font-weight: 400;
-        text-decoration: none;
-        transition: var(--el-transition-color);
-    }
-
-    span {
-        font-family: Microsoft YaHei, Microsoft YaHei;
-        font-weight: 400;
-        font-size: 20px;
-        color: #666666;
-        line-height: 23px;
-        text-align: left;
-        font-style: normal;
-        text-transform: none;
-    }
-
-    span:hover {
-        color: #666666;
-    }
-
-    .location {
-        margin-right: 20px;
-        width: 100px;
-        height: 22px;
-        font-family: Microsoft YaHei, Microsoft YaHei;
-        font-weight: 400;
-        font-size: 20px;
-        color: #666666;
-        line-height: 23px;
-        text-align: left;
-        font-style: normal;
-        text-transform: none;
-    }
-}
-
-// 资讯列表
-.newsDetail {
-    width: 100%;
-    //height: 1400px;
-    margin-bottom: 70px;
-
-    .inner {
-        width: 1200px;
-        //height: 1400px;
-        overflow: hidden;
-        font-size: 16px;
-
-        .innerLeft {
-            width: 810px;
-            border-top: 1px solid #ccc;
-            margin-right: 40px;
-
-            .LeftTop {
-                // height: 522px;
-                margin-top: 50px;
-
-                >h1 {
-
-                    line-height: 40px;
-                    margin-bottom: 30px;
-                    font-family: Microsoft YaHei, Microsoft YaHei;
-                    font-weight: bold;
-                    font-size: 30px;
-                    color: #333333;
-                }
-
-                >p {
-                    height: 18px;
-                    line-height: 18px;
-                    font-family: Microsoft YaHei, Microsoft YaHei;
-                    font-weight: 400;
-                    font-size: 14px;
-                    color: #999999;
-
-                    span {
-                        margin-right: 40px;
-                    }
-                }
-
-                >img {
-                    width: 680px;
-                    height: 382px;
-                    padding: 50px 0px 60px 55px;
-                }
-            }
-
-            .leftBottom {
-                width: 790px;
-                margin-top: 50px;
-                font-size: 20px;
-                line-height: 38px;
-                margin-bottom: 30px;
-
-                ul>li img {
-                    width: 790px;
-                    height: 382px;
-                }
-
-                img {
-                    width: 790px;
-                    height: 382px;
-                }
-
-                p.tinymce-material {
-                    img {
-                        width: 790px;
-                    }
-                }
-
-                >h3,
-                >p {
-                    text-indent: 2em;
-                    width: 790px;
-                    font-family: Microsoft YaHei, Microsoft YaHei;
-                    font-size: 20px;
-                    color: #333333;
-                    line-height: 38px;
-                    padding-bottom: 30px;
-
-                    img {
-                        width: 790px;
-                    }
-                }
-
-                >h3 {
-                    font-weight: 600px;
-                }
-
-                >p {
-                    font-weight: 400;
-                }
-
-            }
-
-            .disclaimer {
-                width: 790px;
-                overflow: hidden;
-                border-top: 1px solid #e6e6e6;
-                padding: 30px 0px;
-                color: #999999;
-                font-size: 17px;
-
-                p {
-                    width: 790px;
-                    line-height: 30px;
-                }
-            }
-        }
-
-        .innerRight {
-            width: 350px;
-            height: 1248px;
-            border-top: 1px solid #ccc;
-            border-bottom: 1px solid #ccc;
-
-        }
-    }
-}
-
-.leftBottom::v-deep p img,
-.leftBottom::v-deep img,
-.leftBottom::v-deep video {
-    max-width: 700px;
-}
-
-.leftBottom::v-deep h1,
-.leftBottom::v-deep h2,
-.leftBottom::v-deep h3,
-.leftBottom::v-deep h4,
-.leftBottom::v-deep h5,
-.leftBottom::v-deep h6 {
-    font-size: 20px;
-    font-weight: 500;
-}
-
-//放大图片
-.preview-modal {
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    background: rgba(0, 0, 0, 0.8);
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    z-index: 1000;
-}
-
-.preview-modal img {
-    max-width: 100%;
-    max-height: 100%;
-    cursor: pointer;
-    /* 关闭按钮样式 */
-}
-</style>

+ 30 - 137
pages/search/search.vue

@@ -29,11 +29,10 @@
                 <div class="innerLeft">
                     <ul class="list" v-if="newsList.length >= 0">
                         <li v-for="(item, index) in newsList" :key="index">
-                            <NuxtLink :to="item.linkurl" v-show="item.islink == 1">{{ item.title }}
+                            <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
+                                :target="item.islink == 1 ? '_blank' : '_self'">
+                                {{ item.title }}
                             </NuxtLink>
-                            <NuxtLink
-                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
-                                v-if="item.islink == 0">{{ item.title }}</NuxtLink>
                             <span class="time right">{{ getTime(item.updated_at, 'month', 1) }}</span>
                         </li>
                     </ul>
@@ -68,6 +67,7 @@ const route = useRoute();
 //const pageCatids = route.query.catids;
 const pageCatids = route.params.id
 const pageDepartment_id = route.query.department_id;
+const keyword = route.query.keyword; //关键词
 
 //const category_id = route.query.category_id; //获得该页面的id
 // const searchKey = route.query.keyword
@@ -77,37 +77,23 @@ const pageDepartment_id = route.query.department_id;
 let total = useState("total", () => 0)
 let page = useState("page", () => 1)
 let pageSize = useState("pageSize", () => 20)
+
+//格式化跳转链接
+const getLinkPathDetail = (item) => {
+    if (item.islink == 1) {
+        return `${item.linkurl}`;
+    } else {
+        return `/${item.pinyin}/${item.id}.html`;
+    }
+}
 //1.页面依赖 end ---------------------------------------->
 
 //2.页面数据 start ---------------------------------------->
 //2.1 广告
 let adImg1 = ref([]);
 let adImg2 = ref([]);
-// async function getAdData(){
-//     const mkdata = await requestDataPromise('/web/getWebsiteAdvertisement',{
-//         method:'GET',
-//         query:{
-//             'ad_tag':'SEARCH'
-//         }
-//     });
-//     if(adData.code==200){
-//         for(let item of adData.data){
-//             if(item.ad_tag == 'SEARCH_0001'){
-//                 adImg1.value = item;
-//             }
-//             if(item.ad_tag == 'SEARCH_0002'){
-//                 adImg2.value = item;
-//             }
-//         }
-//     }else{
-//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-//         console.log("错误位置:获取搜索页广告列表")
-//         console.log("后端错误反馈:",adData.message)
-//         console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
-//     }
-// }
-// getAdData();
-onMounted(async ()  => {
+
+onMounted(async () => {
     //从客户端获取行政职能部门 加快打开速度
     const { $webUrl, $CwebUrl } = useNuxtApp();
     //广告1
@@ -121,7 +107,7 @@ onMounted(async ()  => {
     });
     const resultAd1 = await responseAd1.json();
     adImg1.value = resultAd1.data[0];
-    
+
     //广告2
     let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_search_0002`
     const responseAd2 = await fetch(url2, {
@@ -139,131 +125,38 @@ onMounted(async ()  => {
 // 新闻列表
 const newsList = ref([]);
 let keywordInput = ref("");
+keywordInput.value = keyword;
 
 //搜索
 let goSearch = async () => {
-    console.log(111222)
     console.log(page.value)
     console.log(pageSize.value)
     console.log(keywordInput.value)
     console.log(pageCatids)
     console.log(pageDepartment_id)
-    const listData =  await requestDataPromise('/web/selectWebsiteCategory', {
+
+    const listData = await requestDataPromise('/web/selectWebsiteCategory', {
         method: 'GET',
         query: {
             'page': page.value,
             'pageSize': pageSize.value,
-            'keyword':keywordInput.value,
-            'cityid':pageCatids,
-            'department_id':pageDepartment_id
+            'keyword': keywordInput.value,
+            'cityid': pageCatids,
+            'department_id': pageDepartment_id
         },
     });
-    if(listData.data.rows){
+    if (listData.data.rows) {
         console.log(listData)
         newsList.value = listData.data.rows;
         total.value = listData.data.count;
+    } else {
+        newsList.value = [];
+        total.value = 0;
     }
-   
+
 }
 
 goSearch();
-//基于导航池搜索
-// let goSearchFont = async (font) => {
-//     const listData =  await requestDataPromise('/web/getWebsiteArticleList', {
-//         method: 'GET',
-//         query: {
-//             'page': page.value,
-//             'pageSize': pageSize.value,
-//             'catid': font
-//         },
-//     });
-//     newsList.value = listData.data.rows;
-//     total.value = listData.data.count;
-// }
-
-// //基于导航池与关键词搜索
-// let goSearchFontandCid = async (font) => {
-//     const listData =  await requestDataPromise('/web/getWebsiteArticleList', {
-//         method: 'GET',
-//         query: {
-//             'page': page.value,
-//             'pageSize': pageSize.value,
-//             'catid': category_id,
-//             'keyword':searchKey
-//         },
-//     });
-//     newsList.value = listData.data.rows;
-//     total.value = listData.data.count;
-// }
-
-
-//直接查新闻
-// const newslists = async () => {
-//     try {
-//         // 从地区跳转
-//         if (route.query.catids && route.query.catids.length > 0) {
-//             // 将字符串转换回数组,并过滤掉可能的空值
-//             catids.value = route.query.catids.split(',').filter(id => id);
-
-//             if (catids.value.length > 0) {
-//                 // 有效的 catids 数组,可以进行后续操作
-//                 console.log('接收到的分类ID数组:', catids.value);
-//                 let font = catids.value.join(",")
-//                 font = "[" + font + "]"
-
-//                 goSearchFont(font);
-//             } else {
-//                 // 处理空数组情况
-//                 console.log('未接收到有效的分类ID');
-//             }
-//         } else {
-//             if (category_id == undefined) {
-//                 //直接搜索 默认进来没有导航池的话 不执行搜索
-//                 goSearch();
-//             } else {
-//                 goSearchFontandCid();
-//             }
-//         }
-//     } catch (error) {
-//         console.error(error);
-//     }
-// }
-// newslists();
-
-
-// 查询导航池的方法
-// const newslists = async () => {
-//     try {
-//         // 从地区跳转
-//         if (route.query.catids && route.query.catids.length > 0) {
-//             // 将字符串转换回数组,并过滤掉可能的空值
-//             catids.value = route.query.catids.split(',').filter(id => id);
-
-//             if (catids.value.length > 0) {
-//                 // 有效的 catids 数组,可以进行后续操作
-//                 console.log('接收到的分类ID数组:', catids.value);
-//                 let font = catids.value.join(",")
-//                 font = "[" + font + "]"
-
-//                 goSearchFont(font);
-//             } else {
-//                 // 处理空数组情况
-//                 console.log('未接收到有效的分类ID');
-//             }
-//         } else {
-//             if (category_id == undefined) {
-//                 //直接搜索 默认进来没有导航池的话 不执行搜索
-//                 goSearch();
-//             } else {
-//                 goSearchFontandCid();
-//             }
-//         }
-//     } catch (error) {
-//         console.error(error);
-//     }
-// }
-
-// newslists();
 
 //分页事件
 let changePage = (value) => {
@@ -277,7 +170,7 @@ let changePage = (value) => {
 
 //4.设置seo信息 start---------------------------------------->
 //4.1 设置seo信息
-const setData =  await requestDataPromise('/web/getWebsiteFootInfo', {
+const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
     method: 'GET',
     query: {},
 });
@@ -291,8 +184,8 @@ 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---------------------------------------->