bding hai 4 semanas
pai
achega
687fd8249a
Modificáronse 3 ficheiros con 78 adicións e 33 borrados
  1. 20 18
      src/router/index.js
  2. 30 8
      src/views/hzyb/report/ChapterDetail.vue
  3. 28 7
      src/views/hzyb/report/Detail.vue

+ 20 - 18
src/router/index.js

@@ -1,23 +1,25 @@
-import { createRouter, createWebHistory } from "vue-router";
-import { hzybRoutes } from "./hzyb/index"; // 弘则研报小程序路由
-import { cygxRoutes } from "./cygx/index"; // 查研观向小程序路由
-import { hzslRoutes } from "./hzsl/index"; // 弘则思路小程序路由
-import { htgjRoutes } from "./htgj/index"; // 海通国际 APP 路由
+
+import { createRouter, createWebHistory } from 'vue-router'
+import {hzybRoutes} from './hzyb/index'// 弘则研报小程序路由
+import {cygxRoutes} from './cygx/index'// 查研观向小程序路由
+import {hzslRoutes} from './hzsl/index'// 弘则思路小程序路由
+// import { htgjRoutes } from "./htgj/index"; // 海通国际 APP 路由
 import { ssbgRoutes } from './ssbg';//随手办公
 import store from "@/store";
