reportPage.vue 15 KB

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