reportDetail.vue 15 KB

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