-const routes = [
-  ...hzybRoutes,
-  ...cygxRoutes,
-  ...hzslRoutes,
-  ...htgjRoutes,
-  ...ssbgRoutes,
-  //404
-  {
-    path: "/:pathMatch(.*)",
-    name: "404",
-    component: () => import("@/views/Error.vue"),
-  },
-];
+
+const routes=[
+    ...hzybRoutes,
+    ...cygxRoutes,
+    ...hzslRoutes,
+    // ...htgjRoutes,
+    ...ssbgRoutes,
+    //404
+    {
+        path: "/:pathMatch(.*)",
+        name:"404",
+        component: () => import("@/views/Error.vue"),
+    },
+]
 
 const router = createRouter({
   history: createWebHistory(import.meta.env.VITE_APP_BASE_URL),

+ 30 - 8
src/views/hzyb/report/ChapterDetail.vue

@@ -1,12 +1,12 @@
 <template>
 <van-pull-refresh v-model="loading" disabled style="min-height:100vh">
-  <!-- <div class="content-swipe" v-if="bannerDataList.length > 0">
+  <div class="content-swipe" v-if="bannerDataList.length > 0">
         <van-swipe class="my-swipe" :autoplay="4000" :show-indicators="false">
             <van-swipe-item v-for="item in bannerDataList" :key="item.id" @click="bannerSwiperHandler(item)">
                 <img :src="item.image_url_mobile" />
             </van-swipe-item>
         </van-swipe>
-  </div> -->
+  </div>
   <div class="chapter-detail-page" v-if="info" :style="{paddingBottom:$store.state.hzyb.audioData.url&&'80px'}">
     <div :class="['main-box',!info.auth_ok&&'main-box-noauth']">
       <!-- <div class="title">【第{{info.report_chapter_item.stage}}期 | {{info.report_chapter_item.classify_name_first}}  | {{info.report_chapter_item.type_name}}】{{info.report_chapter_item.title}}</div> -->
@@ -285,7 +285,7 @@ export default {
     this.fromPage=this.$route.query.fromPage||''
     this.getDetail()
     this.getConfig()
-    // this.getBannerList()
+    this.getBannerList()
   },
   mounted(){
         $(document).on('click', '.rich-content img',function(event) {
@@ -308,10 +308,32 @@ export default {
   methods: {
     // banner 获取列表
     async getBannerList(){
-      const res = await apiPublicBannerList()
+          const res = await apiPublicBannerList({
+            banner_type: 1
+          })
           if(res.code ==200){
-            this.bannerDataList = res.data
-          }
+              let isBo = res.data.some(item => {
+                  try {
+                      // 安全解析JSON并处理空值
+                      const ignoreReport = JSON.parse(item.ignore_report || "{}") || {}
+                      
+                      // 获取目标ID并统一类型为数字
+                      const targetId = Number(this.chapterId)
+                      
+                      // 获取忽略列表并统一元素类型
+                      const ignoreList = (ignoreReport.report_id_list || [])
+                      .map(Number)  // 确保数组元素为数字类型
+                      
+                      // 返回是否包含目标ID
+                      return ignoreList.includes(targetId)
+                  } catch (error) {
+                      // 错误处理(根据需求选择处理方式)
+                      console.error('JSON解析失败:', error)
+                      return false  // 解析失败时视为不包含
+                  }
+              })
+              this.bannerDataList = isBo ? [] :  res.data
+            }
     },
     getConfig() {
       apiBaseConfig().then(res => {
@@ -325,11 +347,11 @@ export default {
          const res = await apiPublicBannerMark({
              first_source: 1, //一级来源 1小程序移动 2小程序pc 3研报官网
              second_source: 2, //二级来源 1首页 2研报详情页
-             id:item.id
+             id:item.id,
          })
          if(res.code===200){
            wx.miniProgram.navigateTo({
-             url:"/pages-report/disseminatePage/disseminatePage?imgHb="+item.jump_url_mobile+'&title='+item.remark
+             url: item.jump_url_mobile
            })
          }
     },

+ 28 - 7
src/views/hzyb/report/Detail.vue

@@ -1,12 +1,12 @@
 <template>
 <van-pull-refresh v-model="loading" disabled style="min-height:100vh">
-    <!-- <div class="content-swipe" v-if="bannerDataList.length > 0">
+    <div class="content-swipe" v-if="bannerDataList.length > 0">
         <van-swipe class="my-swipe" :autoplay="4000" :show-indicators="false">
             <van-swipe-item v-for="item in bannerDataList" :key="item.id" @click="bannerSwiperHandler(item)">
                 <img :src="item.image_url_mobile" />
             </van-swipe-item>
         </van-swipe>
-    </div> -->
+    </div>
     <div class="report-detail-page" @click="closeAttention" v-if="info" :style="{paddingBottom:$store.state.hzyb.audioData.url&&'80px'}">
         <!-- 晨报、周报章节 -->
         <div class="chapter-list-wrap" v-if="info.report_info.has_chapter&&info.report_detail_show_type===2">
@@ -337,7 +337,7 @@ export default {
         this.getDetail()
         this.getUserInfo()
         this.getConfig()
-        // this.getBannerList()
+        this.getBannerList()
     },
     mounted(){
         $(document).on('click', '.rich-content img',function(event) {
@@ -360,10 +360,31 @@ export default {
     methods: {
         // banner 获取列表
         async getBannerList(){
-            console.log(112233333);
-            const res = await apiPublicBannerList()
+            const res = await apiPublicBannerList({
+                 banner_type: 1
+            })
             if(res.code ===200){
-                this.bannerDataList = res.data
+                let isBo = res.data.some(item => {
+                  try {
+                      // 安全解析JSON并处理空值
+                      const ignoreReport = JSON.parse(item.ignore_report || "{}") || {}
+                      
+                      // 获取目标ID并统一类型为数字
+                      const targetId = Number(this.reportId)
+                      
+                      // 获取忽略列表并统一元素类型
+                      const ignoreList = (ignoreReport.report_id_list || [])
+                      .map(Number)  // 确保数组元素为数字类型
+                      
+                      // 返回是否包含目标ID
+                      return ignoreList.includes(targetId)
+                  } catch (error) {
+                      // 错误处理(根据需求选择处理方式)
+                      console.error('JSON解析失败:', error)
+                      return false  // 解析失败时视为不包含
+                  }
+                })
+                this.bannerDataList = isBo ? [] :  res.data
             }
         },
 
@@ -383,7 +404,7 @@ export default {
             })
             if(res.code===200){
               wx.miniProgram.navigateTo({
-                url:"/pages-report/disseminatePage/disseminatePage?imgHb="+item.jump_url_mobile+'&title='+item.remark
+                url: item.jump_url_mobile
               })
             }
         },