Pārlūkot izejas kodu

开始引入组件

开始引入组件
dangyunlong 9 stundas atpakaļ
vecāks
revīzija
89883907e3

+ 42 - 77
assets/css/public/footer.less

@@ -3,13 +3,11 @@
     width: 1200px;
     margin: 0 auto;
 }
-
 .index_foot_name_box {
     margin: 40px auto 0px;
     text-align: center;
     font-size: 0px;
 }
-
 .index_foot_name {
     display: inline-block;
     height: 67px;
@@ -19,46 +17,32 @@
     font-weight: bold;
     overflow: hidden;
 }
-
 .index_foot_name:nth-of-type(even) {
     color: #333;
     font-size: 32px;
 }
-
 .foot_img_box {
     overflow: hidden;
     display: block;
     margin: 10px auto 0;
     width: 100%;
-//     display: flex;
-//     justify-content: space-between;
-//     flex-wrap: wrap;
 }
-
 .foot_img_box>* {
     float: left;
     width: 170px;
     height: 57px;
     overflow: hidden;
-//     box-sizing: border-box;
-//     border: solid 1px #d7edd4;
     margin: 0px 36px 20px 0px;
-
-
-
 }
-
 .foot_img_box>* * {
     display: block;
     width: 170px;
     height: 57px;
      
 }
-
 .foot_img_box>*:nth-of-type(6n) {
     margin-right: 0px;
 }
-
 .foot_frind_box {
     display: block;
     margin: 20px auto 20px;
@@ -66,7 +50,6 @@
     display: flex;
     width: 100%;
 }
-
 .foot_frind_box span {
     word-break: keep-all;
     white-space: nowrap;
@@ -75,12 +58,10 @@
     color: #333;
     font-weight: bold;
 }
-
 .foot_frind_box div {
     width: 100%;
     overflow: hidden;
 }
-
 .foot_frind_box div * {
     float: left;
     line-height: 22px;
@@ -90,50 +71,12 @@
     margin: 0 27px;
     margin-bottom: 20px;
 }
-
-.call_us_box {
-    display: block;
-    width: 100%;
-    margin: 0 auto;
-    overflow: hidden;
-    text-align: center;
-    font-size: 0px;
-    background: #1C5468;
-
-    a {
-        color: #fff;
-    }
-}
-
-.inner {
-    width: 1200px;
-    margin: 0 auto;
-}
-
-.inner>* {
-    height: 12px;
-    line-height: 12px;
-    color: #fff;
-    font-size: 14px;
-    display: inline-block;
-    box-sizing: border-box;
-    padding: 0 19px;
-    font-weight: bold;
-    border-left: solid 1px #193D4A;
-    margin: 18px 0;
-}
-
-.inner>*:nth-of-type(1) {
-    border-left: 0px;
-}
-
 .foot_text_box {
     margin: 40px auto 0px;
     text-align: center;
     color: #333;
     font-size: 14px;
     line-height: 25px;
-//      background-color: red; 
     p {
         a {
             color: #333;
@@ -145,54 +88,41 @@
         }
     }
 }
