bding 1 سال پیش
والد
کامیت
33cf66b9e8
3فایلهای تغییر یافته به همراه35 افزوده شده و 11 حذف شده
  1. 11 0
      src/api/hzyb/report.js
  2. 13 6
      src/views/hzyb/report/ChapterDetail.vue
  3. 11 5
      src/views/hzyb/report/Detail.vue

+ 11 - 0
src/api/hzyb/report.js

@@ -63,4 +63,15 @@ export const apiReportPPtImgs=params=>{
  */
 export const apiPublicBannerMark = params=>{
     return post('/public/banner/mark',params)
+}
+
+/**
+ * banner图列表
+ * @param  "banner_url": "wwwwwwww",
+ * @param   "first_source": 1, //一级来源 1小程序移动 2小程序pc 3研报官网
+ * @param   "second_source": 1 //二级来源 1首页 2研报详情页
+ * @returns 
+ */
+export const apiPublicBannerList = params=>{
+    return get('/public/banner/list',params)
 }

+ 13 - 6
src/views/hzyb/report/ChapterDetail.vue

@@ -1,9 +1,9 @@
 <template>
 <van-pull-refresh v-model="loading" disabled style="min-height:100vh">
   <div class="content-swipe">
-        <van-swipe class="my-swipe" :autoplay="3000" :show-indicators="false">
+        <van-swipe class="my-swipe" :autoplay="4000" :show-indicators="bannerDataList.length>0">
             <van-swipe-item v-for="item in bannerDataList" :key="item.id" @click="bannerSwiperHandler(item)">
-                <img :src="item.IndexImg" />
+                <img :src="item.image_url_mobile" />
             </van-swipe-item>
         </van-swipe>
   </div>
@@ -153,7 +153,7 @@ import 'moment/dist/locale/zh-cn'
 moment.locale('zh-cn')
 import {addTokenToIframe} from '../utils/common'
 
-import {apiChapterDetail,apiChapterTickerValue,apiRddpShareImg,apiReportPPtImgs,apiPublicBannerMark} from '@/api/hzyb/report'
+import {apiChapterDetail,apiChapterTickerValue,apiRddpShareImg,apiReportPPtImgs,apiPublicBannerMark,apiPublicBannerList} from '@/api/hzyb/report'
 import {apiApplyPermission,apiUserInfo,apiSetCollect,apiCancelCollect} from '@/api/hzyb/user'
 import {Popup,Image as VanImage,PullRefresh,Col, Row,Dialog,Toast,Swipe, SwipeItem} from 'vant'
 import AudioBox from './components/AudioBox.vue'
@@ -232,7 +232,7 @@ export default {
 
       isReportPublishCancel:false,//报告取消发布
       bannerDataList:[
-        {IndexImg:'https://hzstatic.hzinsights.com/yb_xcx/banner.png',id:1},
+        
       ]
     };
   },
@@ -266,16 +266,23 @@ export default {
     window.removeEventListener('scroll',this.loadMoreHandle)
   },
   methods: {
+    // banner 获取列表
+    async getBannerList(){
+      const res = await apiPublicBannerList()
+          if(res.code ==200){
+            this.bannerDataList = res.data
+          }
+    },
      // banner 点击事件
     async bannerSwiperHandler(item){
          const res = await apiPublicBannerMark({
-             banner_url: item.IndexImg,
              first_source: 1, //一级来源 1小程序移动 2小程序pc 3研报官网
              second_source: 2 //二级来源 1首页 2研报详情页
+             id:item.id
          })
          if(res.code===200){
            wx.miniProgram.navigateTo({
-             url:"/pages-report/disseminatePage/disseminatePage?id="+item.id
+             url:"/pages-report/disseminatePage/disseminatePage?imgHb="+item.jump_url_mobile
            })
          }
     },

+ 11 - 5
src/views/hzyb/report/Detail.vue

@@ -1,9 +1,9 @@
 <template>
 <van-pull-refresh v-model="loading" disabled style="min-height:100vh">
     <div class="content-swipe">
-        <van-swipe class="my-swipe" :autoplay="3000" :show-indicators="false">
+        <van-swipe class="my-swipe" :autoplay="4000" :show-indicators="bannerDataList.length > 0">
             <van-swipe-item v-for="item in bannerDataList" :key="item.id" @click="bannerSwiperHandler(item)">
-                <img :src="item.IndexImg" />
+                <img :src="item.image_url_mobile" />
             </van-swipe-item>
         </van-swipe>
     </div>
@@ -254,7 +254,6 @@ export default {
             showAttention:false,//是否显示配置播放清单提示
             isReportPublishCancel:false,//报告取消发布
             bannerDataList:[
-                {IndexImg:'https://hzstatic.hzinsights.com/yb_xcx/banner.png',id:1},
             ]
         }
     },
@@ -290,16 +289,23 @@ export default {
         window.removeEventListener('scroll',this.loadMoreHandle)
     },
     methods: {
+        // banner 获取列表
+        async getBannerList(){
+        const res = await apiPublicBannerList()
+            if(res.code ==200){
+                this.bannerDataList = res.data
+            }
+        },
         // banner 点击事件
        async bannerSwiperHandler(item){
             const res = await apiPublicBannerMark({
-                banner_url: item.IndexImg,
                 first_source: 1, //一级来源 1小程序移动 2小程序pc 3研报官网
                 second_source: 2 //二级来源 1首页 2研报详情页
+                id:item.id
             })
             if(res.code===200){
               wx.miniProgram.navigateTo({
-                url:"/pages-report/disseminatePage/disseminatePage?id="+item.id
+                url:"/pages-report/disseminatePage/disseminatePage?imgHb="+item.jump_url_mobile
               })
             }
         },