reportDetail.vue 13 KB

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