jwyu 2 years ago
parent
commit
a04fd51d04
2 changed files with 19 additions and 8 deletions
  1. 9 0
      api/report.js
  2. 10 8
      pages-report/previewImage.vue

+ 9 - 0
api/report.js

@@ -98,4 +98,13 @@ export const apiSpecialColumnReportList=params=>{
  */
 export const apiChapterTickerValue=params=>{
     return httpGet('/report/chapter/ticker',params)
+}
+
+/**
+ * 报告对应的ppt图片
+ * @param report_id 报告id
+ * @param report_chapter_id 报告章节id
+ */
+export const apiReportPPtImgs=params=>{
+    return httpGet('/report/ppt_img',params)
 }

+ 10 - 8
pages-report/previewImage.vue

@@ -50,7 +50,7 @@
 </template>
 
 <script>
-import {apiReportDetail} from '@/api/report'
+import {apiReportPPtImgs} from '@/api/report'
 export default {
     data() {
         return {
@@ -58,26 +58,28 @@ export default {
             imgList:[],
             activeIndex:0,
             reportId:0,
+            chapterId:0,//章节id 
             aid:''
         }
     },
     onLoad(options){
         this.reportId=options.reportId
-        this.getDetail()
+        this.chapterId=options.chapterId
+        this.getReportPPtImgs()
         uni.setPageOrientation({orientation : "landscape"})
     },
     onUnLoad(){
         uni.setPageOrientation({orientation : "portrait"})
     },
     methods: {
-        // 获取报告详情
-        async getDetail(){
-            const res=await apiReportDetail({
-                report_id:Number(this.reportId)
+        // 获取ppt图片
+        async getReportPPtImgs(){
+            const res=await apiReportPPtImgs({
+                report_id:Number(this.reportId),
+                report_chapter_id:Number(this.chapterId)
             })
             if(res.code===200){
-                const arr=res.data.report_info.ppt_img_list.split(';')
-                this.imgList=arr||[]
+                this.imgList=res.data||[]
             }else{
                 uni.showToast({
                     title: res.msg,