Browse Source

Merge branch 'yb3.5'

jwyu 2 years ago
parent
commit
e7ca9b3480
4 changed files with 60 additions and 4 deletions
  1. 9 0
      src/api/report.js
  2. BIN
      src/assets/ppt-icon.png
  3. 26 2
      src/views/report/ChapterDetail.vue
  4. 25 2
      src/views/report/Detail.vue

+ 9 - 0
src/api/report.js

@@ -213,4 +213,13 @@ export const apiDelMyComment=params=>{
  */
 export const apiRddpShareImg=params=>{
     return post('/report/detail/rddp_share_img',{source:'rddp_share_img',...params})
+}
+
+/**
+ * 报告对应的ppt图片
+ * @param report_id 报告id
+ * @param report_chapter_id 报告章节id
+ */
+export const apiReportPPtImgs=params=>{
+    return get('/report/ppt_img',params)
 }

BIN
src/assets/ppt-icon.png


+ 26 - 2
src/views/report/ChapterDetail.vue

@@ -5,7 +5,8 @@ import {
     apiChapterTickerValue,
     apiReportMoreRecmd,
     apiReportDetailBanner,
-    apiRddpShareImg
+    apiRddpShareImg,
+    apiReportPPtImgs
 } from '@/api/report'
 import {apiApplyPermission} from '@/api/user'
 import {apiGetWechatQRCode} from '@/api/common'
@@ -22,6 +23,19 @@ const router=useRouter()
 let chapterId=ref(route.query.chapterId||'') //章节id
 let frompage=ref(route.query.frompage||'')//如果来自报告详情页 则展示底部章节列表
 
+//获取报告对应的ppt图片
+const pptIcon=new URL('../../assets/ppt-icon.png', import.meta.url).href
+let pptImgs=ref([])
+const getReportPPTImgs=async (e)=>{
+    const res=await apiReportPPtImgs({
+        report_id:Number(e.report_id),
+        report_chapter_id:Number(e.report_chapter_id)
+    })
+    if(res.code===200){
+        pptImgs.value=res.data||[]
+    }
+}
+
 //获取晨报中指标数据
 let tickerInfo=ref(null)
 let tickerHead=ref([])
@@ -122,6 +136,7 @@ const getChapterReportDetail=async ()=>{
         if(res.data.auth_ok&&frompage.value=='reportdetail'){
             getAsideMoreRecmd(res.data.report_chapter_item)
             getAsideBanner(res.data.report_chapter_item)
+            getReportPPTImgs(res.data.report_chapter_item)
         }
 
         //向小程序发送分享数据
@@ -332,7 +347,7 @@ const posterParams=computed(()=>{
                         <span>FICC团队</span>
                         <span>{{moment(info.report_chapter_item.publish_time).format('YYYY.MM.DD HH:mm')}}</span>
                     </div>
-                    <div class="flex tips">
+                    <div class="flex tips" style="position:relative">
                         <div>
                             <div class="abstract" v-if="info.report_chapter_item.abstract">摘要:{{info.report_chapter_item.abstract}}</div>
                             <div>
@@ -340,6 +355,15 @@ const posterParams=computed(()=>{
                                 <span style="color:#F3A52F;margin-left:20px;cursor: pointer;" @click="showDisclaimers=true">免责声明</span>
                             </div>
                         </div>
+                        <el-image
+                            style="width: 24px; height: 24px;position: absolute;right:0;bottom:0"
+                            :src="pptIcon"
+                            :preview-src-list="pptImgs"
+                            :initial-index="0"
+                            fit="cover"
+                            preview-teleported
+                            v-if="pptImgs.length>0"
+                        />
                     </div>
                     <AudioBox :data="audioData" v-if="info.report_chapter_item.video_url&&info.report_chapter_item.video_play_seconds>0"></AudioBox>
                     <!-- <div class="abstract" v-if="info.report_chapter_item.abstract">摘要:{{info.report_chapter_item.abstract}}</div> -->

+ 25 - 2
src/views/report/Detail.vue

@@ -6,7 +6,7 @@ import 'moment/dist/locale/zh-cn'
 import AudioBox from './components/AudioBox.vue'
 import SharePoster from '@/components/SharePoster.vue'
 import Comment from '@/components/Comment.vue'
-import {apiReportDetail,apiReportMoreRecmd,apiReportDetailBanner,apiRddpShareImg} from '@/api/report'
+import {apiReportDetail,apiReportMoreRecmd,apiReportDetailBanner,apiRddpShareImg,apiReportPPtImgs} from '@/api/report'
 import {apiGetWechatQRCode} from '@/api/common'
 import { useRoute , onBeforeRouteUpdate,useRouter} from 'vue-router';
 import { useStore } from 'vuex';
@@ -18,6 +18,19 @@ const store=useStore()
 
 let reportId=ref(route.query.reportId||'')
 
+//获取报告对应的ppt图片
+const pptIcon=new URL('../../assets/ppt-icon.png', import.meta.url).href
+let pptImgs=ref([])
+const getReportPPTImgs=async ()=>{
+    const res=await apiReportPPtImgs({
+        report_id:Number(reportId.value),
+        report_chapter_id:0
+    })
+    if(res.code===200){
+        pptImgs.value=res.data||[]
+    }
+}
+
 // 获取报告详情
 let info=ref(null)
 let audioData=ref(null)
@@ -62,6 +75,7 @@ const getReportDetail=async ()=>{
         if(res.data.auth_ok){
             getAsideMoreRecmd(res.data.report_info)
             getAsideBanner(res.data.report_info)
+            getReportPPTImgs()
         }
 
         //向小程序发送分享数据
@@ -381,7 +395,7 @@ const formatTitle=(e)=>{
                         <span>FICC团队</span>
                         <span>{{moment(info.report_info.publish_time).format('YYYY.MM.DD HH:mm')}}</span>
                     </div>
-                    <div class="flex tips">
+                    <div class="flex tips" style="position:relative">
                         <div>
                             <div class="abstract" v-if="info.report_info.abstract">摘要:{{info.report_info.abstract}}</div>
                             <div>
@@ -389,6 +403,15 @@ const formatTitle=(e)=>{
                                 <span style="color:#F3A52F;margin-left:20px;cursor: pointer;" @click="showDisclaimers=true">免责声明</span>
                             </div>
                         </div>
+                        <el-image
+                            style="width: 24px; height: 24px;position: absolute;right:0;bottom:0"
+                            :src="pptIcon"
+                            :preview-src-list="pptImgs"
+                            :initial-index="0"
+                            fit="cover"
+                            preview-teleported
+                            v-if="pptImgs.length>0"
+                        />
                     </div>
                     <!-- 音频模块 -->
                     <AudioBox :data="audioData" v-if="info.report_info.video_url&&info.report_info.video_play_seconds>0"></AudioBox>