Browse Source

Merge branch 'rddp-share'

jwyu 2 years ago
parent
commit
f8777ff9a4
2 changed files with 22 additions and 3 deletions
  1. 8 0
      src/api/hzyb/report.js
  2. 14 3
      src/views/hzyb/report/Detail.vue

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

@@ -35,3 +35,11 @@ export const apiChapterDetail=params=>{
 export const apiChapterTickerValue=params=>{
     return get('/report/chapter/ticker',params)
 }
+
+/**
+ * 日度点评分享图片
+ * @param title
+ */
+export const apiRddpShareImg=params=>{
+    return post('/report/detail/rddp_share_img',params)
+}

+ 14 - 3
src/views/hzyb/report/Detail.vue

@@ -147,7 +147,7 @@ import moment from 'moment'
 import 'moment/dist/locale/zh-cn'
 moment.locale('zh-cn')
 
-import {apiReportDetail} from '@/api/hzyb/report'
+import {apiReportDetail,apiRddpShareImg} from '@/api/hzyb/report'
 import {apiApplyPermission} from '@/api/hzyb/user'
 import {Popup,Image as VanImage,PullRefresh} from 'vant'
 import AudioBox from './components/AudioBox.vue'
@@ -290,6 +290,7 @@ export default {
                 //向小程序发送分享数据
                 //处理分享标题
                 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})`
@@ -306,13 +307,23 @@ export default {
                         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
+                    }
+                }
                 wx.miniProgram.postMessage({ 
                     data: {
                         title:shareTitle,
-                        reportId:this.reportId
+                        reportId:this.reportId,
+                        shareImg:shareImg
                     } 
                 });
-                
             }
         },