reportPage.vue 17 KB

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