|
@@ -65,7 +65,7 @@
|
|
|
|
|
|
<div class="abstract" v-if="reportInfo && !!reportInfo.NeedSplice">
|
|
|
<div v-if="reportInfo.Abstract">摘要:{{ reportInfo.Abstract }}</div>
|
|
|
- <div style="color: #666; margintop: 1.2rem">
|
|
|
+ <div style="color: #666; margintop: 1.2rem" v-if="configInfo.Disclaimer">
|
|
|
*注:请务必阅读 <strong
|
|
|
style="fontweight: normal; cursor: pointer; color: #3e8ce6"
|
|
|
@click="showTips"
|
|
@@ -135,6 +135,8 @@ import { getShareInfo,reportDetail } from "@/api/api.js";
|
|
|
import _ from "lodash";
|
|
|
import {wxShare,injectSdk} from "../utils/wxShare.js";
|
|
|
import AudioPlay from '../report/audioPlay.vue';
|
|
|
+import { Watermark,BlindWatermark } from 'watermark-js-plus'
|
|
|
+import { Base64 } from 'js-base64';
|
|
|
export default {
|
|
|
components: { AudioPlay },
|
|
|
data() {
|
|
@@ -189,14 +191,32 @@ export default {
|
|
|
wxShare(document.location.href,res.Data.H5ShareName||document.title,res.Data.H5ShareTitle,res.Data.H5ReportShareImg,0);
|
|
|
this.getreportdetail()
|
|
|
},
|
|
|
- pageResize(){
|
|
|
- const el=document.getElementById('reportdtl')
|
|
|
- const windowWid=document.body.clientWidth
|
|
|
- if(windowWid<1200){
|
|
|
- el.style.transform=`scale(${windowWid/1200})`
|
|
|
- // el.style.
|
|
|
- }
|
|
|
- },
|
|
|
+ // pageResize(){
|
|
|
+ // const el=document.getElementById('reportdtl')
|
|
|
+ // const windowWid=document.body.clientWidth
|
|
|
+ // if(windowWid<1200){
|
|
|
+ // el.style.transform=`scale(${windowWid/1200})`
|
|
|
+ // // el.style.
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // 智能布局移动端样式时内容排版全部变成1个1行的顺排
|
|
|
+ formatSmartStyle() {
|
|
|
+ this.$nextTick(() =>{
|
|
|
+ const width=window.innerWidth;
|
|
|
+ if(width>600) return
|
|
|
+ $('.report-drag-item-wrap_child-wrap').css({
|
|
|
+ 'flex-wrap': 'wrap',
|
|
|
+ });
|
|
|
+ $('.report-drag-item-wrap_child-wrap').children().css({
|
|
|
+ 'flex': 'none',
|
|
|
+ 'width': '100%'
|
|
|
+ });
|
|
|
+
|
|
|
+ document.querySelectorAll('div[comp-type="text"]').forEach(function(div) {
|
|
|
+ div.style.height = 'auto';
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
playaudio(item) {
|
|
|
//子组件先存后播
|
|
@@ -251,15 +271,24 @@ export default {
|
|
|
|
|
|
this.headImgStyle=this.reportInfo.HeadStyle?JSON.parse(this.reportInfo.HeadStyle):[]
|
|
|
this.endImgStyle=this.reportInfo.EndStyle?JSON.parse(this.reportInfo.EndStyle):[]
|
|
|
+ if(this.isMobileDevice()) {
|
|
|
+ this.headImgStyle.map(st =>{
|
|
|
+ st.size = st.sizeMobile || st.size;
|
|
|
+ })
|
|
|
+ this.endImgStyle.map(st =>{
|
|
|
+ st.size = st.sizeMobile || st.size;
|
|
|
+ })
|
|
|
+ }
|
|
|
this.layoutBaseInfo['研报标题']=this.reportInfo.Title
|
|
|
this.layoutBaseInfo['研报作者']=this.reportInfo.Author
|
|
|
// 已发布已通过的报告才显示发布时间
|
|
|
this.layoutBaseInfo['创建时间']=[2,6].includes(this.reportInfo.State)?this.reportInfo.PublishTime:''
|
|
|
|
|
|
this.isshow = true;
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.pageResize()
|
|
|
- })
|
|
|
+ this.formatSmartStyle()
|
|
|
+ // this.$nextTick(()=>{
|
|
|
+ // this.pageResize()
|
|
|
+ // })
|
|
|
|
|
|
// wxShare(document.location.href, H5ShareName || document.title, wxShareTitle, H5ReportShareImg, 0);
|
|
|
|
|
@@ -277,6 +306,71 @@ export default {
|
|
|
wx.previewImage({ current: curImageSrc, urls: imgArray });
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ //水印
|
|
|
+ localStorage.setItem('waterMarkStr',this.$route.query.flag||'')
|
|
|
+ const temwaterMarkStr=this.$route.query.flag||localStorage.getItem('waterMarkStr')
|
|
|
+ let waterMarkStr=Base64.decode(temwaterMarkStr)
|
|
|
+ waterMarkStr=decodeURIComponent(waterMarkStr)
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ if(Data.WatermarkReport==='true'){
|
|
|
+ this.setWaterMark(waterMarkStr)
|
|
|
+ }
|
|
|
+ this.setBlindWaterMark(waterMarkStr)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ setWaterMark(str){
|
|
|
+ const text=str||''
|
|
|
+ const target=document.getElementById('resetcss')
|
|
|
+ const canvas = document.createElement("canvas");
|
|
|
+
|
|
|
+ const ctx = canvas.getContext("2d");
|
|
|
+ ctx.font = "18px Arial";
|
|
|
+ ctx.rotate((-45 * Math.PI) / 200);
|
|
|
+ ctx.fillStyle='#f1f1f1'
|
|
|
+ ctx.fillText(text, 30, 200);
|
|
|
+ ctx.fillText(text, -40, 100);
|
|
|
+
|
|
|
+ // 将canvas的内容转换为base64编码
|
|
|
+ const data = canvas.toDataURL("image/png");
|
|
|
+ target.style.background = "url(" + data + ") repeat";
|
|
|
+ },
|
|
|
+
|
|
|
+ // 设置水印
|
|
|
+ setBlindWaterMark(str){
|
|
|
+
|
|
|
+ const blindwatermark = new BlindWatermark({
|
|
|
+ content: str||'',
|
|
|
+ width: 200,
|
|
|
+ height: 200,
|
|
|
+ onSuccess: () => {
|
|
|
+ // success callback
|
|
|
+ }
|
|
|
+ })
|
|
|
+ blindwatermark.create()
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断是否为移动设备
|
|
|
+ *
|
|
|
+ * @returns 返回布尔值,表示是否为移动设备
|
|
|
+ */
|
|
|
+ isMobileDevice() {
|
|
|
+ const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
|
|
+ // Windows Phone must come first because its UA also contains "Android"
|
|
|
+ if (/windows phone/i.test(userAgent)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (/android/i.test(userAgent)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ // iOS detection
|
|
|
+ if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
},
|
|
|
|
|
|
/*内容分割*/
|
|
@@ -355,8 +449,8 @@ body{
|
|
|
font-size: 14px;
|
|
|
background: #fff;
|
|
|
overflow: auto;
|
|
|
- width: 1200px;
|
|
|
- padding: 20px 20px 20px 44px;
|
|
|
+ width: 1240px;
|
|
|
+ padding: 20px;
|
|
|
margin: 0 auto;
|
|
|
|
|
|
.top-header {
|
|
@@ -472,10 +566,14 @@ body{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-@media screen and (max-width:1200px){
|
|
|
+@media screen and (max-width:610px){
|
|
|
#reportdtl{
|
|
|
- position: absolute;
|
|
|
- transform-origin: 0 0;
|
|
|
+ width: 100%;
|
|
|
+ .no-layout-img-box{
|
|
|
+ header{
|
|
|
+ flex-direction: column-reverse;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|