reportDetail.vue 13 KB

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