Browse Source

报告详情分享title修改

jwyu 2 years ago
parent
commit
0d5fb0f207
2 changed files with 22 additions and 2 deletions
  1. 3 1
      src/views/report/ChapterDetail.vue
  2. 19 1
      src/views/report/Detail.vue

+ 3 - 1
src/views/report/ChapterDetail.vue

@@ -124,12 +124,14 @@ const getChapterReportDetail=async ()=>{
         }
 
         //向小程序发送分享数据
+        //处理分享标题
+        const shareTitle=`【${res.data.report_chapter_item.classify_name_first} | ${res.data.report_chapter_item.type_name}】${res.data.report_chapter_item.title}(${moment(res.data.report_chapter_item.publish_time).format('MMDD')})`
         const postData={
             path:'/pages-report/chapterDetail',
             params:{
                 chapterId:chapterId.value
             },
-            title:`FICC【${res.data.report_chapter_item.classify_name_first}】`,
+            title:shareTitle,
             shareImg:''
         }
         wx.miniProgram.postMessage({ data: postData })

+ 19 - 1
src/views/report/Detail.vue

@@ -65,12 +65,30 @@ const getReportDetail=async ()=>{
         }
 
         //向小程序发送分享数据
+        //处理分享标题
+        let shareTitle=''
+        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})`
+        }else{
+            // 专栏类报告
+            if(res.data.report_show_type==2){
+                const abstract=res.data.report_info.abstract?`:${res.data.report_info.abstract}`:''
+                if(res.data.report_info.classify_name_second==res.data.report_info.title){
+                    shareTitle=`${res.data.report_info.title}(${shareTime})${abstract}`
+                }else{
+                    shareTitle=`【${res.data.report_info.classify_name_second}】${res.data.report_info.title}(${shareTime})`
+                }
+            }else{
+                shareTitle=`【${res.data.report_info.classify_name_second}】${res.data.report_info.title}(${shareTime})`
+            }
+        }
         const postData={
             path:'/pages-report/reportDetail',
             params:{
                 reportId:reportId.value
             },
-            title:`FICC【${res.data.report_info.classify_name_first}】`,
+            title:shareTitle,
             shareImg:''
         }
         wx.miniProgram.postMessage({ data: postData })