reportPage.vue 14 KB

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