reportPage.vue 14 KB

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