123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- <template>
- <div>
- <div class="container-cygx" @copy="copyMonitor" v-if="haveData == 1" :class="reportInfo.IsResearch ? 'no-cv' : ''">
- <canvas id="tutorial" ref="tutorial"></canvas>
- <topbar class="top-box-bar" showText="弘则研究" />
- <div class="search">
- <div class="search-box" @click="btnSearch">
- <Icon name="search" color="#8D8D8D" />
- <span>搜索您想要的纪要</span>
- </div>
- </div>
- <div class="z-index-content">
- <div class="content-top">
- <div class="report-title">{{ reportInfo.Title }}</div>
- <div class="report-text">
- <div class="report_desc">
- <span class="author">{{ reportInfo.Department }}</span>
- <span>{{ reportInfo.PublishDate }}</span>
- </div>
- <div class="seller-list" v-if="!reportInfo.IsResearch">
- <span>联系人:</span>
- <span v-for="(item, index) in reportInfo.SellerList" :key="index"> {{ item.SellerName }}({{ item.SellerMobile }}) </span>
- </div>
- <div class="seller-list" v-else>
- <span>作者:{{ reportInfo.SellerAndMobile }} </span>
- </div>
- <div>注:请务必阅读<span class="tip" @click="showTips = true"> 免责声明</span></div>
- <div class="container-abstract"> 摘要: {{ reportInfo.Abstract }}</div>
- </div>
- </div>
- <div class="detail-report">
- <div id="report-content" v-html="reportInfo.Body"></div>
- </div>
- </div>
- <div class="btn-returntop">
- <img src="~@/assets/cygx/returntop.png" @click="scrolltop" style="width: 40px" />
- </div>
- <div class="fixed_cont">
- <div class="handle-item" @click="quizBtn" v-if="reportInfo.IsResearch">
- <img src="@/assets/cygx/quiz_ico.png" class="img_ico" />
- <div>提问</div>
- </div>
- <div class="handle-item" @click="collectHandle">
- <img src="@/assets/cygx/collect_act.png" class="img_ico" v-if="reportInfo.IsCollect" />
- <img src="@/assets/cygx/collect_ico.png" class="img_ico" v-else />
- <div v-if="reportInfo.IsResearch">
- {{ `${reportInfo.CollectionNum} 人收藏` }}
- </div>
- </div>
- </div>
- <dlg :showTips="showTips" :reportInfo="reportInfo" @hideDlg="showTips = false" />
- </div>
- <div v-else class="nodata">
- <img src="@/assets/cygx/noauth.png" mode="" class="nodata_ico" />
- <div v-if="haveData == 2">
- <p>您暂无权限查看报告</p>
- <p>若想查看可联系海通销售开通试用权限</p>
- </div>
- <div v-else>
- <p>您的试用权限已到期</p>
- <p>若想继续试用,请联系海通销售</p>
- </div>
- </div>
- <topbar v-if="haveData != 1" class="top-haveData-bar" showText="弘则研究" />
- </div>
- </template>
- <script setup>
- import { reactive, onMounted, toRefs, ref, onUnmounted } from "vue";
- import { useRouter, useRoute } from "vue-router";
- import { RaiApi } from "@/api/htgj/api.js";
- import { Icon, Dialog, Toast } from "vant";
- import dlg from "../cygx/dlg.vue";
- import store from "@/store";
- import topbar from "./topbar.vue";
- const router = useRouter();
- const route = useRoute();
- const state = reactive({
- reportInfo: {},
- });
- const rerportId = ref(null);
- const haveData = ref(1);
- const fileLink = ref(false);
- const showTips = ref(false);
- const tutorial = ref(null);
- /* 访谈接口 */
- const interviewApi = () => {
- RaiApi.applyRpt({
- ArticleId: Number(rerportId.value),
- }).then((res) => {
- if (res.Ret === 200) {
- state.reportInfo.IsInterviewApply = !state.reportInfo.IsInterviewApply;
- state.reportInfo.InterviewApplyStatus = state.reportInfo.IsInterviewApply ? "待邀请" : "";
- Toast(res.Msg);
- }
- });
- };
- const scrolltop = () => {
- document.body.scrollTop = document.documentElement.scrollTop = 0;
- };
- /* 复制 */
- const copyMonitor = () => {
- RaiApi.pageHistoryCopy({
- DetailId: rerportId.value + "",
- }).then((res) => {});
- };
- /* 打水印 */
- const waterMark = (text) => {
- let canvas = document.createElement("canvas");
- let ctx = canvas.getContext("2d");
- ctx.font = "20px Arial";
- ctx.rotate((-45 * Math.PI) / 200);
- ctx.fillText(text, 30, 200);
- ctx.fillText(text, -40, 100);
- // 将canvas的内容转换为base64编码
- let data = canvas.toDataURL("image/png");
- // 将容器的的背景图片设置为生成的base64图片,并平铺
- tutorial.value.style.background = "url(" + data + ") repeat";
- };
- //点击回到搜索页面
- const btnSearch = () => {
- router.push("/htgj/search");
- };
- const timeState = reactive({
- setIntervalTiem: null,
- readTiem: 0,
- });
- /* 获取报告详情 */
- const getReport = (id) => {
- RaiApi.reportDtl({
- ArticleId: id,
- }).then((res) => {
- if (res.Ret === 200) {
- haveData.value = res.Data.HasPermission;
- if (res.Data.HasPermission === 1) {
- //有访问权限
- state.reportInfo = res.Data.Detail;
- fileLink.value = res.Data.Detail.FileLink;
- if (state.reportInfo.IsResearch || state.reportInfo.IsBelongSummary) {
- waterMark(res.Data.CompanyName);
- }
- $(document).on("click", "#report-content img", function (event) {
- let imgArray = [];
- let src_tag = $(this).attr("src");
- let parent_tag = $(this).parent();
- if (src_tag && !parent_tag.attr("href")) {
- $("#report-content img").each(function (index, el) {
- let itemSrc = $(this).attr("src");
- imgArray.push(itemSrc);
- });
- wx.previewImage({ current: src_tag, urls: imgArray });
- }
- });
- timeState.readTiem = 0;
- timeState.setIntervalTiem = setInterval(() => {
- timeState.readTiem++;
- }, 1000);
- }
- }
- });
- };
- //点击到提问页面
- const quizBtn = () => {
- // wx.miniProgram.navigateTo({
- // url: "/activityPages/generationAsk/generationAsk?id=" + state.reportInfo.ArticleId + "&type=文章",
- // });
- router.push({
- path: "/htgj/quiz",
- query: {
- id: rerportId.value,
- },
- });
- };
- /* 收藏 */
- const collectHandle = () => {
- RaiApi.collectRpt({
- ArticleId: Number(rerportId.value),
- }).then((res) => {
- if (res.Ret === 200) {
- state.reportInfo.IsCollect = !state.reportInfo.IsCollect;
- if (res.Data.Status == 2) {
- state.reportInfo.CollectionNum -= 1;
- } else {
- state.reportInfo.CollectionNum += 1;
- }
- Toast(res.Msg);
- }
- });
- };
- onMounted(() => {
- if (route.query.id) {
- rerportId.value = route.query.id;
- getReport(rerportId.value);
- }
- });
- onUnmounted(() => {
- clearInterval(timeState.setIntervalTiem);
- if (!rerportId.value || haveData.value !== 1) return;
- RaiApi.addStopTime({
- ArticleId: Number(rerportId.value),
- StopTime: timeState.readTiem,
- OutType: 1,
- Source: "PC",
- }).then((res) => {});
- });
- const { reportInfo } = toRefs(state);
- </script>
- <style lang="scss">
- .container-cygx {
- padding: 54px 34px 34px 34px;
- position: relative;
- z-index: 5;
- .z-index-content {
- position: relative;
- z-index: 5;
- }
- .fixed_cont {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- display: flex;
- justify-content: space-around;
- border-top: 1px solid #ddd;
- padding-bottom: calc(5px + constant(safe-area-inset-bottom));
- padding-bottom: calc(5px + env(safe-area-inset-bottom));
- background-color: #fff;
- z-index: 9;
- box-sizing: border-box;
- .handle-item {
- padding-top: 14px;
- text-align: center;
- line-height: 33px;
- font-size: 20px;
- color: #888888;
- width: 130px;
- img {
- width: 44px;
- height: 44px;
- padding: 0;
- margin: 0;
- }
- div {
- padding: 0;
- margin: 0;
- }
- }
- }
- .top-box-bar {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 60px;
- background-color: #fff;
- margin: 0;
- padding-top: 20px;
- z-index: 10;
- img {
- margin-top: 10px;
- }
- }
- .search {
- width: 100%;
- padding: 20px 20px;
- line-height: 70px;
- position: fixed;
- top: 60px;
- left: 0;
- background: #fff;
- z-index: 9;
- .search-box {
- display: flex;
- align-items: center;
- padding-left: 20px;
- width: 100%;
- height: 70px;
- border-radius: 35px;
- background: #f6f6f6;
- color: #8d8d8d;
- font-size: 24px;
- }
- }
- .content-top {
- margin-top: 115px;
- .report-title {
- font-size: 34px;
- font-weight: bold;
- color: #4a4a4a;
- margin: 60px 0 20px;
- }
- .report-text {
- color: #999999;
- font-size: 28px;
- .seller-list {
- margin: 20px 0;
- }
- .report_desc {
- display: flex;
- justify-content: space-between;
- }
- .tip {
- color: #3385ff;
- }
- .container-abstract {
- margin: 40px 0 20px;
- padding-bottom: 40px;
- border-bottom: 2px dashed #999;
- position: relative;
- line-height: 44px;
- color: #333;
- &::before {
- content: "";
- position: absolute;
- top: 0;
- left: 0;
- width: 8px;
- height: 44px;
- background: #2a65f5;
- }
- }
- }
- }
- .report-link {
- font-size: 28px;
- line-height: 80px;
- }
- .detail-report {
- padding-bottom: 130px;
- p,
- span {
- font-size: 28px !important;
- }
- img {
- width: 100% !important;
- }
- a {
- color: #333;
- }
- 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;
- }
- .btn-returntop {
- position: fixed;
- right: 40px;
- bottom: 150px;
- width: 88px;
- height: 88px;
- z-index: 10;
- }
- .fixed_cont {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- display: flex;
- justify-content: space-around;
- border-top: 1px solid #ddd;
- padding-bottom: calc(5px + constant(safe-area-inset-bottom));
- padding-bottom: calc(5px + env(safe-area-inset-bottom));
- background-color: #fff;
- z-index: 9;
- box-sizing: border-box;
- .handle-item {
- padding-top: 14px;
- text-align: center;
- line-height: 33px;
- font-size: 20px;
- color: #888888;
- img {
- width: 44px;
- height: 44px;
- padding: 0;
- margin: 0;
- }
- div {
- padding: 0;
- margin: 0;
- }
- }
- }
- }
- .nodata {
- width: 100%;
- margin: 30% auto;
- text-align: center;
- img {
- width: 50%;
- margin-bottom: 30px;
- }
- p {
- margin-top: 20px;
- }
- }
- .no-cv {
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- }
- .top-box-bar {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 40px;
- background-color: #fff;
- margin-top: 15px;
- z-index: 10;
- }
- #tutorial {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1;
- width: 100%;
- height: 100%;
- opacity: 0.1;
- // transform: translateX(130px) rotate(-38deg);
- }
- .van-dialog--round-button .van-dialog__footer {
- border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
- padding: 0 !important;
- .van-button--warning {
- color: #333 !important;
- border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
- }
- .van-button--danger {
- color: #3385ff !important;
- }
- .van-button--warning,
- .van-button--danger {
- height: 80px !important;
- border-radius: 0 !important;
- }
- .van-goods-action-button--first {
- border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
- }
- }
- .van-icon-search {
- font-size: 28px;
- margin-right: 10px;
- }
- .top-haveData-bar {
- position: absolute !important;
- width: 100%;
- margin-top: 20px;
- top: 0;
- left: 0;
- z-index: 9;
- }
- </style>
|