|
@@ -1,4 +1,72 @@
|
|
|
<script setup>
|
|
|
+import apiReport from '@/api/modules/report'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
+
|
|
|
+const route = useRoute()
|
|
|
+
|
|
|
+
|
|
|
+const reportId = route.query.reportid
|
|
|
+const reportInfo = ref(null)
|
|
|
+const reportContent = ref('')
|
|
|
+const reportStatus = ref(0)//1已过期,2没有该品种权限,3没有权限,4有权限
|
|
|
+async function getReportInfo() {
|
|
|
+ if (!reportId) return
|
|
|
+ const res = await apiReport.getReportDetail({
|
|
|
+ ReportId: Number(reportId)
|
|
|
+ })
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ reportInfo.value = res.Data.Report
|
|
|
+ reportStatus.value = res.Data.Status
|
|
|
+ formatIframeData()
|
|
|
+ // 设置分享文案
|
|
|
+ wx.miniProgram.postMessage({
|
|
|
+ data: {
|
|
|
+ title: res.Data.Report.Title
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ handleAddReadReportRecord()
|
|
|
+ }
|
|
|
+}
|
|
|
+getReportInfo()
|
|
|
+
|
|
|
+// 给报告详情中图表加参数
|
|
|
+function formatIframeData() {
|
|
|
+ reportContent.value = reportInfo.value.Content.replace(/\/chartshow\?code=/g, `/chartshow?source=etamini&token=${localStorage.getItem('token')}&reportId=${reportId}&code=`)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 用户阅读埋点
|
|
|
+let recordData = []
|
|
|
+function handleAddReadReportRecord() {
|
|
|
+ apiReport.addReportReadRecord({
|
|
|
+ RecordId: recordData,
|
|
|
+ ReportId: Number(reportId),
|
|
|
+ ReportTitle: reportInfo.value.Title,
|
|
|
+ ClassifyIdFirst: reportInfo.value.ClassifyIdFirst,
|
|
|
+ ClassifyNameFirst: reportInfo.value.ClassifyNameFirst,
|
|
|
+ ClassifyIdSecond: reportInfo.value.ClassifyIdSecond,
|
|
|
+ ClassifyNameSecond: reportInfo.value.ClassifyNameSecond,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ console.log('记录成功');
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ handleAddReadReportRecord()
|
|
|
+})
|
|
|
+
|
|
|
+// 拨打电话
|
|
|
+function handleCallPhone() {
|
|
|
+ var phoneLink = 'tel:' + '15715575977';
|
|
|
+ var link = document.createElement('a');
|
|
|
+ link.setAttribute('href', phoneLink);
|
|
|
+ link.onclick = function () {
|
|
|
+ return true;
|
|
|
+ };
|
|
|
+ link.click();
|
|
|
+}
|
|
|
|
|
|
|
|
|
// 点击收藏
|
|
@@ -53,18 +121,18 @@ onUnmounted(() => {
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="report-detail-page">
|
|
|
- <div class="title-box">报告标题</div>
|
|
|
- <div class="author-box">作者</div>
|
|
|
+ <div class="report-detail-page" v-if="reportInfo">
|
|
|
+ <div class="title-box">{{ reportInfo.Title }}</div>
|
|
|
+ <div class="author-box">{{ reportInfo.Author }}</div>
|
|
|
<div class="time-box">
|
|
|
- <span>2023-02-02 12:12</span>
|
|
|
+ <span>{{ reportInfo.PublishTime }}</span>
|
|
|
<span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
|
</div>
|
|
|
- <div class="des-box">
|
|
|
+ <div class="des-box" v-if="reportInfo.Abstract">
|
|
|
<svg-icon name="icon01"></svg-icon>
|
|
|
- <div>摘要内容部分</div>
|
|
|
+ <div>{{ reportInfo.Abstract }}</div>
|
|
|
</div>
|
|
|
- <div class="report-content-box rich-content"></div>
|
|
|
+ <div class="report-content-box rich-content" v-html="reportContent"></div>
|
|
|
<!-- 右侧悬浮操作栏 -->
|
|
|
<div class="right-fix-box">
|
|
|
<!-- 收藏 -->
|
|
@@ -85,12 +153,24 @@ onUnmounted(() => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 无权限 -->
|
|
|
- <div class="no-auth-wrap" v-if="false">
|
|
|
+ <div class="no-auth-wrap" v-if="reportStatus !== 4">
|
|
|
<div class="opcity-box"></div>
|
|
|
<div class="content-box">
|
|
|
<img class="icon" src="@/assets/imgs/lock-img.png" alt="" />
|
|
|
- <div class="text">您暂无权限查看,<br />请联系客服人员开通!</div>
|
|
|
- <t-button theme="primary" block style="width: 300px; margin: 30px auto"
|
|
|
+ <div class="text" v-if="reportStatus === 3">
|
|
|
+ 您暂无权限查看,<br />请联系客服人员开通!
|
|
|
+ </div>
|
|
|
+ <div class="text" v-if="reportStatus === 2">
|
|
|
+ 您暂无该品种权限,<br />请联系销售人员开通!
|
|
|
+ </div>
|
|
|
+ <div class="text" v-if="reportStatus === 1">
|
|
|
+ 您的权限已过期,<br />请联系销售人员开通!
|
|
|
+ </div>
|
|
|
+ <t-button
|
|
|
+ theme="primary"
|
|
|
+ block
|
|
|
+ style="width: 300px; margin: 30px auto"
|
|
|
+ @click="handleCallPhone"
|
|
|
>立即联系</t-button
|
|
|
>
|
|
|
</div>
|
|
@@ -127,6 +207,7 @@ onUnmounted(() => {
|
|
|
line-height: 36px;
|
|
|
}
|
|
|
.report-content-box {
|
|
|
+ margin-top: 20px;
|
|
|
line-height: 1.8;
|
|
|
font-size: 36px;
|
|
|
:deep(img) {
|