reportDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <block>
  3. <view class="container reportDetail-container">
  4. <block v-if="haveAuth == 1">
  5. <web-view :src="strategyUrl + '&isBinding=' + isUserBindingPhoneNumber"> </web-view>
  6. </block>
  7. <view class="noauth-cont" v-else>
  8. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  9. <view class="noauth-title">暂无权限查看此文章</view>
  10. <view v-if="haveAuth == 6 || haveAuth == 7" class="tip">您可申请开通试用</view>
  11. <view class="tip" v-else> 点击提交申请,提醒对口销售为你开通试用 </view>
  12. <view class="btn-cont" @click="applyAuth"> 提交申请</view>
  13. <view class="btn-cont back-btn" @click="backIndex"> 返回 </view>
  14. </view>
  15. </view>
  16. <Loading />
  17. </block>
  18. </template>
  19. <script>
  20. import { Report, User, Reports, FreeButton } from "@/config/api.js";
  21. import freeCharge from "@/components/freeCharge";
  22. import { ficcReport } from "@/config/config";
  23. let app = getApp({ allowDefault: true });
  24. export default {
  25. data() {
  26. return {
  27. readTiem: 0,
  28. access_token: "", //用户标识
  29. reportInfo: "",
  30. id: "",
  31. linkurl: "",
  32. setIntervalTiem: null,
  33. fileLink: false,
  34. isCollection: false,
  35. isInterviewApply: false,
  36. isShowTip: false,
  37. showNav: false,
  38. haveAuth: 1,
  39. isSendWx: "",
  40. lableListForm: {
  41. CategoryName: "",
  42. FieldName: "",
  43. Frequency: "月度",
  44. SubCategoryName: "渠道新声",
  45. },
  46. shareTitle: "",
  47. };
  48. },
  49. components: {
  50. freeCharge,
  51. },
  52. computed: {
  53. strategyUrl() {
  54. let token = this.$db.get("access_token");
  55. let link = `?id=${this.id}&fromType=mpwechat&token=${token}`;
  56. return ficcReport + link;
  57. },
  58. },
  59. methods: {
  60. /* 获取详情 */
  61. getDetail() {
  62. Reports.getFiccYbReportDetails({
  63. ReportId: this.id,
  64. }).then((res) => {
  65. if (res.Ret === 200) {
  66. this.haveAuth = res.Data.HasPermission;
  67. this.reportInfo = res.Data;
  68. this.shareTitle = this.reportInfo.report_info.title;
  69. }
  70. });
  71. },
  72. /* 无权限申请开通权限 */
  73. applyAuth() {
  74. /* 区分是否是潜在用户 */
  75. this.haveAuth === 3 || this.haveAuth === 5
  76. ? User.applyTry({
  77. ApplyMethod: 3,
  78. TryType: "ficcreport",
  79. DetailId: this.id,
  80. }).then((res) => {
  81. if (res.Ret === 200) {
  82. uni.navigateTo({
  83. url: "/pageMy/applyResult/applyResult",
  84. });
  85. }
  86. })
  87. : this.haveAuth === 7
  88. ? uni.navigateTo({
  89. url: "/pageMy/applyTrial/applyTrial?tryType=ficcreport&detailId=" + this.id,
  90. })
  91. : uni.showModal({
  92. title: "",
  93. content: "您已经提交过申请了,请耐心等待",
  94. showCancel: false,
  95. confirmColor: "#365595",
  96. success: function (res) {},
  97. });
  98. },
  99. // 返回首頁
  100. backIndex() {
  101. uni.navigateBack({
  102. fail() {
  103. uni.switchTab({
  104. url: "/pages/index/index",
  105. });
  106. },
  107. });
  108. },
  109. /* 错误 */
  110. errorDetails() {
  111. uni.showModal({
  112. confirmText: "知道了",
  113. showCancel: false,
  114. confirmColor: "#376cbb",
  115. content: "网络不好,请刷新重试",
  116. success: (res) => {
  117. uni.navigateBack({
  118. fail() {
  119. uni.switchTab({
  120. url: "/pages/index/index",
  121. });
  122. },
  123. });
  124. },
  125. });
  126. },
  127. Search() {
  128. uni.navigateTo({ url: "/pages-search/indedxSearch/indedxSearch?source=报告详情页面" });
  129. },
  130. setDisableCapture() {
  131. wx.setVisualEffectOnCapture({
  132. visualEffect: "hidden",
  133. complete: (res) => {
  134. console.log(res);
  135. },
  136. });
  137. },
  138. closeDisableCapture() {
  139. wx.setVisualEffectOnCapture({
  140. visualEffect: "none",
  141. });
  142. },
  143. },
  144. async onShow() {
  145. this.readTiem = 0;
  146. this.setIntervalTiem = setInterval(() => {
  147. this.readTiem++;
  148. }, 1000);
  149. let page = getCurrentPages(); //查看路径
  150. if (page.length === 1) {
  151. this.getDetail();
  152. } else {
  153. // 跳转入口
  154. this.id > 0 && this.getDetail();
  155. }
  156. },
  157. onLoad(option) {
  158. uni.setNavigationBarTitle({
  159. title: "报告详情",
  160. });
  161. this.id = option.id ? +option.id : "";
  162. this.isSendWx = option.IsSendWx || "";
  163. if (!this.id && !this.id > 0) {
  164. this.errorDetails();
  165. }
  166. },
  167. /**
  168. * 用户点击分享
  169. */
  170. onShareAppMessage: function (res) {
  171. if (this.id) {
  172. return {
  173. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.shareTitle,
  174. path: "/pages-ficc/reportDetail/reportDetail?id=" + this.id,
  175. success: (res) => {},
  176. fail: (err) => {},
  177. };
  178. }
  179. },
  180. onHide() {
  181. //页面退出
  182. if (this.id && this.id > 0) {
  183. clearInterval(this.setIntervalTiem);
  184. Reports.addStopTime({
  185. ArticleId: this.reportInfo.report_info.ArticleId,
  186. StopTime: this.readTiem,
  187. OutType: 2,
  188. Source: "MOBILE",
  189. }).then((res) => {});
  190. }
  191. this.closeDisableCapture();
  192. },
  193. onUnload() {
  194. if (this.id && this.id > 0) {
  195. //页面返回
  196. clearInterval(this.setIntervalTiem);
  197. Reports.addStopTime({
  198. ArticleId: this.reportInfo.report_info.ArticleId,
  199. StopTime: this.readTiem,
  200. OutType: 1,
  201. Source: "MOBILE",
  202. }).then((res) => {});
  203. }
  204. this.closeDisableCapture();
  205. },
  206. };
  207. </script>
  208. <style lang="scss" scoped>
  209. .reportDetail-container {
  210. background-color: #fff;
  211. .search-view {
  212. position: fixed;
  213. width: 100%;
  214. height: 60rpx;
  215. background: #fff;
  216. z-index: 99999;
  217. font-size: 24rpx;
  218. box-sizing: border-box;
  219. .search-view-box {
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. background: #376cbb;
  224. color: #fff;
  225. height: 60rpx;
  226. z-index: 99999;
  227. }
  228. .search-icon {
  229. width: 147rpx;
  230. height: 40rpx;
  231. margin: 0 15rpx;
  232. z-index: 99999;
  233. }
  234. }
  235. .footer-con {
  236. position: fixed;
  237. z-index: 99999;
  238. bottom: 0;
  239. padding-bottom: constant(safe-area-inset-bottom);
  240. padding-bottom: env(safe-area-inset-bottom);
  241. left: 0;
  242. width: 100%;
  243. background-color: #ffffff;
  244. display: flex;
  245. justify-content: space-around;
  246. height: 100rpx;
  247. border-top: 1px solid #dddddd;
  248. .handle-item {
  249. align-items: center;
  250. display: flex;
  251. flex-direction: column;
  252. justify-content: center;
  253. position: relative;
  254. z-index: 99999;
  255. .download-img {
  256. width: 44rpx;
  257. height: 44rpx;
  258. margin-bottom: 4rpx;
  259. }
  260. }
  261. }
  262. .footer-free-charge {
  263. .img {
  264. width: 156rpx;
  265. height: 156rpx;
  266. }
  267. .remove-icon {
  268. width: 31rpx;
  269. height: 31rpx;
  270. position: absolute;
  271. right: 0;
  272. top: 0;
  273. }
  274. }
  275. .noauth-cont {
  276. padding-top: 170rpx;
  277. text-align: center;
  278. font-size: 28rpx;
  279. .noauth-ico {
  280. width: 365rpx;
  281. height: 229rpx;
  282. margin-bottom: 70rpx;
  283. }
  284. .tip {
  285. width: 532rpx;
  286. margin: 0 auto 100rpx;
  287. .contract {
  288. padding: 40rpx 90rpx 0;
  289. line-height: 44rpx;
  290. text {
  291. display: inline-block;
  292. }
  293. }
  294. }
  295. .btn-cont {
  296. width: 500rpx;
  297. height: 52rpx;
  298. background: $uni-color-new;
  299. color: #fff;
  300. font-size: 24rpx;
  301. font-weight: 600;
  302. border-radius: 8rpx;
  303. margin: 0 auto;
  304. text-align: center;
  305. line-height: 52rpx;
  306. &.back-btn {
  307. background: #e5efff !important;
  308. color: $uni-color-new;
  309. margin-top: 30rpx;
  310. }
  311. .btn_bg {
  312. width: 100%;
  313. height: 80rpx;
  314. position: absolute;
  315. left: 0;
  316. top: 0;
  317. }
  318. .btn-txt {
  319. width: 100%;
  320. position: absolute;
  321. z-index: 1;
  322. }
  323. }
  324. .product-introduction-box {
  325. background-color: $uni-bg-color;
  326. padding-top: 10rpx;
  327. margin-top: 60rpx;
  328. .product-introduction {
  329. padding: 60rpx 0 0 60rpx;
  330. background-color: white;
  331. .introduction-header {
  332. margin-bottom: 40rpx;
  333. display: flex;
  334. .introduction-header-left {
  335. background-color: #caaf8b;
  336. height: 90rpx;
  337. width: 14rpx;
  338. margin-right: 20rpx;
  339. }
  340. .introduction-header-right {
  341. text-align: left;
  342. .introduction-title-CN {
  343. font-weight: 500;
  344. font-size: 34rpx;
  345. color: #333333;
  346. line-height: 42rpx;
  347. margin-bottom: 8rpx;
  348. }
  349. .introduction-title-US {
  350. font-weight: 400;
  351. font-size: 28rpx;
  352. color: #c0c4cc;
  353. line-height: 42rpx;
  354. }
  355. }
  356. }
  357. .introduction-body {
  358. .introduction-body-box {
  359. text-align: left;
  360. margin-bottom: 40rpx;
  361. .body-row-content {
  362. margin-bottom: 40rpx;
  363. font-size: 34rpx;
  364. line-height: 48rpx;
  365. font-weight: 600;
  366. color: #caaf8b;
  367. .body-row-title {
  368. margin-left: 40rpx;
  369. }
  370. }
  371. .body-box-title {
  372. font-weight: 600;
  373. font-size: 34rpx;
  374. line-height: 48rpx;
  375. padding-left: 40rpx;
  376. position: relative;
  377. margin-bottom: 22rpx;
  378. &::before {
  379. content: "";
  380. height: 20rpx;
  381. width: 20rpx;
  382. background-color: #caaf8b;
  383. border-radius: 20rpx;
  384. position: absolute;
  385. left: 0;
  386. top: 16rpx;
  387. }
  388. }
  389. .introduction-body-row {
  390. margin-left: 40rpx;
  391. font-weight: 400;
  392. font-size: 26rpx;
  393. color: #333333;
  394. line-height: 36rpx;
  395. }
  396. .highHight-text {
  397. color: #caaf8b;
  398. }
  399. }
  400. }
  401. }
  402. }
  403. }
  404. .month_card {
  405. width: 100%;
  406. height: 565rpx;
  407. padding-left: -20rpx;
  408. }
  409. .btn-dl {
  410. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  411. color: #333 !important;
  412. margin: 30rpx auto !important;
  413. }
  414. .month-back {
  415. background: #f6f6f6 !important;
  416. color: #999 !important;
  417. }
  418. .moneh-text {
  419. text-align: center;
  420. width: 632rpx;
  421. margin: 0 auto 20rpx;
  422. color: #999999;
  423. }
  424. .research-noauth {
  425. color: #333;
  426. font-size: 36rpx;
  427. width: calc(100% + 80rpx);
  428. margin-left: -40rpx;
  429. .strong-text {
  430. display: inline-block;
  431. padding: 0 10rpx;
  432. font-weight: 500;
  433. }
  434. text:last-child {
  435. font-size: 32rpx;
  436. font-size: 34rpx;
  437. color: #999999;
  438. margin-top: 10rpx;
  439. }
  440. }
  441. }
  442. .no-binding {
  443. padding: 30rpx;
  444. background-color: #f0f1f5;
  445. .lable-content {
  446. display: flex;
  447. flex-wrap: wrap;
  448. .item {
  449. font-size: 24rpx;
  450. height: 34rpx;
  451. padding: 0 16rpx;
  452. display: flex;
  453. align-items: center;
  454. border: 1rpx solid #ccc;
  455. border-radius: 2rpx;
  456. margin-right: 20rpx;
  457. margin-bottom: 20rpx;
  458. }
  459. }
  460. .no-binding-content {
  461. width: 100%;
  462. background-color: #fff;
  463. padding: 40rpx 20rpx;
  464. .title {
  465. font-size: 34rpx;
  466. font-weight: 500;
  467. line-height: 48rpx;
  468. color: #333;
  469. }
  470. .tiem {
  471. font-size: 24rpx;
  472. color: #999999;
  473. margin: 20rpx 0;
  474. }
  475. .content {
  476. display: flex;
  477. .content-line {
  478. width: 4rpx;
  479. background-color: #333;
  480. margin-right: 20rpx;
  481. }
  482. .content-text {
  483. font-size: 34rpx;
  484. font-weight: 500;
  485. color: #333;
  486. }
  487. .describe {
  488. margin-top: 20rpx;
  489. }
  490. }
  491. }
  492. .please-login {
  493. margin: 50rpx auto 150rpx;
  494. width: 556rpx;
  495. height: 64rpx;
  496. color: #fff;
  497. font-size: 24rpx;
  498. font-weight: 600;
  499. background-color: #376cbb;
  500. display: flex;
  501. align-items: center;
  502. justify-content: center;
  503. border-radius: 9rpx;
  504. }
  505. }
  506. .noauth-title {
  507. font-size: 32rpx;
  508. font-weight: 600;
  509. margin-bottom: 15rpx;
  510. }
  511. </style>