Browse Source

修改bug

Jing 10 hours ago
parent
commit
a55a01dae9
5 changed files with 279 additions and 242 deletions
  1. 189 158
      assets/css/public/kefu.less
  2. 2 2
      components/home/kefu.vue
  3. 16 17
      pages/[dir]/[dir]/[id].vue
  4. 67 60
      pages/[dir]/[id].vue
  5. 5 5
      pages/search/search.vue

+ 189 - 158
assets/css/public/kefu.less

@@ -1,161 +1,192 @@
 //添加在线客服
 .kefu {
-  bottom: 100px;
-  height: 430px;
-  position: fixed;
-  right: 10px;
-  width: 100px;
-  .kefu_itemKf {
-      background-color: #fff;
-      border-radius: 10px;
-      box-shadow: 0 4px 16px #0000001a;
-      height: 100px;
-      margin-bottom: 15px;
-      text-align: center;
-      width: 100px;
-      box-sizing: border-box;
-      position: relative;
-      cursor: pointer;
-      margin-bottom: 100px;
-      a {
-          >p {
-              color: #666;
-              font-size: 14px;
-              font-weight: 500;
-              line-height: 16px;
-          }
-          >img {
-              margin-top: 15px;
-              width: 50px;
-              height:50px;
-              margin-bottom: 5px;
-          }
-      }
-  }
-  .kefu_itemQQ {
-      background-color: #fff;
-      border-radius: 10px;
-      box-shadow: 0 4px 16px #0000001a;
-      height: 100px;
-      margin-bottom: 15px;
-      text-align: center;
-      width: 100px;
-      box-sizing: border-box;
-      position: relative;
-      cursor: pointer;
-      >p {
-          color: #666;
-          font-size: 14px;
-          font-weight: 500;
-          line-height: 16px;
-      }
-      >img {
-          margin-top: 10px;
-          width: 60px;
-          height: 60px;
-      }
-      &:hover {
-          .kefu_item_content_QQ {
-              display: block;
-          }
-      }
-  }
-  .kefu_itemPhone {
-      background-color: #fff;
-      border-radius: 10px;
-      box-shadow: 0 4px 16px #0000001a;
-      height: 100px;
-      margin-bottom: 15px;
-      text-align: center;
-      width: 100px;
-      box-sizing: border-box;
-      position: relative;
-      cursor: pointer;
-      >p {
-          color: #666;
-          font-size: 14px;
-          font-weight: 500;
-          line-height: 16px;
-      }
-      >img {
-          margin-top: 10px;
-          width: 60px;
-          height: 60px;
-      }
-      &:hover {
-          .kefu_item_content_phone {
-              display: block;
-          }
-      }
-  }
-  .kefu_item_content_QQ {
-      position: absolute;
-      top: -100px;
-      right: 100px;
-      background: #fff;
-      border-radius: 10px;
-      display: none;
-      width: 190px;
-      height: 330px;
-      background: #fff;
-      box-shadow: 0 4px 16px #0000001a;
-      z-index: 99;
-      box-sizing: border-box;
-      padding: 20px;
-      img {
-          margin-bottom: 10px;
-      }
-      .qqfs {
-          margin-bottom: 20px;
-          font-size: 14px;
-          color: #333;
-      }
-      .arrow {
-          width: 0;
-          height: 0;
-          width: 0;
-          border-top: 20px solid transparent;
-          border-bottom: 20px solid transparent; 
-          border-left: 20px solid #fff; 
-          position: absolute;
-          top: 120px;
-          right: -20px;
-          transform: translateX(-50%);
-          z-index: 100;
-      }
-  }
-  .kefu_item_content_phone {
-      position: absolute;
-      top: 0;
-      right: 100px;
-      background: #fff;
-      border-radius: 10px;
-      display: none;
-      width: 190px;
-      height: 80px;
-      background: #fff;
-      box-shadow: 0 4px 16px #0000001a;
-      z-index: 99;
-      box-sizing: border-box;
-      padding: 20px;
-      text-align: left;
-      color: #333;
-      .kefu_item_content_phone_title {
-          margin-bottom: 5px;
-          font-weight: bold;
-      }
-      .arrow {
-          width: 0;
-          height: 0;
-          width: 0;
-          border-top: 20px solid transparent;
-          border-bottom: 20px solid transparent; 
-          border-left: 20px solid #fff; 
-          position: absolute;
-          top: 20px;
-          right: -20px;
-          transform: translateX(-50%);
-          z-index: 100;
-      }
-  }
+    bottom: 100px;
+    height: 430px;
+    position: fixed;
+    right: 10px;
+    width: 100px;
+
+    .kefu_itemKf {
+        background-color: #fff;
+        border-radius: 10px;
+        box-shadow: 0 4px 16px #0000001a;
+        height: 100px;
+        margin-bottom: 15px;
+        text-align: center;
+        width: 100px;
+        box-sizing: border-box;
+        position: relative;
+        cursor: pointer;
+        margin-bottom: 100px;
+
+        a {
+            >p {
+                color: #666;
+                font-size: 14px;
+                font-weight: 500;
+                line-height: 16px;
+            }
+
+            >img {
+                margin-top: 15px;
+                width: 50px;
+                height: 50px;
+                margin-bottom: 5px;
+            }
+        }
+    }
+
+    .kefu_itemQQ {
+        background-color: #fff;
+        border-radius: 10px;
+        box-shadow: 0 4px 16px #0000001a;
+        height: 100px;
+        margin-bottom: 15px;
+        text-align: center;
+        width: 100px;
+        box-sizing: border-box;
+        position: relative;
+        cursor: pointer;
+
+        >p {
+            color: #666;
+            font-size: 14px;
+            font-weight: 500;
+            line-height: 16px;
+        }
+
+        >img {
+            margin-top: 10px;
+            width: 60px;
+            height: 60px;
+        }
+
+        &:hover {
+            .kefu_item_content_QQ {
+                display: block;
+            }
+        }
+    }
+
+    .kefu_itemPhone {
+        background-color: #fff;
+        border-radius: 10px;
+        box-shadow: 0 4px 16px #0000001a;
+        height: 100px;
+        margin-bottom: 15px;
+        text-align: center;
+        width: 100px;
+        box-sizing: border-box;
+        position: relative;
+        cursor: pointer;
+
+        >p {
+            color: #666;
+            font-size: 14px;
+            font-weight: 500;
+            line-height: 16px;
+        }
+
+        >img {
+            margin-top: 10px;
+            width: 60px;
+            height: 60px;
+        }
+
+        &:hover {
+            .kefu_item_content_phone {
+                display: block;
+            }
+        }
+    }
+
+    .kefu_item_content_QQ {
+        position: absolute;
+        top: -100px;
+        right: 100px;
+        background: #fff;
+        border-radius: 10px;
+        display: none;
+        width: 190px;
+        height: 330px;
+        background: #fff;
+        box-shadow: 0 4px 16px #0000001a;
+        z-index: 99;
+        box-sizing: border-box;
+        padding: 20px;
+
+        img {
+            margin-bottom: 10px;
+        }
+
+        .arrow {
+            width: 0;
+            height: 0;
+            width: 0;
+            border-top: 20px solid transparent;
+            border-bottom: 20px solid transparent;
+            border-left: 20px solid #fff;
+            position: absolute;
+            top: 120px;
+            right: -20px;
+            transform: translateX(-50%);
+            z-index: 100;
+        }
+
+        .qqadd {
+            height: 150px;
+            position: relative;
+
+            img {
+                width: 100px;
+                height: 100px;
+            }
+
+            .qqfs {
+                margin-bottom: 20px;
+                font-size: 14px;
+                color: #333;
+                position: absolute;
+                top: 110px;
+                left: 0;
+            }
+        }
+    }
+
+    .kefu_item_content_phone {
+        position: absolute;
+        top: 0;
+        right: 100px;
+        background: #fff;
+        border-radius: 10px;
+        display: none;
+        width: 190px;
+        height: 80px;
+        background: #fff;
+        box-shadow: 0 4px 16px #0000001a;
+        z-index: 99;
+        box-sizing: border-box;
+        padding: 20px;
+        text-align: left;
+        color: #333;
+
+        .kefu_item_content_phone_title {
+            margin-bottom: 5px;
+            font-weight: bold;
+        }
+
+        .arrow {
+            width: 0;
+            height: 0;
+            width: 0;
+            border-top: 20px solid transparent;
+            border-bottom: 20px solid transparent;
+            border-left: 20px solid #fff;
+            position: absolute;
+            top: 20px;
+            right: -20px;
+            transform: translateX(-50%);
+            z-index: 100;
+        }
+    }
 }

