|
@@ -10,49 +10,58 @@ const route = useRoute()
|
|
|
|
|
|
|
|
|
|
const reportId = route.query.ReportId
|
|
const reportId = route.query.ReportId
|
|
|
|
+const ReportType = route.query.ReportType
|
|
const reportInfo = ref(null)
|
|
const reportInfo = ref(null)
|
|
const reportContent = ref('')
|
|
const reportContent = ref('')
|
|
// const reportStatus = ref(0)//1已过期,2没有该品种权限,3没有权限,4有权限,5未绑定
|
|
// const reportStatus = ref(0)//1已过期,2没有该品种权限,3没有权限,4有权限,5未绑定
|
|
-const reportCollected = ref(false)//报告是否收藏
|
|
|
|
-const isBind=ref(false)
|
|
|
|
const headImgStyle=ref([])
|
|
const headImgStyle=ref([])
|
|
const endImgStyle=ref([])
|
|
const endImgStyle=ref([])
|
|
|
|
+const PdfUrl = ref('')
|
|
const layoutBaseInfo=ref({
|
|
const layoutBaseInfo=ref({
|
|
'研报标题':'',
|
|
'研报标题':'',
|
|
'研报作者':'',
|
|
'研报作者':'',
|
|
'创建时间':''
|
|
'创建时间':''
|
|
})
|
|
})
|
|
async function getReportInfo() {
|
|
async function getReportInfo() {
|
|
- console.log(reportId);
|
|
|
|
|
|
|
|
if (!reportId) return
|
|
if (!reportId) return
|
|
const res = await apiReport.getPushReportDetail({
|
|
const res = await apiReport.getPushReportDetail({
|
|
- ReportId: Number(reportId)
|
|
|
|
|
|
+ ReportId: Number(reportId),
|
|
|
|
+ ReportType: Number(ReportType)
|
|
})
|
|
})
|
|
if (res.Ret === 200) {
|
|
if (res.Ret === 200) {
|
|
reportInfo.value = res.Data.Report
|
|
reportInfo.value = res.Data.Report
|
|
- reportInfo.value.Content =reportInfo.value.Content.split('<p data-f-id="pbf" style="text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;">Powered by <a href="https://www.froala.com/wysiwyg-editor?pb=1" title="Froala Editor">Froala Editor</a></p>')[0]
|
|
|
|
|
|
+ if (ReportType === '1') {
|
|
|
|
+ reportInfo.value.Content =reportInfo.value.Content.split('<p data-f-id="pbf" style="text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;">Powered by <a href="https://www.froala.com/wysiwyg-editor?pb=1" title="Froala Editor">Froala Editor</a></p>')[0]
|
|
|
|
+ headImgStyle.value=res.Data.Report.HeadResource.Style?JSON.parse(res.Data.Report.HeadResource.Style):[]
|
|
|
|
+ endImgStyle.value=res.Data.Report.EndResource.Style?JSON.parse(res.Data.Report.EndResource.Style):[]
|
|
|
|
+ layoutBaseInfo.value['研报标题']=res.Data.Report.Title
|
|
|
|
+ layoutBaseInfo.value['研报作者']=res.Data.Report.Author
|
|
|
|
+ layoutBaseInfo.value['创建时间']=res.Data.Report.PublishTime
|
|
|
|
+ reportInfo.value.Content=modifyReportContentIframeData(reportInfo.value.Content)
|
|
|
|
+ formatIframeData()
|
|
|
|
+ } else {
|
|
|
|
+ // PdfUrl.value = res.Data.PdfUrl
|
|
|
|
+ // console.log(PdfUrl.value);
|
|
|
|
+ reportInfo.value = res.Data
|
|
|
|
+ layoutBaseInfo.value['研报标题']=res.Data.Title
|
|
|
|
+ layoutBaseInfo.value['研报作者']=res.Data.Author
|
|
|
|
+ layoutBaseInfo.value['创建时间']=res.Data.PublishTime
|
|
|
|
+ }
|
|
// reportStatus.value = res.Data.Status
|
|
// reportStatus.value = res.Data.Status
|
|
- reportCollected.value = res.Data.IsCollect || false
|
|
|
|
- isBind.value=res.Data.IsSignIn
|
|
|
|
- headImgStyle.value=res.Data.Report.HeadResource.Style?JSON.parse(res.Data.Report.HeadResource.Style):[]
|
|
|
|
- endImgStyle.value=res.Data.Report.EndResource.Style?JSON.parse(res.Data.Report.EndResource.Style):[]
|
|
|
|
- layoutBaseInfo.value['研报标题']=res.Data.Report.Title
|
|
|
|
- layoutBaseInfo.value['研报作者']=res.Data.Report.Author
|
|
|
|
- layoutBaseInfo.value['创建时间']=res.Data.Report.PublishTime
|
|
|
|
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
- handlePreviewImgs()
|
|
|
|
|
|
+ if (ReportType === '1') {
|
|
|
|
+ handlePreviewImgs()
|
|
|
|
+ }
|
|
})
|
|
})
|
|
// 设置分享文案
|
|
// 设置分享文案
|
|
- wx.miniProgram.postMessage({
|
|
|
|
- data: {
|
|
|
|
- title: res.Data.Report.Title
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- reportInfo.value.Content=modifyReportContentIframeData(reportInfo.value.Content)
|
|
|
|
- formatIframeData()
|
|
|
|
|
|
+ // wx.miniProgram.postMessage({
|
|
|
|
+ // data: {
|
|
|
|
+ // title: res.Data.Report.Title
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
getReportInfo()
|
|
getReportInfo()
|
|
@@ -143,7 +152,7 @@ onUnmounted(() => {
|
|
<template>
|
|
<template>
|
|
<div class="report-detail-page" v-if="reportInfo">
|
|
<div class="report-detail-page" v-if="reportInfo">
|
|
<!-- 智能研报有版头版尾 -->
|
|
<!-- 智能研报有版头版尾 -->
|
|
- <div class="html-head-img-box" v-if="reportInfo.HeadResource.ImgUrl">
|
|
|
|
|
|
+ <div class="html-head-img-box" v-if="reportInfo.HeadResource && reportInfo.HeadResource.ImgUrl">
|
|
<img :src="reportInfo.HeadResource.ImgUrl" alt="" style="display:block;width:100%">
|
|
<img :src="reportInfo.HeadResource.ImgUrl" alt="" style="display:block;width:100%">
|
|
<div
|
|
<div
|
|
class="head-layout-item"
|
|
class="head-layout-item"
|
|
@@ -164,19 +173,30 @@ onUnmounted(() => {
|
|
{{ layoutBaseInfo[item.value] }}
|
|
{{ layoutBaseInfo[item.value] }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="time-box" style="text-align:right;" v-if="reportInfo.HeadResource.ImgUrl">
|
|
|
|
|
|
+ <div class="time-box" style="text-align:right;" v-if="reportInfo.HeadResource && reportInfo.HeadResource.ImgUrl">
|
|
<span>如有内容疑问 请查看 </span>
|
|
<span>如有内容疑问 请查看 </span>
|
|
<span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
<span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <template v-if="!reportInfo.HeadResource.ImgUrl&&!reportInfo.EndResource.ImgUrl">
|
|
|
|
- <div class="title-box">{{ reportInfo.Title }}</div>
|
|
|
|
- <div class="author-box">{{ reportInfo.Author }}</div>
|
|
|
|
- <div class="time-box">
|
|
|
|
- <span>{{ reportInfo.PublishTime }}</span>
|
|
|
|
- <span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <template v-if="ReportType === '1'">
|
|
|
|
+ <template v-if="!reportInfo.HeadResource.ImgUrl&&!reportInfo.EndResource.ImgUrl">
|
|
|
|
+ <div class="title-box">{{ reportInfo.Title }}</div>
|
|
|
|
+ <div class="author-box">{{ reportInfo.Author }}</div>
|
|
|
|
+ <div class="time-box">
|
|
|
|
+ <span>{{ reportInfo.PublishTime }}</span>
|
|
|
|
+ <span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <div class="title-box">{{ reportInfo.Title }}</div>
|
|
|
|
+ <div class="author-box">{{ reportInfo.Author }}</div>
|
|
|
|
+ <div class="time-box">
|
|
|
|
+ <span>{{ reportInfo.PublishTime }}</span>
|
|
|
|
+ <span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
|
|
<div class="des-box" v-if="reportInfo.Abstract">
|
|
<div class="des-box" v-if="reportInfo.Abstract">
|
|
<svg-icon name="icon01"></svg-icon>
|
|
<svg-icon name="icon01"></svg-icon>
|
|
@@ -186,8 +206,9 @@ onUnmounted(() => {
|
|
id="rich-content"
|
|
id="rich-content"
|
|
class="report-content-box rich-content"
|
|
class="report-content-box rich-content"
|
|
v-html="reportContent"
|
|
v-html="reportContent"
|
|
|
|
+ v-if="ReportType === '1'"
|
|
/>
|
|
/>
|
|
- <template>
|
|
|
|
|
|
+ <template v-if="ReportType === '1'">
|
|
<div
|
|
<div
|
|
id="rich-content"
|
|
id="rich-content"
|
|
class="report-content-box rich-content"
|
|
class="report-content-box rich-content"
|
|
@@ -213,10 +234,15 @@ onUnmounted(() => {
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+ <template v-if="ReportType === '2'">
|
|
|
|
+ <div class="report-content-box rich-content">
|
|
|
|
+ <preview-PDF :url="reportInfo.PdfUrl"/>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
|
|
<!-- 拼接版尾 -->
|
|
<!-- 拼接版尾 -->
|
|
- <div class="html-end-img-box" v-if="reportInfo.EndResource.ImgUrl">
|
|
|
|
|
|
+ <div class="html-end-img-box" v-if="reportInfo.EndResource && reportInfo.EndResource.ImgUrl">
|
|
<img :src="reportInfo.EndResource.ImgUrl" alt="" style="display:block;width:100%">
|
|
<img :src="reportInfo.EndResource.ImgUrl" alt="" style="display:block;width:100%">
|
|
<div
|
|
<div
|
|
class="head-layout-item"
|
|
class="head-layout-item"
|