reportPage.vue 16 KB

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