reportDetail.vue 13 KB

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