reportDetail.vue 12 KB

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