瀏覽代碼

报告详情部分增加影藏的水印

jwyu 2 年之前
父節點
當前提交
41eb5f12e7
共有 3 個文件被更改,包括 31 次插入2 次删除
  1. 21 0
      src/style/global.scss
  2. 5 1
      src/views/report/ChapterDetail.vue
  3. 5 1
      src/views/report/Detail.vue

+ 21 - 0
src/style/global.scss

@@ -334,4 +334,25 @@ img {
       left: calc(50% - 700px);
     }
   }
+}
+
+#report-rich-content{
+  position: relative;
+  .hide-watermark-box{
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    align-items: center;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    font-size: 40px;
+    z-index: 999999;
+    background: transparent;
+    left: 0;
+    top: 0;
+    pointer-events: none;
+    color: rgba(0,0,0,0.005); // 水印蒙层字体颜色设置为白色透明
+  }
 }

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

@@ -401,9 +401,13 @@ const posterParams=computed(()=>{
                     </div>
                     <AudioBox :data="audioData" v-if="info.report_chapter_item.video_url&&info.report_chapter_item.video_play_seconds>0"></AudioBox>
                     <!-- <div class="abstract" v-if="info.report_chapter_item.abstract">摘要:{{info.report_chapter_item.abstract}}</div> -->
-                    <div class="no-select-text rich-content" ref="waterMarkEl">
+                    <div id="report-rich-content" class="no-select-text rich-content" ref="waterMarkEl">
                         <div v-html="info.report_chapter_item.content" v-if="info.auth_ok"></div>
                         <div v-html="info.report_chapter_item.content_sub" v-else ></div>
+                        <!-- 隐藏的水印 -->
+                        <div class="hide-watermark-box">
+                            <div v-for="item in 20" :key="item">{{$store.state.userInfo.mobile}}</div>
+                        </div>
                     </div>
                     <!-- 指标数据模块 -->
                     <div class="ticker-wrap" v-if="tickerInfo">

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

@@ -441,9 +441,13 @@ const formatTitle=(e)=>{
                     <AudioBox :data="audioData" v-if="info.report_info.video_url&&info.report_info.video_play_seconds>0"></AudioBox>
                     <!-- <div class="abstract" v-if="info.report_info.abstract">摘要:{{info.report_info.abstract}}</div> -->
 
-                    <div class="no-select-text rich-content" ref="waterMarkEl">
+                    <div id="report-rich-content" class="no-select-text rich-content" ref="waterMarkEl">
                         <div v-html="info.report_info.content" v-if="info.auth_ok"></div>
                         <div v-html="info.report_info.content_sub" v-else></div>
+                        <!-- 隐藏的水印 -->
+                        <div class="hide-watermark-box">
+                            <div v-for="item in 20" :key="item">{{$store.state.userInfo.mobile}}</div>
+                        </div>
                     </div>
 
                     <!-- 评论点赞模块 -->