+ 2 - 2
components/home/kefu.vue

@@ -12,11 +12,11 @@
       <p>QQ客服</p>
       <div class="kefu_item_content_QQ">
           <div @click="addQQFriend(bottomBase.customer_service_qq)" class="qqadd">
-              <img :src="bottomBase.service_qq_img" width="100">
+              <img :src="bottomBase.service_qq_img" width="100" v-if="bottomBase.service_qq_img">
               <div class="qqfs">{{bottomBase.customer_service_qq}}</div>
           </div>
           <div @click="addQQFriend(bottomBase.communications)" class="qqadd">
-              <img :src="bottomBase.communications_img" width="100">
+              <img :src="bottomBase.communications_img" width="100" v-if="bottomBase.communications_img">
               <div class="qqfs">{{bottomBase.communications}}</div>
           </div>
           <div class="arrow"></div>

+ 16 - 17
pages/[dir]/[dir]/[id].vue

@@ -126,6 +126,9 @@
         </div>
     </div>
 
+    <!-- 广告1 -->
+    <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
+
     <!-- 页面底部 -->
     <HomeFoot1></HomeFoot1>
 </template>
@@ -133,7 +136,7 @@
 <script setup>
 //1.页面依赖 start ---------------------------------------->
 import { onMounted } from 'vue'
