keyCompany.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <template>
  2. <block>
  3. <block v-if="isUserBindingPhoneNumber">
  4. <view id="keyconmpany" class="container content-conmpany" v-if="haveData">
  5. <block v-if="Object.keys(reportDetail).length > 0">
  6. <view class="report-content-title">{{ reportDetail.Title }}</view>
  7. <view class="author-time">
  8. <text>{{ reportDetail.Department }}</text>
  9. <text>{{ reportDetail.PublishDate }}</text>
  10. </view>
  11. <!-- <view class="content-statement">
  12. <text>注:请务必阅读</text>
  13. <text class="statement" @click="isShowStatement = true">免责声明 </text>
  14. </view> -->
  15. <view class="content-statement">
  16. <view style="display: flex"> <text>注:请务必阅读</text> <text class="statement" @click="isShowStatement = true">免责声明 </text>   </view>
  17. <text class="statement" @click="goSecret">往期汇总>> </text>
  18. </view>
  19. <view class="content-abstract">
  20. <text>产品说明:</text>
  21. <text>{{ reportDetail.ProductDescription }} </text>
  22. </view>
  23. <view class="macro-strategy">
  24. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/macro-strategy.png"></image>
  25. 宏观策略
  26. </view>
  27. <view class="description">
  28. <mp-html :content="strFontSize(reportDetail.MarketStrategy)" />
  29. <view class="detailed">
  30. <text>详细策略报告请</text>
  31. <text @click="reportDetailLink">点击查看</text>
  32. </view>
  33. </view>
  34. <view class="industry-ul">
  35. <view class="industry-li" v-for="(item, index) in dataListSubject" :key="index">
  36. <view class="industry-name">{{ item.PermissionName }}</view>
  37. <view :class="['industry-subject', item.ListSubject.length < 3 && 'industry-top-border']">
  38. <view
  39. :class="['subject-item', 'text_oneLine', item.ListSubject.length < 3 && 'subject-item-top-border']"
  40. @click="positionSubject(key)"
  41. v-for="key in item.ListSubject"
  42. :key="key.IndustrialSubjectId"
  43. >
  44. {{ key.SubjectName }}
  45. <image v-if="key.IsNew" class="icon_subject" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/new_subject.png"></image>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="content-ul">
  51. <view class="content-li" v-for="item in dataList" :key="item.PermissionName">
  52. <view class="content-title">
  53. <image :src="item.IcoLink"></image>
  54. {{ item.PermissionName }}
  55. </view>
  56. <mp-html :content="strFontSize(item.BodyChartSummary)" />
  57. <view class="li-list">
  58. <view class="li-item" v-for="key in item.List" :key="key.IndustrialSubjectId">
  59. <view :id="'subject' + key.IndustrialSubjectId" class="li-subject">
  60. <view class="item-name">
  61. <text style="display: inline-block; vertical-align: middle; font-weight: 600">{{ key.SubjectName }}</text>
  62. <image v-if="key.IsNew" src="https://hzstatic.hzinsights.com/cygx/icon/new_report.png"></image>
  63. </view>
  64. <text class="itel-label" v-for="val in key.CompanyLabel" :key="val"># {{ val }}</text>
  65. </view>
  66. <mp-html :content="strFontSize(key.Body)" />
  67. <view style="margin-bottom: 120rpx" v-if="key.OverviewArticleId > 0 || key.List">
  68. <view class="subject-detali" v-if="key.OverviewArticleId > 0">
  69. <text style="display: inline-block">公司综述报告请</text>
  70. <text style="color: #3385ff; margin-left: 10rpx; display: inline-block" @click="goArticle(key.OverviewArticleId)">点击查看</text>
  71. </view>
  72. <view class="subject-detali" v-if="key.List">
  73. <text style="display: inline-block">相关调研纪要、深度报告请</text>
  74. <text style="color: #3385ff; margin-left: 10rpx; display: inline-block" @click="industry(key.List)">点击查看</text>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="back-top" v-if="isShowBackTop" @click="goBackTop">
  82. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_top.png"></image>
  83. </view>
  84. <statement :show="isShowStatement" />
  85. <view class="select-box">
  86. <u-popup v-model="areacodeShow" mode="bottom" @close="cancel">
  87. <view class="box" style="color: #2c83ff" v-for="item in list" :key="item.IndustrialManagementId" @click="industryDetitle(item)"> {{ item.IndustryName }}</view>
  88. <view class="box box-bottom" style="color: #a9afb8" @click="cancel">取消</view>
  89. </u-popup>
  90. </view>
  91. </block>
  92. </view>
  93. <view class="nodata" v-else>
  94. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/report_loading_icon.png" class="nodata_img"></image>
  95. <view class="nodata-tip">正在努力编辑中,请耐心等待...</view>
  96. </view>
  97. </block>
  98. <not-have-login v-else />
  99. <Loading />
  100. </block>
  101. </template>
  102. <script>
  103. import { Reports, Mine } from "@/config/api.js";
  104. import statement from "@/reportPages/components/statement.vue";
  105. import { Throttle } from "@/config/util.js";
  106. import NotHaveLogin from "../../components/notHaveLogin.vue";
  107. export default {
  108. data() {
  109. return {
  110. list: [],
  111. dataList: [],
  112. dataListSubject: [],
  113. reportDetail: {},
  114. isShowBackTop: false,
  115. isShowStatement: false,
  116. areacodeShow: false,
  117. haveData: true,
  118. hasPermission: "",
  119. readTiem: 0,
  120. setIntervalTiem: null,
  121. };
  122. },
  123. components: { statement, NotHaveLogin },
  124. methods: {
  125. // 返回top
  126. goBackTop() {
  127. wx.pageScrollTo({
  128. selector: ".industry-ul",
  129. duration: 300,
  130. });
  131. },
  132. async reportSelectionDetail(option) {
  133. const res = await Reports.reportSelectionDetail({
  134. IsBestNew: option.id ? "" : true,
  135. ActivityId: Number(option.id) || 0,
  136. });
  137. if (res.Ret === 200) {
  138. this.hasPermission = res.Data.HasPermission;
  139. this.reportDetail = res.Data.Detail;
  140. this.haveData = this.reportDetail ? true : false;
  141. this.dataList = res.Data.List;
  142. this.dataListSubject = res.Data.ListPermissionSubject;
  143. } else {
  144. this.haveData = false;
  145. }
  146. },
  147. // 详细策略报告请
  148. reportDetailLink() {
  149. if (this.reportDetail.CeLueArticleId > 0) {
  150. uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + this.reportDetail.CeLueArticleId });
  151. } else {
  152. uni.showToast({
  153. title: "文章ID有误",
  154. icon: "error",
  155. duration: 2000,
  156. });
  157. }
  158. },
  159. // 锚点
  160. positionSubject: Throttle(function (item) {
  161. let className = `#subject${item.IndustrialSubjectId}`;
  162. uni
  163. .createSelectorQuery()
  164. .select(className)
  165. .boundingClientRect((con) => {
  166. uni
  167. .createSelectorQuery()
  168. .select("#keyconmpany")
  169. .boundingClientRect((res) => {
  170. // 获取根元素要滑动的元素
  171. uni.pageScrollTo({
  172. selector: "#keyconmpany", // 滑动的元素
  173. duration: 300,
  174. scrollTop: con.top - res.top, //到达距离顶部的top值
  175. });
  176. })
  177. .exec();
  178. })
  179. .exec();
  180. const res = Reports.reportClickHistory({
  181. ArticleId: this.reportDetail.ArticleId,
  182. IndustrialSubjectId: item.IndustrialSubjectId,
  183. });
  184. }),
  185. // 公司综述报告请
  186. goArticle(id) {
  187. uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + id });
  188. },
  189. // 判断一个还是多个
  190. industry(item) {
  191. if (item.length > 1) {
  192. this.list = item;
  193. this.areacodeShow = true;
  194. } else if (item.length > 0 || item.length == 1) {
  195. uni.navigateTo({
  196. url: "/reportPages/IndustryReport/IndustryReport?id=" + item[0].IndustrialManagementId,
  197. });
  198. }
  199. },
  200. // 选择后的事件
  201. industryDetitle(item) {
  202. uni.navigateTo({
  203. url: "/reportPages/IndustryReport/IndustryReport?id=" + item.IndustrialManagementId,
  204. });
  205. this.areacodeShow = false;
  206. },
  207. // 选择的取消
  208. cancel() {
  209. this.areacodeShow = false;
  210. },
  211. /* 无权限申请开通权限 */
  212. applyAuth() {
  213. this.hasPermission === 4
  214. ? uni.navigateTo({
  215. url: "/pageMy/applyTrial/applyTrial?tryType=ReportSelection&detailId=" + this.id,
  216. })
  217. : uni.showModal({
  218. title: "",
  219. content: "您已经提交过申请了,请耐心等待",
  220. showCancel: false,
  221. confirmColor: "#365595",
  222. success: function (res) {
  223. uni.navigateBack({
  224. fail() {
  225. uni.switchTab({
  226. url: "/pages/index/index",
  227. });
  228. },
  229. });
  230. },
  231. });
  232. },
  233. // 上传阅读时长的记录
  234. async postStopTime(type) {
  235. const res = await Mine.report_selectionAddStopTime({
  236. ArticleId: this.reportDetail.ArticleId,
  237. StopTime: this.readTiem,
  238. OutType: type,
  239. Source: 1,
  240. });
  241. },
  242. // 跳转往期汇总
  243. goSecret() {
  244. uni.navigateTo({
  245. url: "/reportPages/companyTabulation/companyTabulation",
  246. });
  247. },
  248. },
  249. onLoad(option) {
  250. if (!this.$store.state.isAuth && !this.$store.state.isBind) this.reportSelectionDetail(option);
  251. },
  252. onShow() {
  253. this.readTiem = 0;
  254. this.setIntervalTiem = setInterval(() => {
  255. this.readTiem++;
  256. }, 1000);
  257. this.$store.commit("setRouterReport", "重点公司");
  258. },
  259. onPageScroll(e) {
  260. this.isShowBackTop = e.scrollTop > 180 ? true : false;
  261. },
  262. onShareAppMessage() {
  263. return {
  264. title: "重点公司",
  265. path: "/reportPages/keyCompany/keyCompany",
  266. };
  267. },
  268. // 页面隐藏/切入后台时触发
  269. async onHide() {
  270. clearInterval(this.setIntervalTiem);
  271. this.postStopTime(2);
  272. },
  273. // 页面卸载时触发
  274. async onUnload() {
  275. clearInterval(this.setIntervalTiem);
  276. this.postStopTime(1);
  277. },
  278. };
  279. </script>
  280. <style lang="scss" scoped>
  281. .content-conmpany {
  282. padding: 30rpx 34rpx;
  283. color: #333;
  284. font-size: 28rpx;
  285. .author-time {
  286. display: flex;
  287. justify-content: space-between;
  288. line-height: 39rpx;
  289. margin: 25rpx 0 35rpx;
  290. }
  291. .content-statement {
  292. display: flex;
  293. color: #707070;
  294. justify-content: space-between;
  295. .statement {
  296. margin-left: 10rpx;
  297. color: #3385ff;
  298. }
  299. }
  300. .content-abstract {
  301. margin-top: 30rpx;
  302. :first-child {
  303. float: left;
  304. font-weight: 500;
  305. }
  306. }
  307. .description {
  308. color: #666666;
  309. .detailed {
  310. display: flex;
  311. justify-content: flex-end;
  312. color: #3385ff;
  313. margin: 20rpx 0;
  314. :first-child {
  315. float: left;
  316. margin-right: 10rpx;
  317. color: #333333;
  318. font-weight: 500;
  319. }
  320. }
  321. }
  322. .industry-ul {
  323. margin-bottom: 20rpx;
  324. .industry-li {
  325. display: flex;
  326. margin-bottom: 10rpx;
  327. .industry-name {
  328. width: 42rpx;
  329. display: flex;
  330. justify-content: center;
  331. align-items: center;
  332. background: #3385ff;
  333. color: #fff;
  334. writing-mode: tb-rl;
  335. }
  336. .industry-subject {
  337. flex: 1;
  338. display: flex;
  339. flex-wrap: wrap;
  340. .subject-item {
  341. position: relative;
  342. width: 213rpx;
  343. height: 80rpx;
  344. display: flex;
  345. justify-content: center;
  346. align-items: center;
  347. line-height: 39rpx;
  348. border-bottom: 2rpx solid #ececec;
  349. border-top: 2rpx solid #ececec;
  350. border-right: 2rpx solid #ececec;
  351. text-decoration: underline;
  352. margin-top: -2rpx;
  353. .icon_subject {
  354. position: absolute;
  355. top: 0;
  356. left: 0;
  357. width: 48rpx;
  358. height: 48rpx;
  359. }
  360. }
  361. }
  362. .industry-top-border {
  363. border-top: none !important;
  364. }
  365. .subject-item-top-border {
  366. border-top: 1px solid #ececec;
  367. }
  368. }
  369. }
  370. .back-top {
  371. position: fixed;
  372. z-index: 99;
  373. bottom: 200rpx;
  374. right: 50rpx;
  375. width: 100rpx;
  376. height: 100rpx;
  377. image {
  378. width: 100%;
  379. height: 100%;
  380. }
  381. }
  382. .content-ul {
  383. .content-li {
  384. margin-top: 30rpx;
  385. padding-bottom: 20rpx;
  386. border-bottom: 2rpx dashed #e2e2e2;
  387. font-size: 28rpx;
  388. .content-title {
  389. display: flex;
  390. justify-content: center;
  391. align-items: center;
  392. width: 195rpx;
  393. padding: 3rpx 0;
  394. border-radius: 0rpx 50rpx 50rpx 0rpx;
  395. background-color: #3385ff;
  396. color: #fff;
  397. margin-bottom: 20rpx;
  398. font-size: 32rpx;
  399. image {
  400. width: 32rpx;
  401. height: 34rpx;
  402. margin-right: 15rpx;
  403. }
  404. }
  405. .li-list {
  406. margin-top: 20rpx;
  407. .li-subject {
  408. padding: 20rpx;
  409. margin-bottom: 20rpx;
  410. background: #f2f2f2;
  411. .item-name {
  412. display: inline-block;
  413. font-size: 34rpx;
  414. margin-right: 27rpx;
  415. line-height: 60rpx;
  416. }
  417. .itel-label {
  418. font-size: 30rpx;
  419. display: inline-block;
  420. margin-right: 27rpx;
  421. color: #3385ff;
  422. line-height: 60rpx;
  423. vertical-align: middle;
  424. font-weight: 500;
  425. }
  426. image {
  427. width: 60rpx;
  428. height: 30rpx;
  429. vertical-align: middle;
  430. margin-left: 10rpx;
  431. }
  432. }
  433. .li-item {
  434. margin-top: 20rpx;
  435. margin-bottom: 80rpx;
  436. }
  437. }
  438. }
  439. .subject-detali {
  440. text-align: right;
  441. margin-top: 20rpx;
  442. }
  443. }
  444. .macro-strategy {
  445. display: flex;
  446. align-items: center;
  447. width: 230rpx;
  448. height: 50rpx;
  449. padding-left: 35rpx;
  450. background-color: #3385ff;
  451. color: #fff;
  452. border-radius: 0rpx 50rpx 50rpx 0rpx;
  453. margin: 30rpx 0;
  454. image {
  455. width: 36rpx;
  456. height: 36rpx;
  457. margin-right: 10rpx;
  458. }
  459. }
  460. .nodata-tip {
  461. color: #999;
  462. font-size: 30rpx;
  463. }
  464. }
  465. .noauth-cont {
  466. padding-top: 150rpx;
  467. text-align: center;
  468. font-size: 28rpx;
  469. .noauth-ico {
  470. width: 365rpx;
  471. height: 229rpx;
  472. margin-bottom: 70rpx;
  473. }
  474. .tip {
  475. width: 532rpx;
  476. margin: 0 auto 100rpx;
  477. .contract {
  478. padding: 40rpx 90rpx 0;
  479. line-height: 44rpx;
  480. text {
  481. display: inline-block;
  482. }
  483. }
  484. }
  485. .btn-cont {
  486. width: 368rpx;
  487. height: 80rpx;
  488. // position: relative;
  489. background: linear-gradient(268deg, #2ddbff 0%, #1599ff 49%, #005eff 100%);
  490. color: #fff;
  491. font-size: 34rpx;
  492. margin: 0 auto;
  493. text-align: center;
  494. line-height: 80rpx;
  495. &.back-btn {
  496. background: #fff !important;
  497. color: #2c83ff;
  498. border: 1px solid #2c83ff;
  499. margin-top: 30rpx;
  500. }
  501. .btn_bg {
  502. width: 100%;
  503. height: 80rpx;
  504. position: absolute;
  505. left: 0;
  506. top: 0;
  507. }
  508. .btn-txt {
  509. width: 100%;
  510. position: absolute;
  511. z-index: 1;
  512. }
  513. }
  514. }
  515. </style>