Browse Source

Merge branch 'rddp-share'

jwyu 2 years ago
parent
commit
8bd2385fb6
2 changed files with 21 additions and 2 deletions
  1. 8 0
      src/api/report.js
  2. 13 2
      src/views/report/Detail.vue

+ 8 - 0
src/api/report.js

@@ -204,4 +204,12 @@ export const apiReportHotCommentList=params=>{
  */
 export const apiDelMyComment=params=>{
     return post('/comment/del',params)
+}
+
+/**
+ * 日度点评分享图片
+ * @param title
+ */
+export const apiRddpShareImg=params=>{
+    return post('/report/detail/rddp_share_img',params)
 }

+ 13 - 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} from '@/api/report'
+import {apiReportDetail,apiReportMoreRecmd,apiReportDetailBanner,apiRddpShareImg} from '@/api/report'
 import {apiGetWechatQRCode} from '@/api/common'
 import { useRoute , onBeforeRouteUpdate,useRouter} from 'vue-router';
 import { useStore } from 'vuex';
@@ -67,6 +67,7 @@ const getReportDetail=async ()=>{
         //向小程序发送分享数据
         //处理分享标题
         let shareTitle=''
+        let shareImg=''
         const shareTime=moment(res.data.report_info.publish_time).format('MMDD')
         if(['晨报','周报'].includes(res.data.report_info.classify_name_first)){
             shareTitle=`【${res.data.report_info.classify_name_first}】${res.data.report_info.title}(${shareTime})`
@@ -83,13 +84,23 @@ const getReportDetail=async ()=>{
                 shareTitle=`【${res.data.report_info.classify_name_second}】${res.data.report_info.title}(${shareTime})`
             }
         }
+        // 日度点评
+        if(res.data.report_info.classify_name_first==='日度点评'){
+            shareTitle=res.data.report_info.abstract||'FICC日度点评'
+            const rddpImgRes=await apiRddpShareImg({
+                title:`【第${res.data.report_info.stage}期】${res.data.report_info.title}(${shareTime})`
+            })
+            if(rddpImgRes.code===200){
+                shareImg=rddpImgRes.data
+            }
+        }
         const postData={
             path:'/pages-report/reportDetail',
             params:{
                 reportId:reportId.value
             },
             title:shareTitle,
-            shareImg:''
+            shareImg:shareImg
         }
         wx.miniProgram.postMessage({ data: postData })