-import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox,ElCheckboxGroup, ElMessage ,ElInput} from 'element-plus'
+import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElCheckbox, ElCheckboxGroup, ElMessage, ElInput } from 'element-plus'
 import { ArrowRight } from '@element-plus/icons-vue'
 
 
@@ -247,22 +250,7 @@ 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();
+let adImg2 = ref([]);
 
 onMounted(async () => {
     const { $webUrl, $CwebUrl } = useNuxtApp();
@@ -277,6 +265,17 @@ onMounted(async () => {
     });
     const resultAd1 = await responseAd1.json();
     adImg1.value = resultAd1.data[0];
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_detail_0002`
+    const responseAd2 = await fetch(url2, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd2 = await responseAd2.json();
+    adImg2.value = resultAd2.data[0];
 })
 
 //2.页面数据 end ---------------------------------------->

+ 67 - 60
pages/[dir]/[id].vue

@@ -52,69 +52,60 @@
                     <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>
+                            <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"/>
+                                <!--投票选项-->
+                                <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>
-                                        </span>
-                                    </el-checkbox-group>
-                                    <el-input
-                                        v-if="showUserChoice"
-                                        v-model="userChoice"
-                                        :rows="2"
-                                        type="textarea"
-                                        resize="none"
-                                        placeholder="请输入.."
-                                    />
+                                        </el-checkbox-group>
+                                        <el-input v-if="showUserChoice" v-model="userChoice" :rows="2" type="textarea"
+                                            resize="none" placeholder="请输入.." />
+                                    </div>
                                 </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 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="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 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 class="inquireDataItemNum">{{item.results}}票</div>
                                     </div>
                                 </div>
                             </div>
-                            </div>
                             <div class="btn">
-                                <button class="voting" @click="addWebsiteSurvey" :disabled="isDisabled" v-if="!isDisabled">投票</button>
+                                <button class="voting" @click="addWebsiteSurvey" :disabled="isDisabled"
+                                    v-if="!isDisabled">投票</button>
                             </div>
                         </div>
                     </div>
@@ -133,6 +124,9 @@
             </div>
         </div>
     </div>
+
+    <!-- 广告2 -->
+    <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
     <!-- 页面底部 -->
     <HomeFoot1></HomeFoot1>
 </template>
@@ -140,7 +134,7 @@
 <script setup>
 //1.页面依赖 start ---------------------------------------->
 import { onMounted } from 'vue'
-import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup ,ElMessage,ElCheckboxGroup,ElCheckbox,ElInput} from 'element-plus'
+import { ElBreadcrumb, ElBreadcrumbItem, ElRadio, ElRadioGroup, ElMessage, ElCheckboxGroup, ElCheckbox, ElInput } from 'element-plus'
 import { ArrowRight } from '@element-plus/icons-vue'
 
 //1.1 获得跳转过来的id
@@ -256,6 +250,7 @@ getPageData();
 //2.5 获得广告
 //广告列表
 let adImg1 = ref([]);
+let adImg2 = ref([]);
 
 onMounted(async () => {
     const { $webUrl, $CwebUrl } = useNuxtApp();
@@ -270,6 +265,18 @@ onMounted(async () => {
     });
     const resultAd1 = await responseAd1.json();
     adImg1.value = resultAd1.data[0];
+
+    //广告2
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_detail_0002`
+    const responseAd2 = await fetch(url2, {
+        headers: {
+            'Content-Type': 'application/json',
+            'Userurl': $CwebUrl,
+            'Origin': $CwebUrl
+        }
+    });
+    const resultAd2 = await responseAd2.json();
+    adImg2.value = resultAd2.data[0];
 })
 
 //2.页面数据 end ---------------------------------------->
