reportDetail.vue 13 KB

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