reportPage.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <template>
  2. <block>
  3. <view class="container reportDetail-container" v-if="isUserBindingPhoneNumber">
  4. <block v-if="haveAuth === 1">
  5. <web-view :src="strategyUrl + '?url=' + linkurl" v-if="linkurl">
  6. <cover-view class="search-view">
  7. <cover-view class="search-view-box" v-if="reportInfo.IsShowFollowButton">
  8. <cover-view>若无需此赛道更新推送,请点击</cover-view>
  9. <cover-image
  10. class="search-icon"
  11. @click="isFollowHandler"
  12. :src="reportInfo.IsFollowButton ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/close_follow.png' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/follow_.png'"
  13. ></cover-image>
  14. </cover-view>
  15. </cover-view>
  16. <cover-view class="footer-con">
  17. <cover-view class="handle-item" @click="goRevolvePage">
  18. <cover-image class="download-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/report-revolve.png"></cover-image>
  19. <cover-view>全屏</cover-view>
  20. </cover-view>
  21. <cover-view class="handle-item" @click="leavingMessage">
  22. <cover-image class="download-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/leaving_message.png"></cover-image>
  23. <cover-view>留言</cover-view>
  24. </cover-view>
  25. <cover-view class="handle-item" @click="collectHandle">
  26. <cover-image
  27. class="download-img"
  28. :src="isCollection ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_ico.png'"
  29. ></cover-image>
  30. <cover-view>收藏</cover-view>
  31. </cover-view>
  32. <cover-view class="handle-item" v-if="fileLink" @click="downloadFile">
  33. <cover-image class="download-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/down_ico.png"></cover-image>
  34. <cover-view>下载</cover-view>
  35. </cover-view>
  36. </cover-view>
  37. <cover-view class="footer-free-charge free-charge" v-if="isShowFree">
  38. <cover-image class="img" @click="toggle" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/free_icon.png"></cover-image>
  39. <cover-image @click="removeBton" class="remove-icon" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/free_%20remove.png"></cover-image>
  40. </cover-view>
  41. </web-view>
  42. </block>
  43. <view class="noauth-cont" v-else-if="haveAuth === 2 || haveAuth === 3 || haveAuth === 4 || haveAuth === 5">
  44. <block v-if="!isShowAlert">
  45. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  46. <block v-if="haveAuth !== 3">
  47. <view v-if="reportInfo.IsResearch" class="research-noauth">
  48. 暂无 <text class="strong-text">买方研选</text> 权限
  49. <text style="margin-bottom: 30rpx"> 您可申请开通试用 </text>
  50. </view>
  51. <view class="tip" v-else>您暂无权限查看此报告内容,若想查看可以申请开通对应的试用权限</view>
  52. <view class="btn-cont" @click="applyAuth">{{ isShowAlert ? "立即上传" : "立即申请" }} </view>
  53. </block>
  54. <view class="tip" v-if="haveAuth === 3">
  55. <view v-if="reportInfo.IsResearch" class="research-noauth">
  56. 暂无 <text class="strong-text">买方研选</text> 权限
  57. <text> 点击提交申请,提醒对口销售为你开通试用 </text>
  58. </view>
  59. <block v-else>
  60. 您暂无权限查看此报告内容
  61. <view class="contract">
  62. 若想查看可以联系对口销售
  63. <text @click="callPhone(reportInfo.SellerMobile)">
  64. {{ reportInfo.SellerName }}:<text style="color: #d4bf86">{{ reportInfo.SellerMobile }}</text>
  65. </text>
  66. </view>
  67. <view>申请开通对应的试用权限</view>
  68. </block>
  69. </view>
  70. <view v-if="haveAuth === 3" class="btn-cont" @click="sellerApplyAuth"> {{ isShowText ? "提交申请" : "立即申请" }}</view>
  71. <view class="btn-cont back-btn" @click="backIndex"> 返回 </view>
  72. <view style="margin-top: 100rpx" v-if="reportInfo.IsResearch">
  73. <view class="research-btn" @click="goRouterResearch('介绍')">
  74. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/report_Yx.png"></image>
  75. 点击查看买方研选产品介绍
  76. </view>
  77. <view class="research-btn" @click="goRouterResearch('报价')">
  78. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/quotation_icon.png"></image>
  79. 点击查看买方研选服务报价单
  80. </view>
  81. </view>
  82. </block>
  83. <block v-else>
  84. <text class="moneh-text"> 上传名片并填写简单信息,24小时内我们会为您开通一个月的免费月卡 </text>
  85. <img src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/month_card.png" class="month_card" alt="" />
  86. <view class="btn-cont btn-dl" @click="applyAuth"> 立即上传 </view>
  87. <view class="btn-cont month-back" @click="backIndex"> 返回</view>
  88. </block>
  89. </view>
  90. </view>
  91. <not-have-login v-else />
  92. <Loading />
  93. </block>
  94. </template>
  95. <script>
  96. import { Report, User, Reports, FreeButton } from "@/config/api.js";
  97. import freeCharge from "@/components/freeCharge";
  98. import { reportStrategyUrl } from "@/config/config";
  99. import NotHaveLogin from "@/components/notHaveLogin.vue";
  100. let app = getApp({ allowDefault: true });
  101. export default {
  102. data() {
  103. return {
  104. readTiem: 0,
  105. access_token: "", //用户标识
  106. reportInfo: "",
  107. id: "",
  108. linkurl: "",
  109. setIntervalTiem: null,
  110. fileLink: false,
  111. isCollection: false,
  112. isInterviewApply: false,
  113. isShowTip: false,
  114. showNav: false,
  115. haveAuth: false,
  116. isSendWx: "",
  117. };
  118. },
  119. components: {
  120. freeCharge,
  121. NotHaveLogin,
  122. },
  123. computed: {
  124. shareTitle() {
  125. let title = this.reportInfo.Abstract ? this.reportInfo.Title + "--" + this.reportInfo.Abstract : this.reportInfo.Title;
  126. return title;
  127. },
  128. strategyUrl() {
  129. return reportStrategyUrl;
  130. },
  131. isShowText() {
  132. return this.haveAuth === 3 && this.reportInfo.IsResearch;
  133. },
  134. },
  135. methods: {
  136. // 关注或者取消关注产业
  137. async isFollowHandler() {
  138. const res = await User.userIndustryFollow({
  139. SourceId: this.id,
  140. Source: "article",
  141. DoType: this.reportInfo.IsFollowButton ? "cancel" : "add",
  142. });
  143. if (res.Ret === 200) {
  144. this.reportInfo.IsFollowButton = !this.reportInfo.IsFollowButton;
  145. uni.showToast({
  146. title: res.Msg,
  147. duration: 2000,
  148. });
  149. }
  150. },
  151. /* 获取详情 */
  152. getDetail() {
  153. Report.reportDtl({
  154. ArticleId: this.id,
  155. PageRouter: this.$store.state.pageRouterReport,
  156. IsSendWx: this.isSendWx,
  157. }).then((res) => {
  158. if (res.Ret === 200) {
  159. uni.setNavigationBarTitle({
  160. title: res.Data.Detail.IsSummary == 1 ? "纪要详情" : "报告详情",
  161. });
  162. this.haveAuth = res.Data.HasPermission;
  163. this.isShowWriter = res.Data.IsShow;
  164. this.reportInfo = res.Data.Detail;
  165. if (res.Data.HasPermission === 1) {
  166. //有访问权限
  167. this.isCollection = this.reportInfo.IsCollect;
  168. this.isInterviewApply = this.reportInfo.IsInterviewApply;
  169. this.linkurl = encodeURIComponent(res.Data.Detail.HttpUrl);
  170. this.fileLink = res.Data.Detail.FileLink;
  171. this.access_token = this.access_token || this.$db.get("access_token");
  172. this.$store.dispatch("statistics", { PageType: "ReportParticulars", DetailId: this.id + "" });
  173. }
  174. }
  175. });
  176. },
  177. /* 无权限申请开通权限 */
  178. applyAuth() {
  179. /* 区分是否是潜在用户 */
  180. this.haveAuth === 2
  181. ? User.applyTry({
  182. ApplyMethod: 3,
  183. TryType: "Article",
  184. DetailId: this.id,
  185. }).then((res) => {
  186. if (res.Ret === 200) {
  187. uni.navigateTo({
  188. url: "/pageMy/applyResult/applyResult",
  189. });
  190. }
  191. })
  192. : this.haveAuth === 4
  193. ? uni.navigateTo({
  194. url: "/pageMy/applyTrial/applyTrial?tryType=Article&detailId=" + this.id,
  195. })
  196. : uni.showModal({
  197. title: "",
  198. content: "您已经提交过申请了,请耐心等待",
  199. showCancel: false,
  200. confirmColor: "#365595",
  201. success: function (res) {},
  202. });
  203. },
  204. //销售的立即申请
  205. sellerApplyAuth() {
  206. User.applyTry({
  207. TryType: "Article",
  208. DetailId: this.id,
  209. }).then((res) => {
  210. if (res.Ret === 200) {
  211. uni.showModal({
  212. title: "",
  213. content: "提交申请成功,请耐心等待",
  214. showCancel: false,
  215. confirmColor: "#365595",
  216. success: function (res) {
  217. this.backIndex();
  218. },
  219. });
  220. }
  221. });
  222. },
  223. // 返回首頁
  224. backIndex() {
  225. uni.navigateBack({
  226. fail() {
  227. uni.switchTab({
  228. url: "/pages/index/index",
  229. });
  230. },
  231. });
  232. },
  233. callPhone(num) {
  234. uni.makePhoneCall({
  235. phoneNumber: num,
  236. });
  237. },
  238. /* 申请访谈 */
  239. applyHandle() {
  240. // 申请访谈
  241. !this.isInterviewApply &&
  242. this.$util.modal("", "专家访谈申请会提交给您的对口销售,销售会线下与您取得联系,确定申请吗?", () => {
  243. this.interviewApi();
  244. });
  245. // 取消申请访谈 区分状态 '待邀请','待访谈','已完成','已取消'
  246. if (this.isInterviewApply) {
  247. this.$util.modal(
  248. "",
  249. this.reportInfo.InterviewApplyStatus == "待访谈"
  250. ? "当前无法取消访谈,若有疑问,请联系对口销售"
  251. : this.reportInfo.InterviewApplyStatus == "待邀请"
  252. ? "您要取消此次访谈申请吗?"
  253. : "该访谈已完成",
  254. () => {
  255. this.reportInfo.InterviewApplyStatus == "待邀请"
  256. ? this.interviewApi()
  257. : this.reportInfo.InterviewApplyStatus == "待访谈"
  258. ? uni.makePhoneCall({
  259. phoneNumber: "18767183922",
  260. })
  261. : "";
  262. }
  263. );
  264. }
  265. },
  266. /* 访谈接口 */
  267. interviewApi() {
  268. Report.applyRpt({
  269. ArticleId: this.id,
  270. }).then((res) => {
  271. this.isInterviewApply = !this.isInterviewApply;
  272. });
  273. },
  274. /* 收藏 */
  275. collectHandle() {
  276. Report.collectRpt({
  277. ArticleId: this.id,
  278. PageRouter: this.$store.state.pageRouterReport,
  279. }).then((res) => {
  280. this.isCollection = !this.isCollection;
  281. this.$util.toast(res.Msg);
  282. });
  283. },
  284. /* 错误 */
  285. errorDetails() {
  286. uni.showModal({
  287. confirmText: "知道了",
  288. showCancel: false,
  289. confirmColor: "#3385FF",
  290. content: "网络不好,请刷新重试",
  291. success: (res) => {
  292. uni.navigateBack({
  293. fail() {
  294. uni.switchTab({
  295. url: "/pages/index/index",
  296. });
  297. },
  298. });
  299. },
  300. });
  301. },
  302. async downloadFile() {
  303. const res = await Report.articlePdfwatermark({
  304. ArticleId: this.id,
  305. });
  306. if (res.Ret === 200) {
  307. uni.navigateTo({
  308. url: "/pageMy/downloadFile/downloadFile?url=" + res.Data.FileLink,
  309. });
  310. }
  311. },
  312. btnSearch() {
  313. uni.navigateTo({ url: "/pages-search/indedxSearch/indedxSearch?source=报告详情页面" });
  314. },
  315. //跳转到免费送月卡页面
  316. toggle() {
  317. uni.navigateTo({
  318. url: "/pageMy/freeTrial/freeTrial",
  319. });
  320. },
  321. //隐藏当天的按钮
  322. async removeBton() {
  323. const res = await FreeButton.userFreeButtonUpdate();
  324. },
  325. leavingMessage() {
  326. uni.navigateTo({
  327. url: "/activityPages/generationAsk/generationAsk?id=" + this.id + "&type=文章",
  328. });
  329. },
  330. // 去往横屏页面
  331. goRevolvePage() {
  332. let token = this.reportInfo.HttpUrl;
  333. uni.navigateTo({
  334. url: "/pageMy/reportRevolve/reportRevolve",
  335. events: {
  336. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  337. acceptDataFromOpenedPage: function (data) {
  338. console.log(data);
  339. },
  340. },
  341. success: function (res) {
  342. // 通过eventChannel向被打开页面传送数据
  343. res.eventChannel.emit("acceptDataFromOpenerPage", { url: JSON.stringify(token) });
  344. },
  345. });
  346. },
  347. },
  348. async onShow() {
  349. this.readTiem = 0;
  350. this.setIntervalTiem = setInterval(() => {
  351. this.readTiem++;
  352. }, 1000);
  353. let page = getCurrentPages(); //查看路径
  354. if (page.length === 1) {
  355. if (!this.$store.state.isAuth && !this.$store.state.isBind && this.id > 0) this.getDetail();
  356. } else {
  357. // 跳转入口
  358. this.id > 0 && this.getDetail();
  359. }
  360. },
  361. onLoad(option) {
  362. this.id = option.id ? +option.id : "";
  363. this.isSendWx = option.IsSendWx || "";
  364. if (!this.id && !this.id > 0) {
  365. this.errorDetails();
  366. }
  367. },
  368. /**
  369. * 用户点击分享
  370. */
  371. onShareAppMessage: function (res) {
  372. if (this.id) {
  373. return {
  374. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.shareTitle,
  375. path: "/pageMy/reportDetail/reportDetail?id=" + this.id,
  376. success: (res) => {},
  377. fail: (err) => {},
  378. };
  379. }
  380. },
  381. onHide() {
  382. //页面退出
  383. if (this.id && this.id > 0) {
  384. clearInterval(this.setIntervalTiem);
  385. Reports.addStopTime({
  386. ArticleId: this.id,
  387. StopTime: this.readTiem,
  388. OutType: 2,
  389. Source: "MOBILE",
  390. }).then((res) => {});
  391. }
  392. },
  393. onUnload() {
  394. if (this.id && this.id > 0) {
  395. //页面返回
  396. clearInterval(this.setIntervalTiem);
  397. Reports.addStopTime({
  398. ArticleId: this.id,
  399. StopTime: this.readTiem,
  400. OutType: 1,
  401. Source: "MOBILE",
  402. }).then((res) => {});
  403. }
  404. },
  405. };
  406. </script>
  407. <style lang="scss" scoped>
  408. .reportDetail-container {
  409. background-color: #fff;
  410. padding-bottom: 200rpx;
  411. padding-bottom: calc(200rpx + constant(safe-area-inset-bottom));
  412. padding-bottom: calc(200rpx + env(safe-area-inset-bottom));
  413. .search-view {
  414. position: fixed;
  415. width: 100%;
  416. height: 60rpx;
  417. background: #fff;
  418. z-index: 99999;
  419. font-size: 24rpx;
  420. box-sizing: border-box;
  421. .search-view-box {
  422. display: flex;
  423. align-items: center;
  424. justify-content: center;
  425. background: #3385ff;
  426. color: #fff;
  427. height: 60rpx;
  428. z-index: 99999;
  429. }
  430. .search-icon {
  431. width: 147rpx;
  432. height: 40rpx;
  433. margin: 0 15rpx;
  434. z-index: 99999;
  435. }
  436. }
  437. .footer-con {
  438. position: fixed;
  439. z-index: 99999;
  440. bottom: 0;
  441. padding-bottom: constant(safe-area-inset-bottom);
  442. padding-bottom: env(safe-area-inset-bottom);
  443. left: 0;
  444. width: 100%;
  445. background-color: #ffffff;
  446. display: flex;
  447. justify-content: space-around;
  448. height: 100rpx;
  449. border-top: 1px solid #dddddd;
  450. .handle-item {
  451. align-items: center;
  452. display: flex;
  453. flex-direction: column;
  454. justify-content: center;
  455. position: relative;
  456. z-index: 99999;
  457. .download-img {
  458. width: 44rpx;
  459. height: 44rpx;
  460. margin-bottom: 4rpx;
  461. }
  462. }
  463. }
  464. .footer-free-charge {
  465. .img {
  466. width: 156rpx;
  467. height: 156rpx;
  468. }
  469. .remove-icon {
  470. width: 31rpx;
  471. height: 31rpx;
  472. position: absolute;
  473. right: 0;
  474. top: 0;
  475. }
  476. }
  477. .noauth-cont {
  478. padding-top: 150rpx;
  479. text-align: center;
  480. font-size: 28rpx;
  481. .noauth-ico {
  482. width: 365rpx;
  483. height: 229rpx;
  484. margin-bottom: 70rpx;
  485. }
  486. .tip {
  487. width: 532rpx;
  488. margin: 0 auto 100rpx;
  489. .contract {
  490. padding: 40rpx 90rpx 0;
  491. line-height: 44rpx;
  492. text {
  493. display: inline-block;
  494. }
  495. }
  496. }
  497. .btn-cont {
  498. width: 368rpx;
  499. height: 80rpx;
  500. // position: relative;
  501. background: linear-gradient(268deg, #2ddbff 0%, #1599ff 49%, #005eff 100%);
  502. color: #fff;
  503. font-size: 34rpx;
  504. margin: 0 auto;
  505. text-align: center;
  506. line-height: 80rpx;
  507. &.back-btn {
  508. background: #fff !important;
  509. color: #2c83ff;
  510. border: 1px solid #2c83ff;
  511. margin-top: 30rpx;
  512. }
  513. .btn_bg {
  514. width: 100%;
  515. height: 80rpx;
  516. position: absolute;
  517. left: 0;
  518. top: 0;
  519. }
  520. .btn-txt {
  521. width: 100%;
  522. position: absolute;
  523. z-index: 1;
  524. }
  525. }
  526. }
  527. .month_card {
  528. width: 100%;
  529. height: 565rpx;
  530. padding-left: -20rpx;
  531. }
  532. .btn-dl {
  533. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  534. color: #333 !important;
  535. margin: 30rpx auto !important;
  536. }
  537. .month-back {
  538. background: #f6f6f6 !important;
  539. color: #999 !important;
  540. }
  541. .moneh-text {
  542. text-align: center;
  543. width: 632rpx;
  544. margin: 0 auto 20rpx;
  545. color: #999999;
  546. }
  547. .research-noauth {
  548. color: #333;
  549. font-size: 36rpx;
  550. width: calc(100% + 80rpx);
  551. margin-left: -40rpx;
  552. .strong-text {
  553. display: inline-block;
  554. padding: 0 10rpx;
  555. font-weight: 500;
  556. }
  557. text:last-child {
  558. font-size: 32rpx;
  559. font-size: 34rpx;
  560. color: #999999;
  561. margin-top: 10rpx;
  562. }
  563. }
  564. .research-btn {
  565. display: flex;
  566. align-items: center;
  567. font-size: 32rpx;
  568. width: 546rpx;
  569. height: 78rpx;
  570. margin: 30rpx auto;
  571. background: #f8f8fa;
  572. border-radius: 4rpx;
  573. padding-left: 40rpx;
  574. image {
  575. width: 40rpx;
  576. height: 40rpx;
  577. margin-right: 10rpx;
  578. }
  579. }
  580. }
  581. </style>