Browse Source

分享title修改

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

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

@@ -274,9 +274,11 @@ export default {
         this.title=`【第${res.data.report_chapter_item.stage}期 | ${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 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')})`
         wx.miniProgram.postMessage({ 
           data: {
-            title:`FICC【${res.data.report_chapter_item.classify_name_first}】`,
+            title:shareTitle,
             chapterId:this.chapterId
           } 
         });

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

@@ -288,9 +288,27 @@ export default {
                 }
 
                 //向小程序发送分享数据
+                //处理分享标题
+                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})`
+                    }
+                }
                 wx.miniProgram.postMessage({ 
                     data: {
-                        title:`FICC【${res.data.report_info.classify_name_first}】`,
+                        title:shareTitle,
                         reportId:this.reportId
                     } 
                 });