reportDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <template>
  2. <block>
  3. <view class="container reportDetail-container" v-if="isUserBindingPhoneNumber">
  4. <block v-if="haveAuth === 1">
  5. <!-- 链接地址 -->
  6. <web-view :src="linkurl + '?id=' + id + '&fromType=mpwechat&token=' + access_token + '&IsSendWx=' + isSendWx"></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. <view style="margin-top: 100rpx" v-if="reportInfo.IsResearch">
  46. <view class="research-btn" @click="goRouterResearch('介绍')">
  47. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/report_Yx.png"></image>
  48. 点击查看买方研选产品介绍
  49. </view>
  50. <view class="research-btn" @click="goRouterResearch('报价')">
  51. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/quotation_icon.png"></image>
  52. 点击查看买方研选服务报价单
  53. </view>
  54. </view>
  55. </block>
  56. <block v-else>
  57. <text class="moneh-text"> 上传名片并填写简单信息,24小时内我们会为您开通一个月的免费月卡 </text>
  58. <img src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/month_card.png" class="month_card" alt="" />
  59. <view class="btn-cont btn-dl" @click="applyAuth"> 立即上传 </view>
  60. <view class="btn-cont month-back" @click="backIndex"> 返回</view>
  61. </block>
  62. </block>
  63. </view>
  64. </view>
  65. <not-have-login v-else />
  66. <Loading />
  67. </block>
  68. </template>
  69. <script>
  70. import { Report, User, Reports, FreeButton } from "@/config/api.js";
  71. import { reportLinkUrl } from "@/config/config";
  72. import notHaveLogin from "@/components/notHaveLogin.vue";
  73. export default {
  74. components: { notHaveLogin },
  75. data() {
  76. return {
  77. access_token: "", //用户标识
  78. reportInfo: "",
  79. id: "",
  80. readTiem: 0,
  81. setIntervalTiem: null,
  82. isShowAlert: false,
  83. haveAuth: false,
  84. isSpecialArticle_report: false,
  85. isSendWx: "",
  86. };
  87. },
  88. computed: {
  89. linkurl() {
  90. return reportLinkUrl;
  91. },
  92. isShowText() {
  93. return this.haveAuth === 3 && this.reportInfo.IsResearch;
  94. },
  95. },
  96. methods: {
  97. /* 获取详情 */
  98. getDetail() {
  99. Report.reportDtl({
  100. ArticleId: this.id,
  101. PageRouter: this.$store.state.pageRouterReport,
  102. IsSendWx: this.isSendWx,
  103. }).then((res) => {
  104. if (res.Ret === 200) {
  105. this.$store.commit("setRouterReport", "报告详情");
  106. uni.setNavigationBarTitle({
  107. title: res.Data.Detail.IsSummary == 1 ? "纪要详情" : "报告详情",
  108. });
  109. this.haveAuth = res.Data.HasPermission;
  110. this.isShowWriter = res.Data.IsShow;
  111. this.isSpecialArticle_report = res.Data.IsSpecialArticle;
  112. this.reportInfo = res.Data.Detail;
  113. if (res.Data.HasPermission === 1) {
  114. //有访问权限
  115. if (res.Data.Detail.IsNeedJump) {
  116. uni.redirectTo({
  117. url: "/pageMy/reportPage/reportPage?id=" + this.id + "&IsSendWx=" + this.isSendWx,
  118. });
  119. }
  120. this.access_token = this.access_token || this.$db.get("access_token");
  121. this.$store.dispatch("statistics", { PageType: "ReportParticulars", DetailId: this.id + "" });
  122. }
  123. }
  124. });
  125. },
  126. /* 无权限申请开通权限 */
  127. applyAuth() {
  128. /* 区分是否是潜在用户 */
  129. this.haveAuth === 2
  130. ? User.applyTry({
  131. ApplyMethod: 3,
  132. TryType: "Article",
  133. DetailId: this.id,
  134. }).then((res) => {
  135. if (res.Ret === 200) {
  136. uni.navigateTo({
  137. url: "/pageMy/applyResult/applyResult",
  138. });
  139. }
  140. })
  141. : this.haveAuth === 4
  142. ? uni.navigateTo({
  143. url: "/pageMy/applyTrial/applyTrial?tryType=Article&detailId=" + this.id,
  144. })
  145. : uni.showModal({
  146. title: "",
  147. content: "您已经提交过申请了,请耐心等待",
  148. showCancel: false,
  149. confirmColor: "#365595",
  150. success: function (res) {},
  151. });
  152. },
  153. // 销售的立即申请
  154. sellerApplyAuth() {
  155. User.applyTry({
  156. TryType: "Article",
  157. DetailId: this.id,
  158. }).then((res) => {
  159. if (res.Ret === 200) {
  160. uni.showModal({
  161. title: "",
  162. content: "提交申请成功,请耐心等待",
  163. showCancel: false,
  164. confirmColor: "#365595",
  165. success: function (res) {
  166. this.backIndex();
  167. },
  168. });
  169. }
  170. });
  171. },
  172. // 返回首頁
  173. backIndex() {
  174. uni.navigateBack({
  175. fail() {
  176. uni.switchTab({
  177. url: "/pages/index/index",
  178. });
  179. },
  180. });
  181. },
  182. // 拨打电话
  183. callPhone(num) {
  184. uni.makePhoneCall({
  185. phoneNumber: num,
  186. });
  187. },
  188. /* 申请访谈 */
  189. applyHandle() {
  190. // 申请访谈
  191. !this.reportInfo.IsInterviewApply &&
  192. this.$util.modal("", "专家访谈申请会提交给您的对口销售,销售会线下与您取得联系,确定申请吗?", () => {
  193. this.interviewApi();
  194. });
  195. // 取消申请访谈 区分状态 '待邀请','待访谈','已完成','已取消'
  196. if (this.reportInfo.IsInterviewApply) {
  197. // this.reportInfo.InterviewApplyStatus
  198. this.$util.modal(
  199. "",
  200. this.reportInfo.InterviewApplyStatus == "待访谈"
  201. ? "当前无法取消访谈,若有疑问,请联系对口销售"
  202. : this.reportInfo.InterviewApplyStatus == "待邀请"
  203. ? "您要取消此次访谈申请吗?"
  204. : "该访谈已完成",
  205. () => {
  206. this.reportInfo.InterviewApplyStatus == "待邀请"
  207. ? this.interviewApi()
  208. : this.reportInfo.InterviewApplyStatus == "待访谈"
  209. ? uni.makePhoneCall({
  210. phoneNumber: "18767183922",
  211. })
  212. : "";
  213. }
  214. );
  215. }
  216. },
  217. /* 访谈接口 */
  218. interviewApi() {
  219. Report.applyRpt({
  220. ArticleId: this.id,
  221. }).then((res) => {
  222. this.reportInfo.IsInterviewApply = !this.reportInfo.IsInterviewApply;
  223. });
  224. },
  225. /* 收藏 */
  226. collectHandle() {
  227. Report.collectRpt({
  228. ArticleId: this.id,
  229. PageRouter: this.$store.state.pageRouterReport,
  230. }).then((res) => {
  231. this.reportInfo.IsCollect = !this.reportInfo.IsCollect;
  232. this.$util.toast(res.Msg);
  233. });
  234. },
  235. /* 错误 */
  236. errorDetails() {
  237. uni.showModal({
  238. confirmText: "知道了",
  239. showCancel: false,
  240. confirmColor: "#3385FF",
  241. content: "网络不好,请刷新重试",
  242. success: (res) => {
  243. uni.navigateBack({
  244. fail() {
  245. uni.switchTab({
  246. url: "/pages/index/index",
  247. });
  248. },
  249. });
  250. },
  251. });
  252. },
  253. // 获取权限弹窗是否展示免费月卡接口
  254. async userIsShowAlert() {
  255. const res = await FreeButton.userIsShowAlert();
  256. if (res.Ret === 200) {
  257. this.isShowAlert = res.Data.IsShow;
  258. }
  259. },
  260. /* 跳转研选 */
  261. goRouterResearch(type) {
  262. if (type == "介绍") {
  263. uni.navigateTo({
  264. url: "/pages-purchaser/productIntroduction/productIntroduction",
  265. });
  266. } else {
  267. uni.navigateTo({
  268. url: "/pages-purchaser/ProductQuotation/ProductQuotation",
  269. });
  270. }
  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. if (!this.$store.state.isAuth && !this.$store.state.isBind && this.id > 0) this.getDetail();
  281. } else {
  282. // 跳转入口
  283. this.id > 0 && this.getDetail();
  284. }
  285. },
  286. onLoad(option) {
  287. this.id = option.id ? +option.id : "";
  288. this.isSendWx = option.IsSendWx || "";
  289. if (!this.id && !this.id > 0) {
  290. this.errorDetails();
  291. }
  292. // 免费送月卡
  293. // this.userIsShowAlert();
  294. },
  295. /**
  296. * 用户点击分享
  297. */
  298. onShareAppMessage: function (res) {
  299. if (this.id) {
  300. return {
  301. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.reportInfo.Title,
  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: 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: 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: 20rpx 34rpx 134rpx;
  338. .report-top {
  339. color: #999999;
  340. .report-title {
  341. color: #4a4a4a;
  342. font-size: 34rpx;
  343. }
  344. .report_desc {
  345. display: flex;
  346. justify-content: space-between;
  347. align-items: center;
  348. margin: 20rpx 0;
  349. }
  350. .tip {
  351. color: #586eb5;
  352. display: inline;
  353. }
  354. }
  355. .detail-report {
  356. padding: 40rpx 0;
  357. }
  358. .statement {
  359. max-width: 670rpx;
  360. max-height: 900rpx;
  361. line-height: 42rpx;
  362. overflow-y: auto;
  363. padding: 40rpx;
  364. }
  365. .fixed_cont {
  366. width: 100%;
  367. // height: 114rpx;
  368. padding: 10rpx 0;
  369. position: fixed;
  370. bottom: 0;
  371. left: 0;
  372. z-index: 99999;
  373. display: flex;
  374. justify-content: center;
  375. align-items: center;
  376. flex-direction: row;
  377. background-color: #fff;
  378. box-shadow: 0 -3rpx 6rpx rgba($color: #6a6a6a, $alpha: 0.16);
  379. .handle-item {
  380. font-size: 24rpx;
  381. color: #d0cfd5;
  382. text-align: center;
  383. margin-right: 130rpx;
  384. &:last-child {
  385. margin-right: 0;
  386. }
  387. .img_ico {
  388. width: 56rpx;
  389. height: 54rpx;
  390. margin: 0 auto;
  391. }
  392. }
  393. .button-item {
  394. background-color: transparent;
  395. line-height: normal;
  396. }
  397. }
  398. .noauth-cont {
  399. padding-top: 150rpx;
  400. text-align: center;
  401. font-size: 28rpx;
  402. .noauth-ico {
  403. width: 365rpx;
  404. height: 229rpx;
  405. margin-bottom: 70rpx;
  406. }
  407. .tip {
  408. width: 532rpx;
  409. margin: 0 auto 100rpx;
  410. .contract {
  411. padding: 40rpx 90rpx 0;
  412. line-height: 44rpx;
  413. text {
  414. display: inline-block;
  415. }
  416. }
  417. }
  418. .btn-cont {
  419. width: 368rpx;
  420. height: 80rpx;
  421. // position: relative;
  422. background: linear-gradient(268deg, #2ddbff 0%, #1599ff 49%, #005eff 100%);
  423. color: #fff;
  424. font-size: 34rpx;
  425. margin: 0 auto;
  426. text-align: center;
  427. line-height: 80rpx;
  428. &.back-btn {
  429. background: #fff !important;
  430. color: #2c83ff;
  431. border: 1px solid #2c83ff;
  432. margin-top: 30rpx;
  433. }
  434. .btn_bg {
  435. width: 100%;
  436. height: 80rpx;
  437. position: absolute;
  438. left: 0;
  439. top: 0;
  440. }
  441. .btn-txt {
  442. width: 100%;
  443. position: absolute;
  444. z-index: 1;
  445. }
  446. }
  447. }
  448. .month_card {
  449. width: 100%;
  450. height: 565rpx;
  451. padding-left: -20rpx;
  452. }
  453. .btn-dl {
  454. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  455. color: #333 !important;
  456. margin: 30rpx auto !important;
  457. }
  458. .month-back {
  459. background: #f6f6f6 !important;
  460. color: #999 !important;
  461. }
  462. .moneh-text {
  463. text-align: center;
  464. width: 632rpx;
  465. margin: 0 auto 20rpx;
  466. color: #999999;
  467. }
  468. .research-noauth {
  469. color: #333;
  470. font-size: 36rpx;
  471. width: calc(100% + 80rpx);
  472. margin-left: -40rpx;
  473. .strong-text {
  474. display: inline-block;
  475. padding: 0 10rpx;
  476. font-weight: 500;
  477. }
  478. text:last-child {
  479. font-size: 32rpx;
  480. font-size: 34rpx;
  481. color: #999999;
  482. margin-top: 10rpx;
  483. }
  484. }
  485. .research-btn {
  486. display: flex;
  487. align-items: center;
  488. font-size: 32rpx;
  489. width: 546rpx;
  490. height: 78rpx;
  491. margin: 30rpx auto;
  492. background: #f8f8fa;
  493. border-radius: 4rpx;
  494. padding-left: 40rpx;
  495. /* 字体/333 */
  496. image {
  497. width: 40rpx;
  498. height: 40rpx;
  499. margin-right: 10rpx;
  500. }
  501. }
  502. }
  503. </style>