reportPage.vue 15 KB

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