|
@@ -0,0 +1,199 @@
|
|
|
+<script setup>
|
|
|
+import { ref, onMounted } from "vue";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
+import { inrernalApi } from "@/api/cygx/api.js";
|
|
|
+import dlg from "./dlg.vue";
|
|
|
+// 路由
|
|
|
+const route = useRoute();
|
|
|
+
|
|
|
+// 免责声明弹框
|
|
|
+const showTips = ref(false);
|
|
|
+
|
|
|
+// 数据的初始
|
|
|
+const reportDetail = ref({});
|
|
|
+
|
|
|
+// 文字的ID
|
|
|
+const reportId = ref(0);
|
|
|
+
|
|
|
+// 获取数据
|
|
|
+const reportSelectionDetail = async () => {
|
|
|
+ const res = await inrernalApi.getProductInteriorDetail({
|
|
|
+ ProductInteriorId: reportId.value,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ reportDetail.value = res.Data.Detail;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 获取标签
|
|
|
+const addLinkClickListeners = () => {
|
|
|
+ // 获取所有的A标签
|
|
|
+ const linkElements = document.querySelectorAll("a");
|
|
|
+ linkElements.forEach((linkElement) => {
|
|
|
+ linkElement.addEventListener("click", handleLinkClick);
|
|
|
+ });
|
|
|
+ // 获取所有的img标签
|
|
|
+ const imageElements = document.querySelectorAll("img");
|
|
|
+ imageElements.forEach((imageElement) => {
|
|
|
+ imageElement.addEventListener("click", handleImageClick);
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 处理a标签的点击事件
|
|
|
+const handleLinkClick = (event) => {
|
|
|
+ event.preventDefault();
|
|
|
+ const linkHref = event.target.innerText;
|
|
|
+ if (!linkHref) return;
|
|
|
+
|
|
|
+ const number = linkHref.match(/\d+$/)[0];
|
|
|
+ const routerToItem = reportDetail.value.BodySlice.find((item) => number == item.SourceId);
|
|
|
+
|
|
|
+ switch (routerToItem.Type) {
|
|
|
+ case 2:
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: "/pageMy/reportDetail/reportDetail?id=" + routerToItem.SourceId,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: "/activityPages/activityDetail/activityDetail?id=" + routerToItem.SourceId,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: "/reportPages/IndustryReport/IndustryReport?id=" + routerToItem.SourceId,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ "";
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 处理img标签的点击事件
|
|
|
+const handleImageClick = (event) => {
|
|
|
+ const imgArray = [];
|
|
|
+ const srcTag = event.target.getAttribute("src");
|
|
|
+
|
|
|
+ if (srcTag) {
|
|
|
+ const reportImages = document.querySelectorAll("img");
|
|
|
+ reportImages.forEach((image) => {
|
|
|
+ const itemSrc = image.getAttribute("src");
|
|
|
+ imgArray.push(itemSrc);
|
|
|
+ });
|
|
|
+
|
|
|
+ wx.previewImage({ current: srcTag, urls: imgArray });
|
|
|
+ }
|
|
|
+};
|
|
|
+// 页面加载渲染
|
|
|
+onMounted(async () => {
|
|
|
+ if (route.query.id) {
|
|
|
+ let access_token = route.query.token || "";
|
|
|
+ localStorage.setItem("access_token", access_token);
|
|
|
+ reportId.value = +route.query.id
|
|
|
+ await reportSelectionDetail();
|
|
|
+ addLinkClickListeners();
|
|
|
+ }
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="cygx_internal-detials">
|
|
|
+ <div class="report-content-title">{{ reportDetail.Title }}</div>
|
|
|
+ <div class="author-time">
|
|
|
+ <span>{{ reportDetail.Department }}</span>
|
|
|
+ <span>{{ reportDetail.PublishTime }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="content-statement">
|
|
|
+ <span>注:请务必阅读</span>
|
|
|
+ <span class="statement" @click="showTips = true">免责声明 </span>
|
|
|
+ </div>
|
|
|
+ <div id="report-content" class="content-abstract">摘要:{{ reportDetail.Abstract }}</div>
|
|
|
+ <div v-html="reportDetail.Body"></div>
|
|
|
+ <dlg :showTips="showTips" type="产品内测" @hideDlg="showTips = false" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.cygx_internal-detials {
|
|
|
+ padding: 30px 34px;
|
|
|
+ color: #333;
|
|
|
+ font-size: 28px;
|
|
|
+ .author-time {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ line-height: 39px;
|
|
|
+ margin: 25px 0 35px;
|
|
|
+ }
|
|
|
+ .content-statement {
|
|
|
+ display: flex;
|
|
|
+ color: #707070;
|
|
|
+ .statement {
|
|
|
+ margin-left: 10px;
|
|
|
+ color: #3385ff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .report-content-title {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 36px;
|
|
|
+ line-height: 50px;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ .content-abstract {
|
|
|
+ position: relative;
|
|
|
+ margin: 30px 0 20px;
|
|
|
+ text-indent: 0.5em;
|
|
|
+ line-height: 50px;
|
|
|
+ padding-bottom: 30px;
|
|
|
+ border-bottom: 1px dashed #ececec;
|
|
|
+ &::before {
|
|
|
+ content: "";
|
|
|
+ width: 4px;
|
|
|
+ height: 28px;
|
|
|
+ position: absolute;
|
|
|
+ top: 11px;
|
|
|
+ left: 0;
|
|
|
+ background-color: #3385ff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .nodata-tip {
|
|
|
+ color: #999;
|
|
|
+ font-size: 30px;
|
|
|
+ }
|
|
|
+ word-break: break-all;
|
|
|
+ p,
|
|
|
+ span {
|
|
|
+ font-size: 32px !important;
|
|
|
+ line-height: 1.6 !important;
|
|
|
+ }
|
|
|
+ p {
|
|
|
+ background-color: rgba(255, 255, 255, 0) !important;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
+ a {
|
|
|
+ color: #3385ff;
|
|
|
+ }
|
|
|
+ iframe {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
+ table {
|
|
|
+ border-collapse: collapse;
|
|
|
+ width: 100% !important;
|
|
|
+ margin-left: 0 !important;
|
|
|
+ }
|
|
|
+ tr td,
|
|
|
+ th {
|
|
|
+ border: 1px solid #333;
|
|
|
+ }
|
|
|
+ pre {
|
|
|
+ width: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
+ overflow-x: hidden;
|
|
|
+ outline: none;
|
|
|
+ border: 0;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ word-break: normal;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|