keyCompany.vue 15 KB

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