@@ -321,7 +328,7 @@ let voteList = ref([]);
 async function getVoteList() {
     const voteData = await requestHome('/web/getWebsiteSurvey', { method: 'GET', query: { 'art_id': articleId } });
     console.log(778899)
-    console.log('778899',voteData)
+    console.log('778899', voteData)
     if (voteData.code == 200) {
         voteList.value = voteData.data;
         console.log(voteList.value)
@@ -354,7 +361,7 @@ async function getVoteList() {
 
 //3.2当用户选择了选项,判断是否展示其他输入框
 const handleRadioChange = (value) => {
-    console.log('11111',value,userIsChoice.value);
+    console.log('11111', value, userIsChoice.value);
     if (value == userIsChoice.value) {
         showUserChoice.value = true;
     } else {
@@ -428,9 +435,9 @@ async function addWebsiteSurvey() {
                     ElMessage.error('请输入选项内容!')
                 }
             } else {
-                console.log('111',userSurId.value);
-                console.log('222',radio1.value);
-                
+                console.log('111', userSurId.value);
+                console.log('222', radio1.value);
+
                 //如果没选择其他,直接提交选择的内容
                 const mkData = await requestHome('/web/addWebsiteSurveyVote', {
                     method: 'GET',

+ 5 - 5
pages/search/search.vue

@@ -3,9 +3,9 @@
         <!-- 页面头部 -->
         <HomePageHead></HomePageHead>
         <!-- 导航栏 -->
-        <HomePageNavigation1></HomePageNavigation1>
+        <HomePageNavigation></HomePageNavigation>
         <!-- 列表页广告一 -->
-        <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
+        <HomeAdvertising :imgurl="adImg1" v-if="adImg1"></HomeAdvertising>
         <!-- 搜索框 -->
         <div class="search">
             <div class="inner">
@@ -51,7 +51,7 @@
             </div>
         </div>
         <!-- 列表页广告二 -->
-        <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
+        <HomeAdvertising :imgurl="adImg1" v-if="adImg1"></HomeAdvertising>
         <!-- 页面底部 -->
         <HomeFoot1></HomeFoot1>
     </div>
@@ -97,7 +97,7 @@ onMounted(async () => {
     //从客户端获取行政职能部门 加快打开速度
     const { $webUrl, $CwebUrl } = useNuxtApp();
     //广告1
-    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_search_0001`
+    let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_search_0001`
     const responseAd1 = await fetch(url, {
         headers: {
             'Content-Type': 'application/json',
@@ -109,7 +109,7 @@ onMounted(async () => {
     adImg1.value = resultAd1.data[0];
 
     //广告2
-    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_search_0002`
+    let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=xcw_search_0002`
     const responseAd2 = await fetch(url2, {
         headers: {
             'Content-Type': 'application/json',