-
 .foot_text_box :deep(a){color: #333;}
-// .foot_text_box a{}
-
 .top_content {
     padding: 0 170px;
 }
-
 .webSitecolor {
     color: #dd7d18;
 }
-
-
 .foot_text_box_green {
     color: #40663B;
 }
-
 .foot_text_box img {
     display: inline-block;
     height: 20px;
     vertical-align: middle;
 }
-
 .foot_logo_out {
     position: relative;
     margin: 0px auto;
     width: 100%;
     height: 0px;
 }
-
 .foot_logo_out * {
     width: 120px;
     display: block;
 }
-
 .foot_logo_out>* {
     position: absolute;
     top: -145px;
 }
-
 .foot_logo_out>*:nth-of-type(1) {
     left: 0px;
 }
-
 .foot_logo_out>*:nth-of-type(2) {
     right: 0px;
 }
-
 .foot_last_img_box {
     margin: 40px auto 10px;
     text-align: center;
@@ -201,7 +131,6 @@
     font-size: 0px;
     padding-bottom: 40px;
 }
-
 .foot_last_img_box>* {
     height: 50px;
     width: 120px;
@@ -209,18 +138,54 @@
     display: inline-block;
     overflow: hidden;
 }
-
 .foot_last_img_box>* * {
     display: block;
     height: 100%;
     width: 100%;
     overflow: hidden;
 }
-
-
-
-
-
+// template start ---------------------------------------->
+.foot_menu_box_style1 {
+    width: 100%;
+    height: 50px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: #1C5468;
+    div {
+        a {
+            color:#fff;
+            font-size: 14px;
+        }
+        width: 200px;
+        border-right: 1px solid #193D4A;
+        text-align: center;
+        &:last-child {
+            border-right: none;
+        }
+    }
+}
+.foot_menu_box_style2 {
+    width: 100%;
+    height: 50px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: #A91B33;
+    div {
+        a {
+            color:#fff;
+            font-size: 14px;
+        }
+        width: 200px;
+        border-right: 1px solid #930F25;
+        text-align: center;
+        &:last-child {
+            border-right: none;
+        }
+    }
+}
+// template end ---------------------------------------->
 
 
 

+ 7 - 1
assets/css/public/nav.less

@@ -22,6 +22,9 @@
             justify-content: flex-start;
             width: 100%;
             div {
+                a{
+                    color: #fff;
+                }
                 width: 12.5%;
                 cursor: pointer;
                 box-sizing: border-box;
@@ -108,6 +111,9 @@
             justify-content: flex-start;
             width: 100%;
             div {
+                a{
+                    color: #fff;
+                }
                 width: 12.5%;
                 cursor: pointer;
                 box-sizing: border-box;
@@ -119,7 +125,7 @@
                 white-space: nowrap;
                 text-overflow: ellipsis;
                 text-align: center;
-                color: #fff;
+                
                 background: #A91B33;
                 border-right: #88172A 1px solid;
                 border-left: #DE3350 1px solid;

+ 213 - 0
components/template/component/headLine/1200x140/1.vue

@@ -0,0 +1,213 @@
+<template>
+    <div>
+        <div class="headLineStyle1">
+            <div class="headLineTitle">
+                <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748932387576488.png"/>
+                <NuxtLink 
+                    :href="getLinkPathDetail(templateData[0])" 
+                    :title="templateData[0].title"
+                    :target="templateData[0].islink == 1 ? '_blank' : '_self'">
+                    <div class="left_content">
+                        {{ templateData[0].title }}
+                    </div>
+                </NuxtLink>
+            </div>
+            <div class="headLineContent">
+                <NuxtLink 
+                    :href="getLinkPathDetail(templateData[0])" 
+                    :title="templateData[0].title"
+                    :target="templateData[0].islink == 1 ? '_blank' : '_self'">
+                    <div class="left_content">
+                        {{ templateData[0].title }}
+                    </div>
+                </NuxtLink>
+            </div>
+        </div>
+        <!-- <div class="headLineStyle1_skin2" v-if="this.$store.state.template.editWebsiteClass==2">
+            <div class="headTip">
+                <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250626/1750901450165042.jpg">
+            </div>
+            <div class="headLineContentBox" ref="contentBox">
+                <div class="headLineSlider" :style="sliderStyle">
+                    <div class="headLineTitleBox">
+                        <div class="headLineTop">
+                            深入推进周边命运共同体建设 以人工智能引领科研范式变革
+                        </div>
+                        <div class="headLineBottom">
+                            <div>深刻理解新形势下中国周边工作的理念与行动</div>
+                            <div>构建周边命运共同体 携手开创亚洲新未来</div>
+                            <div>抢抓人工智能发展的历史性机遇</div>
+                        </div>
+                    </div>
+                    <div class="headLineTitleBox">
+                        <div class="headLineTop">
+                            民航局:禁止旅客携带无3C标识及被召回的充电宝乘坐境内航班
+                        </div>
+                        <div class="headLineBottom">
+                            <div>深刻理解新形势下中国周边工作的理念与行动</div>
+                            <div>构建周边命运共同体 携手开创亚洲新未来</div>
+                            <div>抢抓人工智能发展的历史性机遇</div>
+                        </div>
+                    </div>
+                    <div class="headLineTitleBox">
+                        <div class="headLineTop">
+                            吴奇隆刘诗诗一家三口同框 共同带孩子回家破婚变传闻
+                        </div>
+                        <div class="headLineBottom">
+                            <div>深刻理解新形势下中国周边工作的理念与行动</div>
+                            <div>构建周边命运共同体 携手开创亚洲新未来</div>
+                            <div>抢抓人工智能发展的历史性机遇</div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="headLineIcon">
+                <div @mouseover="setActive(0)" :class="{active: activeIndex === 0}"></div>
+                <div @mouseover="setActive(1)" :class="{active: activeIndex === 1}"></div>
+                <div @mouseover="setActive(2)" :class="{active: activeIndex === 2}"></div>
+            </div>
+        </div> -->
+    </div>
+</template>
+
+<script setup>
+//引入vue
+import { ref,onMounted } from 'vue';
+//获得新闻数据
+const props = defineProps({
+    templateData:Array,//新闻数据
+});
+
+
+//样式2的效果 start ---------------------------------------->
+//选中的
+const activeIndex = ref(0);
+const setActive = (index) => {
+    activeIndex.value = index;
+}
+const sliderStyle = () => {
+    // 每个headLineTitleBox的高度是70px + 间距30px = 100px
+    const translateY = -(this.activeIndex * 100);
+    return {
+        transform: `translateY(${translateY}px)`,
+        transition: 'transform 0.3s ease-in-out'
+    };
+}
+//样式2的效果 end ---------------------------------------->
+    
+</script>
+
+<style lang="less">
+.headLineStyle1 {
+    width: 1200px;
+    height: 140px;
+    margin: 0 auto;
+    box-sizing: border-box;
+    padding: 30px 100px 30px 100px;
+    .headLineTitle {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        font-size: 30px;
+        font-weight: bold;
+        color: #004564;
+        margin-bottom: 10px;
+        img {
+            margin-right: 20px;
+        }
+        a {
+            color: #004564; 
+        }
+    }
+    .headLineContent{
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        font-size: 18px;
+        color:#333333;
+        div {
+            margin-right: 40px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            &:last-child {
+                margin-right: 0;
+            }
+        }
+    }
+}
+.headLineStyle1_skin2 {
+    border:1px solid #E4E4E4;
+    width: 1200px;
+    height: 140px;
+    box-sizing: border-box;
+    padding:32px 15px 32px 40px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    .headLineContentBox {
+        width: 1000px;
+        height: 70px;
+        overflow: hidden;
+        position: relative;
+        .headLineSlider {
+            display: flex;
+            flex-direction: column; // 改为垂直方向
+            width: 100%;
+            height: 210px; // 3个titleBox,每个70px高
+        }
+    }
+    .headLineTitleBox {
+        text-align: center;
+        height: 70px; // 明确设置高度
+        width: 100%;
+        margin-bottom: 30px;
+        flex-shrink: 0; // 防止收缩
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        .headLineTop {
+            font-size: 30px;
+            color:#A91B33;
+            margin-bottom: 15px;
+            font-weight: bold;
+        }
+        .headLineBottom {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            div {
+                width: 32%;
+                margin-right: 30px;
+                font-size: 18px;
+                color:#333333;
+                white-space: nowrap;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                &:last-child {
+                    margin-right: 0;
+                }
+            }
+        }
+    }
+    .headLineIcon {
+        div {
+            width: 10px;
+            height: 10px;
+            background: #EDEDED;
+            margin-bottom: 10px;
+            cursor: pointer;
+            transition: background 0.3s ease;
+            &:last-child {
+                margin-bottom: 0;
+            }
+            &.active {
+                background: #A91B33;
+            }
+            &:hover {
+                background: #A91B33;
+            }
+        }
+    }
+}
+</style>

+ 13 - 0
components/template/component/headLine/1200x140/2.vue

@@ -0,0 +1,13 @@
+<template>
+    <div>
+        2222
+    </div>
+</template>
+
+<script setup>
+
+</script>
+
+<style lang="less">
+
+</style>

+ 27 - 0
components/template/sector/body/ad/1200x90/1.vue

@@ -0,0 +1,27 @@
+<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.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 :title="imgurl.introduce">
+                <img :src="imgurl.image_src" :alt="imgurl.introduce" :id="imgurl.ad_tag" data-tag="imgurl.ad_tag">
+            </a>
+        </div>
+    </div>
+</template>
+
+<script setup>
+const props = defineProps({
+    skinId: Number,//皮肤id
+    adData: Array,//广告池
+    adTag: String,//广告标识
+});
+//console.log(props.adData)
+//找到传入的广告
+const imgurl = requestAd(props.adData,props.adTag)
+</script>
+
+<style lang="less">
+    @import url('@/assets/css/ad/adversing.less');
+</style>

+ 35 - 0
components/template/sector/body/index/headLine/1200x140/1.vue

@@ -0,0 +1,35 @@
+<template>
+    <div class="headLineBigBox">
+        <div> 
+            <style1 :templateData="templateData.componentList[0].data.text"/>
+        </div>
+        <div>
+            <!-- <style2/> -->
+        </div>
+    </div>
+</template>
+
+<script setup>
+//样式1
+import style1 from '@/components/template/component/headLine/1200x140/1.vue'
+//样式2
+import style2 from '@/components/template/component/headLine/1200x140/2.vue'
+
+const props = defineProps({
+    skinId: Number,//皮肤id
+    templateData:Object,//新闻数据
+});
+
+</script>
+
+<style lang="less">
+.headLineBigBox {
+    width: 1200px;
+    height: 140px;
+    position: relative;
+    margin: 0 auto;
+    .templateEditBtnBox {
+        right: 0;
+    }
+}
+</style>

+ 89 - 0
components/template/sector/foot/1200x580/1.vue

@@ -0,0 +1,89 @@
+<template>
+    <!-- <div>当前皮肤:{{ skinId }}</div> -->
+    <footer class="index_foot" v-if="routeName=='index'">
+        <div class="foot_img_box">
+            <a :href="item.url" v-for="(item, index) in bottomLink" target="_blank">
+                <img :src="item.logo_url" alt="">
+            </a>
+        </div>
+        <div class="foot_frind_box">
+            <span>友情链接</span>
+            <div>
+                <a :href="item.url" v-for="(item, index) in bottomText" :key="index" target="_blank">{{item.title}}</a>
+            </div>
+        </div>
+    </footer>
+    <div :class="'foot_menu_box_style' + skinId">
+        <div v-for="(item, index) in bottomMenu" :key="index">
+            <NuxtLink :to="{ path: `/about/${item.name_pinyin}/list-1.html` }" v-if="item.type == 1" :title="item.name">
+                {{ item.name }}
+            </NuxtLink>
+            <NuxtLink :to="{ path: `/about/${item.name_pinyin}/index.html` }" v-if="item.type == 0" :title="item.name">
+                {{ item.name }}
+            </NuxtLink>
+        </div>
+    </div>
+    <footer class="index_foot">
+        <div class="foot_text_box">
+            <p v-html="bottomBase.statement" class="foot_text_html_css"></p>
+            <p v-html="bottomBase.organizer" class="foot_text_html_css"></p>
+            <p v-html="bottomBase.copyright_information" class="foot_text_html_css"></p>
+            <p><span v-html="bottomBase.icp_number" class="foot_text_html_css"></span><span v-html="bottomBase.record_number" class="foot_text_html_css"></span></p>
+            <p v-html="bottomBase.email" class="foot_text_html_css"></p>
+            <p v-html="bottomBase.company_address" class="foot_text_html_css"></p>
+            <p v-html="bottomBase.contact_number" class="foot_text_html_css"></p>
+        </div>
+        <div class="foot_logo_out" v-if="bottomBase">
+            <a :href="'http://' + bottomBase.project_url" :title="bottomBase.project_name" v-if="bottomBase.project_logo!=''&&bottomBase.project_url!=''">
+                <img :src="bottomBase.project_logo" class="floatLogoRight" :alt="bottomBase.project_name">
+            </a>
+            <span v-else-if="bottomBase.project_logo!=''&&bottomBase.project_url==''">
+                <img :src="bottomBase.project_logo" class="floatLogoRight" :alt="bottomBase.project_name">
+            </span>
+            <a :href="'http://' + bottomBase.company_url" :title="bottomBase.company_name" v-if="bottomBase.company_logo!=''&&bottomBase.company_url!=''">
+                <img :src="bottomBase.company_logo" class="floatLogoLeft" :alt="bottomBase.company_name">
+            </a>
+            <span v-else-if="bottomBase.company_logo!=''&&bottomBase.company_url==''">
+                <img :src="bottomBase.company_logo" class="floatLogoLeft" :alt="bottomBase.company_name">
+            </span>
+        </div>
+        <div class="foot_last_img_box">
+            <a :href="item.url" v-for="(item, index) in bottomphoto" :title="item.title">
+                <img :src="item.logo_url" :alt="item.title">
+            </a>
+        </div>
+        <!--在线客服-->
+        <HomeKefu :bottomBase="bottomBase" />
+    </footer>
+</template>
+ 
+<script setup>
+//获得route
+const route = useRoute()
+const routeName = route.name;
+
+import { useTemplateBaseStore } from '@/stores/templateBase'
+const templateBaseStore = useTemplateBaseStore()
+//获得底部基本信息 start---------------------------------------->
+//1.获得全部友情链接与底部图片
+const bottomLink = ref([])
+const bottomText = ref([])
+const bottomphoto = ref([])
+const bottomMenu = ref([])
+const bottomBase = ref({})
+const skinId = ref("")//皮肤id
+if(templateBaseStore.webSiteInfo.website_foot){
+    bottomLink.value = templateBaseStore.webSiteInfo.website_foot.link_img;
+    bottomText.value = templateBaseStore.webSiteInfo.website_foot.link_text;
+    bottomphoto.value = templateBaseStore.webSiteInfo.website_foot.link_foot;
+    bottomMenu.value = templateBaseStore.webSiteInfo.website_foot.foot_cate;
+    bottomBase.value = templateBaseStore.webSiteInfo.website_foot.foot_info;
+
+    //获得皮肤id
+    skinId.value = templateBaseStore.webSiteInfo.website_foot.foot_info.template_id;
+}
+</script>
+<style lang="less" scoped>
+    @import '@/assets/css/public/footer.less';
+    @import '@/assets/css/public/kefu.less';
+</style>

+ 342 - 0
components/template/sector/head/1200x200/1.vue

@@ -0,0 +1,342 @@
+<template>
+    <!-- <div>当前皮肤:{{ skinId }}</div> -->
+    <header>
+        <nav class="headerNav">
+            <div class="inner">
+                <div class="left">你好,欢迎来到{{webSiteName}}!</div>
+                <div class="right">
+                    <div class="menu">
+                        <button class="reg" @click="goTopic"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon1.png">商圈</button>
+                        <button class="reg" @click="goAdvertising"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon2.png">广告服务</button>
+                    </div>
+                    <div class="right-top-menu">
+                        <button class="reg" @click="goLogin" v-show="!showToken"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png">登录</button>
+                        <button class="reg" @click="goRegister" v-show="!showToken"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon4.png">注册</button>
+                        <button class="reg" @click="userCenter" v-show="showToken"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/topicon3.png">{{username}}</button>
+                        <button class="reg" @click="goSearch"><img src="http://img.bjzxtw.org.cn/master/bjzxtw/public/head/searchicon.png">搜索</button>
+                    </div>
+                    <ul class="userInfo11" v-if="isShow">
+                        <li @click="gotosystem">个人中心</li>
+                        <li @click="exit">退出</li>
+                    </ul>
+                </div>
+            </div>
+        </nav>
+        <div class="headerLogo">
+            <div class="inner">
+                <img :src="logo" :alt="webSiteName" class="left" @click="backHome">
+                <div class="titlead" v-if="adImg">
+                    <a href="http://sannongdy.org.cn/" v-if="adImg.image_url == null" target="_blank" :title="adImg.introduce"><img :src="adImg.thumb" :alt="adImg.introduce" data-tag="imgurl.ad_tag" :id="adImg.ad_tag"></a>
+                    <a :href="adImg.image_url" v-else :title="adImg.introduce"><img :src="adImg.image_src" :alt="adImg.introduce" data-tag="imgurl.ad_tag" :id="adImg.ad_tag"></a>
+                </div>
+            </div>
+        </div>
+        <el-dialog v-model="dialogTableVisible" width="800">
+            <div class="tips">
+                <p><img src="@/public/topic/tips.png"> 提示:注册请联系管理员操作!</p>
+                <p>联系电话:010-56019387</p>
+                <p>QQ : 2909421493 、213552413</p>
+            </div>
+        </el-dialog>
+    </header>
+</template>
+
+<script setup>
+
+//1.加载基本依赖 start ---------------------------------------->
+import { ref, watch, onMounted } from 'vue'
+import { ElDialog } from 'element-plus'
+import { getToken, setToken, removeToken } from '@/store/useCookieStore'
+import { setTicket, removeTicket } from '@/store/useticketStore'
+import { useTemplateBaseStore } from '@/stores/templateBase'
+const templateBaseStore = useTemplateBaseStore()
+//网站地址
+const { $webUrl, $CwebUrl, $BwebUrl, $LoginWebUrl } = useNuxtApp()
+//1.加载基本依赖 end ---------------------------------------->
+
+//1.登录逻辑 start ---------------------------------------->
+let ticket = ref('')
+let token = ref('')
+let route = useRoute()
+
+//页面每次刷新先判断一下用户状态是否已经过期了
+//如果没有过期再储存token
+ticket.value = route.query.ticket
+token.value = route.query.admintoken
+
+if (ticket.value) {
+    setTicket(ticket.value)
+}
+if (token.value) {
+    setToken(token.value)
+}
+
+//搜索框
+let keyword = useState('keyword', () => '')
+//用户名
+let username = useState('username', () => '用户中心')
+//是否删除
+let isDel = useState('isDel', () => 1)
+//是否显示用户中心
+let isShow = useState('isShow', () => false)
+
+let token1 = useState("token1", () => '')
+let showToken = useState("showToken", () => '')
+token1.value = getToken()
+
+
+//检测登录状态
+let tokenStatus = ref('');
+tokenStatus.value = getToken()
+if (tokenStatus.value == undefined) {
+    // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+    // console.log('错误:未获取到用户token,如果在本地测试请忽略!');
+    // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
+} else {
+    console.log(tokenStatus.value);
+}
+
+//点击登录按钮
+let goLogin = () => {
+    //开启线上登录模式 start---------------------------------------->
+    isDel.value = 0
+    token1.value = getToken()
+    //王鹏
+    //window.open($BwebUrl + "/auth/login.php?backurl=" + $CwebUrl, '_blank');
+    //刘佳伟
+    //window.open($LoginWebUrl + "/api/goLogin?backurl=" + $CwebUrl, '_blank');
+    //党云龙
+    window.open($BwebUrl + "/#/login?backurl=" + $CwebUrl, '_blank');
+    //开启线上登录模式 end---------------------------------------->
+
+    //开启本地登录模式 start---------------------------------------->
+    // window.location.href = $BwebUrl + "/auth/login.php?backurl=" + $CwebUrl;
+    //"http://adminpre.bjzxtw.org.cn/auth/login.php?backurl=http://nwpre.bjzxtw.org.cn";
+    //开启本地登录模式 end---------------------------------------->
+}
+let dialogTableVisible = ref(false)
+
+//点击注册按钮
+let goRegister = () => {
+    dialogTableVisible.value = true
+}
+
+//点击用户中心
+let userCenter = () => {
+    if (isShow.value) {
+        isShow.value = false
+        return
+    } else {
+        isShow.value = true
+        return
+    }
+}
+
+// 添加点击事件处理函数
+const handleClickOutside = (event) => {
+    // 获取用户信息菜单元素
+    const userInfoMenu = document.querySelector('.userInfo11');
+    // 获取用户按钮元素
+    const userButton = document.querySelector('.reg img[alt="用户信息"]')?.parentElement;
+
+    // 如果点击的不是菜单本身且不是用户按钮,则隐藏菜单
+    if (userInfoMenu &&
+        !userInfoMenu.contains(event.target) &&
+        !userButton?.contains(event.target)) {
+        isShow.value = false;
+    }
+}
+//2.登录逻辑 end ---------------------------------------->
+
+//3.跳转菜单逻辑 start ---------------------------------------->
+let gotosystem = () => {
+    let url = $BwebUrl + '/#/login?userurl=' + $CwebUrl;
+    //window.location.href = url; 
+    window.open(url, '_blank');
+}
+
+//点击退出按钮
+let exit = () => {
+    window.location.href = $CwebUrl;
+
+    isDel.value = 1
+    token1.value = getToken()
+
+    let tokendata = getToken()
+
+    //王鹏
+    // let url = $BwebUrl + '/auth/logout.php?backurl=' + $CwebUrl + '&admintoken=' + tokendata;
+    //   console.log("用户退出登录======token为:", tokendata,url)
+    //刘佳伟
+    let url = $LoginWebUrl + '/api/logout?backurl=' + $CwebUrl + '&admintoken=' + tokendata;
+    window.location.href = url;
+    removeToken()
+    removeTicket()
+}
+
+//点击返回首页
+let backHome = () => {
+    window.location.href = $CwebUrl;
+}
+
+//点击搜索按钮
+let goSearch = () => {
+    const route = `/search/search?keyword=${keyword.value}`;
+    window.location.href = route;
+}
+
+// 点击广告服务
+let goAdvertising = () => {
+    //本地启动广告服务
+    //window.open('/advertising?activeName=1', '_blank');
+    //线上启动
+    if (getToken()) {
+        window.open($CwebUrl + '/advertising?activeName=1', '_blank');
+    } else {
+        goLogin()
+    }
+}
+
+//点击商圈
+let goTopic = () => {
+    if (getToken()) {
+        window.open($CwebUrl + '/topic', '_blank');
+    } else {
+        goLogin()
+    }
+}
+
+//监听token状态
+watch(token1, (newval, oldval) => {
+    //console.log(newval, oldval);
+    showToken.value = newval
+}, {
+    deep: true,
+    immediate: true,
+})
+//3.跳转菜单逻辑 end ---------------------------------------->
+
+//4.获取广告 start ---------------------------------------->
+let adImg = ref({})
+//4.获取广告 end ---------------------------------------->
+
+//5.获取登录状态 start ---------------------------------------->
+// 在组件卸载时移除事件监听
+onUnmounted(() => {
+    document.removeEventListener('click', handleClickOutside);
+})
+
+onMounted(async () => {
+    //添加监听关闭个人中心菜单
+    document.addEventListener('click', handleClickOutside);
+
+    //从客户端获取登录状态
+    //从客户端阶段开始 持续查询登录状态
+    let getLoginStatus = async () => {
+        //获得token
+        const token = getToken();
+        const { $webUrl, $CwebUrl } = useNuxtApp();
+
+        if (token == undefined) {
+            //如果没有获取到token 不访问后端获取在线状态
+            //console.log("没有获取到token!无需查询登录状态!")
+            showToken.value = false;
+
+        } else {
+            //如果获取到了token 访问后端查询状态
+            console.log("已获取到用户token,开始查询登录状态!")
+            const queryParams = new URLSearchParams({
+                token: getToken()
+            });
+            let url = `${$webUrl}/api/loginStatus?${queryParams.toString()}`
+            const responseStatus = await fetch(url, {
+                method: 'GET',
+                headers: {
+                    'Content-Type': 'application/json',
+                    'Userurl': $CwebUrl,
+                    //'token': getToken(),
+                    'Origin': $CwebUrl
+                }
+            });
+            const result = await responseStatus.json();
+            console.log(result)
+
+            if (result.code == 200) {
+                console.log("用户已经登录!");
+                showToken.value = true;
+            }
+            if (result.code == -1) {
+                isShow.value = false;
+                showToken.value = false;
+                removeToken();
+                removeTicket();
+                ElMessage.error('您没有权限登录该网站!')
+            }
+            if (result.code == -2) {
+                isShow.value = false;
+                showToken.value = false;
+                removeToken();
+                removeTicket();
+                ElMessage.error('您已退出登录!')
+            }
+        }
+    }
+    getLoginStatus();
+    setInterval(getLoginStatus, 3000);
+
+    //从客户端获取广告
+    //从客户端获取行政职能部门 加快打开速度
+    const { $webUrl, $CwebUrl } = useNuxtApp();
+
+    //广告1
+    // let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmw_top`
+    // const responseAd1 = await fetch(url, {
+    //     headers: {
+    //         'Content-Type': 'application/json',
+    //         'Userurl': $CwebUrl,
+    //         'Origin': $CwebUrl
+    //     }
+    // });
+    // const resultAd1 = await responseAd1.json();
+    // adImg.value = resultAd1.data[0];
+
+    //从客户端获取用户名
+    let userInfoUrl = `${$webUrl}/user/getUserInfo`
+    const userInfoResponse = await fetch(userInfoUrl, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const userInfo = await userInfoResponse.json();
+    if (userInfo.code == 200) {
+        username.value = userInfo.data.nickname
+    }
+})
+//5.获取登录状态 end ---------------------------------------->
+
+
+//6.获得网站基本信息与广告池 start ---------------------------------------->
+//获得网站logo
+const logo = ref("")
+const webSiteName = ref("")
+const skinId = ref("")
+if(templateBaseStore.webSiteInfo.website_head){
+    logo.value = templateBaseStore.webSiteInfo.website_head.logo;
+    webSiteName.value = templateBaseStore.webSiteInfo.website_head.title;
+    //获得皮肤id
+    skinId.value = templateBaseStore.webSiteInfo.website_foot.foot_info.template_id;
+}
+//adImg.value
+//获得广告
+if(templateBaseStore.webAdList){
+    //console.log(templateBaseStore.webAdList)
+    adImg.value = requestAd(templateBaseStore.webAdList,templateBaseStore.webSiteInfo.website_head.ad_key + "_" + "top")
+}
+//6.获得网站基本信息与广告池 end ---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/public/head.less');
+</style>

+ 49 - 0
components/template/sector/menu/1200x130/1.vue

@@ -0,0 +1,49 @@
+<template>
+    <!-- <div>当前皮肤:{{ skinId }}</div> -->
+    <div :class="'menuStyle' + skinId">
+        <div class="menuBoxBg">
+            <div class="menuBox" ref="menuBox">
+                <div v-for="(item, index) in navigation" :key="index">
+                    <NuxtLink 
+                        :href="getLinkPath(item)" 
+                        :title="item.alias"
+                        :target="item.is_url == 1 ? '_blank' : '_self'"
+                    >
+                        {{ item.alias }}
+                    </NuxtLink>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+//1.1 pinia
+import { useTemplateBaseStore } from '@/stores/templateBase'
+const templateBaseStore = useTemplateBaseStore()
+//获得皮肤id
+const skinId = ref("")
+skinId.value = templateBaseStore.webSiteInfo.website_foot.foot_info.template_id;
+
+//1.获取导航菜单 start ---------------------------------------->
+//第一行导航菜单 10个
+const navigation = ref([]);
+//获取导航菜单1 
+async function getNavigation() {
+    const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
+        method: 'GET',
+        query: {
+            'pid': 0,
+            'num': 24,
+            'placeid': 1
+        },
+    });
+    navigation.value = mkdata.data;
+}
+getNavigation();
+//1.获取导航菜单 end ---------------------------------------->
+</script>
+
+<style lang="less" scoped>
+@import url('@/assets/css/public/nav.less');
+</style>

+ 9 - 15
pages/[dir]/index.html.vue

@@ -16,6 +16,9 @@
 
 <script setup>
 //0.获得基本信息单元 start---------------------------------------->
+//0.0获得页面依赖
+import { ref, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
 //0.1获得pinia源
 import { useTemplateBaseStore } from '@/stores/templateBase'
 const templateBaseStore = useTemplateBaseStore()
@@ -49,16 +52,11 @@ if (adResponseStatus.code == 200) {
 }
 //0.获得基本信息单元 end---------------------------------------->
 
-//1.加载页面依赖 start ---------------------------------------->
-import { ref, onMounted } from 'vue';
-import { ElMessage } from 'element-plus';
-//1.加载页面依赖 end ---------------------------------------->
-
-//2.获得路由id start ---------------------------------------->
+//1.获得路由id start ---------------------------------------->
 const targetSegment = getRoutePath(1);
-//2.1 获得当前的路由id
+//1.1 获得当前的路由id
 let routeId;
-//通过导航路径反向查询导航id
+//1.2 通过导航路径反向查询导航id
 const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
     method: 'GET',
     query: {
@@ -70,12 +68,9 @@ if (getRouteId.code == 200) {
 } else {
     console.log("获得路由id出错!", getRouteId.message)
 }
-//2.获得路由id end ---------------------------------------->
-
-//4.页面数据 start ---------------------------------------->
-//4.页面数据 end ---------------------------------------->
+//1.获得路由id end ---------------------------------------->
 
-//5.设置seo信息 start---------------------------------------->
+//2.设置seo信息 start---------------------------------------->
 const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
     method: 'GET',
     query: {
@@ -89,7 +84,6 @@ if (setData.code == 200) {
     let seoKeywords = setData.data.seo_keywords;
     let seoSuffix = setData.data.suffix;
     let seoName = setData.data.website_name;
-
     useSeoMeta({
         title: seoTitle + "_" + seoSuffix,
         meta: [
@@ -100,7 +94,7 @@ if (setData.code == 200) {
 } else {
     console.log("设置频道页SEO出错!", setData.message)
 }
-//5.设置seo信息 end---------------------------------------->
+//2.设置seo信息 end---------------------------------------->
 </script>
 
 <style lang="less" scoped>

+ 78 - 17
pages/index.vue

@@ -1,9 +1,18 @@
 <template>
+    <!-- 头部 -->
+    <templateHead></templateHead>
+    <!-- 菜单 -->
+    <templateMenu></templateMenu>
+    <!-- 内容 -->
     <div>
-        <HomePageHead></HomePageHead>
-        <HomePageNavigation></HomePageNavigation>
-        <div>当前皮肤:{{ skinId }}</div>
-        <HomeAdvertising :imgurl="adImg1"></HomeAdvertising>
+        <!-- <div>当前皮肤:{{ skinId }}</div> -->
+        <!--广告组件-->
+        <templateAd :adTag="'nmw_index_0001'" :skinId="skinId" :adData="adData"></templateAd>
+        <!--头条-->
+        <templateHeadline :skinId="skinId" :templateData="testTemplateData"></templateHeadline>
+
+
+        <!-- <HomeAdvertising :imgurl="adImg1"></HomeAdvertising> -->
         <!--头条-->
         <!-- <HomePageMessage></HomePageMessage> -->
         <!-- 第一部分 -->
@@ -427,19 +436,35 @@
                 </div>
             </div>
         </div> -->
-
-        <HomeFoot></HomeFoot>
     </div>
+    <!-- 底部 -->
+    <templateFoot></templateFoot>
 </template>
 
 <script setup>
-//0.获得基本信息单元 start---------------------------------------->
-//0.1获得pinia源
+//0.加载全局模板组件 start---------------------------------------->
+//0.1 全局通栏
+import templateHead from '@/components/template/sector/head/1200x200/1.vue'
+import templateMenu from '@/components/template/sector/menu/1200x130/1.vue'
+import templateFoot from '@/components/template/sector/foot/1200x580/1.vue'
+//0.2 局部通栏
+//0.2.1 广告组件
+import templateAd from '@/components/template/sector/body/ad/1200x90/1.vue'
+//0.2.2 网站头条
+import templateHeadline from '@/components/template/sector/body/index/headline/1200x140/1.vue'
+
+//0.加载全局模板组件 end---------------------------------------->
+
+//1.获得基本信息单元 start---------------------------------------->
+//1.1获得页面依赖
+import { ref, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
+//1.2获得pinia源
 import { useTemplateBaseStore } from '@/stores/templateBase'
 const templateBaseStore = useTemplateBaseStore()
-//0.2获得该页的皮肤id - 在每个组件中也是同样的获得方法
+//1.3获得该页的皮肤id - 在每个组件中也是同样的获得方法
 const skinId = ref("")
-//0.3获得站点基本信息
+//1.4获得站点基本信息
 const responseStatus = await requestDataPromise('/web/getWebsiteAllinfo', {
     method: 'GET',
     query: {
@@ -467,7 +492,8 @@ if (responseStatus.code == 200) {
         ]
     });
 }
-//0.4获得广告池
+//1.5获得广告池
+const adData = ref([]);
 const adResponseStatus = await requestDataPromise('/web/getWebsiteAdvertisement', {
     method: 'GET',
     query: {},
@@ -475,17 +501,52 @@ const adResponseStatus = await requestDataPromise('/web/getWebsiteAdvertisement'
 if (adResponseStatus.code == 200) {
     //console.log(responseStatus.data)
     templateBaseStore.setAdList(adResponseStatus.data)
+    adData.value = adResponseStatus.data;
     //获取广告
     //adImg.value = requestAd(templateBaseStore.webAdList,templateBaseStore.webSiteInfo.website_head.ad_key + "_" + "top")
 }
-//0.获得基本信息单元 end---------------------------------------->
-
-//1.加载页面必备组件 start---------------------------------------->
-import { ref, onMounted } from 'vue';
-import { ElMessage } from 'element-plus';
-//1.加载页面必备组件 end---------------------------------------->
+//1.获得基本信息单元 end---------------------------------------->
 
 //2.页面数据 start---------------------------------------->
+//2.0 测试数据 后期移除
+const testTemplateData = {
+    "sectorName": "text",
+    "componentList": [
+        {
+            "component_type": 1,//1=新闻 2=广告
+            "component_style": 1,//样式
+            "sort": 1,//组件位置
+            "data": {
+                "text": [
+                    {
+                        "id": 50079,
+                        "title": "以生态为内核推动文旅发展海南深山黎寨找到乡村振兴金钥匙",
+                        "islink": 0,
+                        "pinyin": "sannongtansuo/jiaodianfangtan"
+                    },
+                    {
+                        "id": 50136,
+                        "title": "以生态为内核推动文旅发展海南深山黎寨找到乡村振兴金钥匙",
+                        "islink": 0,
+                        "pinyin": "sannongzhichuang"
+                    },
+                    {
+                        "id": 50137,
+                        "title": "以生态为内核推动文旅发展海南深山黎寨找到乡村振兴金钥匙",
+                        "islink": 0,
+                        "pinyin": "sannongzhichuang"
+                    },
+                    {
+                        "id": 50138,
+                        "title": "以生态为内核推动文旅发展海南深山黎寨找到乡村振兴金钥匙",
+                        "islink": 0,
+                        "pinyin": "sannongzhichuang"
+                    }
+                ],
+            }
+        }
+    ],    
+}
 //2.页面数据 end---------------------------------------->
 </script>