Browse Source

修改bug

Jing 16 hours ago
parent
commit
3e6b947d5e
3 changed files with 262 additions and 224 deletions
  1. 190 158
      assets/css/public/kefu.less
  2. 9 9
      composables/publicFunction.ts
  3. 63 57
      pages/[dir]/[id].vue

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

@@ -1,161 +1,193 @@
 //添加在线客服
 .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;
+            }
+        }
+    }
+
+    .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;
+        }
+    }
 }

+ 9 - 9
composables/publicFunction.ts

@@ -48,15 +48,15 @@ const getTitleLength = function (title: string, length: number) {
 //3.格式化跳转路径 start ---------------------------------------->
 //3.1跳转到频道页面或者一级列表页
 const getLinkPath = (item: any) => {
-    if(item.is_url==1){
-        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{
-        //return `/primaryNavigation/${item.aLIas_pinyin}/`;
-        return `/${item.aLIas_pinyin}/index.html`;
-    }
+  if (item.is_url == 1) {
+    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 {
+    //return `/primaryNavigation/${item.aLIas_pinyin}/`;
+    return `/${item.aLIas_pinyin}/index.html`;
+  }
 }
 //3.2跳转到详情页
 const getLinkPathDetail = (item: any) => {

+ 63 - 57
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,8 @@
             </div>
         </div>
     </div>
+    <!-- 广告2 -->
+    <HomeAdvertising :imgurl="adImg2"></HomeAdvertising>
     <!-- 页面底部 -->
     <HomeFoot1></HomeFoot1>
 </template>
@@ -140,7 +133,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 +249,7 @@ getPageData();
 //2.5 获得广告
 //广告列表
 let adImg1 = ref([]);
+let adImg2 = ref([]);
 
 onMounted(async () => {
     const { $webUrl, $CwebUrl } = useNuxtApp();
@@ -270,6 +264,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 +327,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)
@@ -426,7 +432,7 @@ async function addWebsiteSurvey() {
                 } else {
                     ElMessage.error('请输入选项内容!')
                 }
-            } else {                
+            } else {
                 //如果没选择其他,直接提交选择的内容
                 const mkData = await requestHome('/web/addWebsiteSurveyVote', {
                     method: 'GET',