keyCompany.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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, Mine } 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. async postStopTime(type) {
  233. const res = await Mine.report_selectionAddStopTime({
  234. ArticleId: this.reportDetail.ArticleId,
  235. StopTime: this.readTiem,
  236. OutType: type,
  237. Source: 1,
  238. });
  239. },
  240. },
  241. onLoad() {},
  242. onShow() {
  243. this.readTiem = 0;
  244. this.setIntervalTiem = setInterval(() => {
  245. this.readTiem++;
  246. }, 1000);
  247. if (!this.$store.state.isAuth && !this.$store.state.isBind) this.reportSelectionDetail();
  248. this.$store.commit("setRouterReport", "重点公司");
  249. },
  250. onPageScroll(e) {
  251. this.isShowBackTop = e.scrollTop > 180 ? true : false;
  252. },
  253. onShareAppMessage() {
  254. return {
  255. title: "重点公司",
  256. path: "/reportPages/keyCompany/keyCompany",
  257. };
  258. },
  259. // 页面隐藏/切入后台时触发
  260. async onHide() {
  261. clearInterval(this.setIntervalTiem);
  262. this.postStopTime(2)
  263. },
  264. // 页面卸载时触发
  265. async onUnload() {
  266. clearInterval(this.setIntervalTiem);
  267. this.postStopTime(1)
  268. },
  269. };
  270. </script>
  271. <style lang="scss" scoped>
  272. .content-conmpany {
  273. padding: 30rpx 34rpx;
  274. color: #333;
  275. font-size: 28rpx;
  276. .author-time {
  277. display: flex;
  278. justify-content: space-between;
  279. line-height: 39rpx;
  280. margin: 25rpx 0 35rpx;
  281. }
  282. .content-statement {
  283. display: flex;
  284. color: #707070;
  285. .statement {
  286. margin-left: 10rpx;
  287. color: #3385ff;
  288. }
  289. }
  290. .content-abstract {
  291. margin-top: 30rpx;
  292. :first-child {
  293. float: left;
  294. font-weight: 500;
  295. }
  296. }
  297. .description {
  298. color: #666666;
  299. .detailed {
  300. display: flex;
  301. justify-content: flex-end;
  302. color: #3385ff;
  303. margin: 20rpx 0;
  304. :first-child {
  305. float: left;
  306. margin-right: 10rpx;
  307. color: #333333;
  308. font-weight: 500;
  309. }
  310. }
  311. }
  312. .industry-ul {
  313. margin-bottom: 20rpx;
  314. .industry-li {
  315. display: flex;
  316. margin-bottom: 10rpx;
  317. .industry-name {
  318. width: 42rpx;
  319. display: flex;
  320. justify-content: center;
  321. align-items: center;
  322. background: #3385ff;
  323. color: #fff;
  324. writing-mode: tb-rl;
  325. }
  326. .industry-subject {
  327. flex: 1;
  328. display: flex;
  329. flex-wrap: wrap;
  330. .subject-item {
  331. position: relative;
  332. width: 213rpx;
  333. height: 80rpx;
  334. display: flex;
  335. justify-content: center;
  336. align-items: center;
  337. line-height: 39rpx;
  338. border-bottom: 2rpx solid #ececec;
  339. border-top: 2rpx solid #ececec;
  340. border-right: 2rpx solid #ececec;
  341. text-decoration: underline;
  342. margin-top: -2rpx;
  343. .icon_subject {
  344. position: absolute;
  345. top: 0;
  346. left: 0;
  347. width: 48rpx;
  348. height: 48rpx;
  349. }
  350. }
  351. }
  352. .industry-top-border {
  353. border-top: none !important;
  354. }
  355. .subject-item-top-border {
  356. border-top: 1px solid #ececec;
  357. }
  358. }
  359. }
  360. .back-top {
  361. position: fixed;
  362. z-index: 99;
  363. bottom: 200rpx;
  364. right: 50rpx;
  365. width: 100rpx;
  366. height: 100rpx;
  367. image {
  368. width: 100%;
  369. height: 100%;
  370. }
  371. }
  372. .content-ul {
  373. .content-li {
  374. margin-top: 30rpx;
  375. padding-bottom: 20rpx;
  376. border-bottom: 2rpx dashed #e2e2e2;
  377. font-size: 28rpx;
  378. .content-title {
  379. display: flex;
  380. justify-content: center;
  381. align-items: center;
  382. width: 195rpx;
  383. padding: 3rpx 0;
  384. border-radius: 0rpx 50rpx 50rpx 0rpx;
  385. background-color: #3385ff;
  386. color: #fff;
  387. margin-bottom: 20rpx;
  388. font-size: 32rpx;
  389. image {
  390. width: 32rpx;
  391. height: 34rpx;
  392. margin-right: 15rpx;
  393. }
  394. }
  395. .li-list {
  396. margin-top: 20rpx;
  397. .li-subject {
  398. padding: 20rpx;
  399. margin-bottom: 20rpx;
  400. background: #f2f2f2;
  401. .item-name {
  402. display: inline-block;
  403. font-size: 34rpx;
  404. margin-right: 27rpx;
  405. line-height: 60rpx;
  406. }
  407. .itel-label {
  408. font-size: 30rpx;
  409. display: inline-block;
  410. margin-right: 27rpx;
  411. color: #3385ff;
  412. line-height: 60rpx;
  413. vertical-align: middle;
  414. font-weight: 500;
  415. }
  416. image {
  417. width: 60rpx;
  418. height: 30rpx;
  419. vertical-align: middle;
  420. margin-left: 10rpx;
  421. }
  422. }
  423. .li-item {
  424. margin-top: 20rpx;
  425. margin-bottom: 80rpx;
  426. }
  427. }
  428. }
  429. .subject-detali {
  430. text-align: right;
  431. margin-top: 20rpx;
  432. }
  433. }
  434. .macro-strategy {
  435. display: flex;
  436. align-items: center;
  437. width: 230rpx;
  438. height: 50rpx;
  439. padding-left: 35rpx;
  440. background-color: #3385ff;
  441. color: #fff;
  442. border-radius: 0rpx 50rpx 50rpx 0rpx;
  443. margin: 30rpx 0;
  444. image {
  445. width: 36rpx;
  446. height: 36rpx;
  447. margin-right: 10rpx;
  448. }
  449. }
  450. .nodata-tip {
  451. color: #999;
  452. font-size: 30rpx;
  453. }
  454. }
  455. .noauth-cont {
  456. padding-top: 150rpx;
  457. text-align: center;
  458. font-size: 28rpx;
  459. .noauth-ico {
  460. width: 365rpx;
  461. height: 229rpx;
  462. margin-bottom: 70rpx;
  463. }
  464. .tip {
  465. width: 532rpx;
  466. margin: 0 auto 100rpx;
  467. .contract {
  468. padding: 40rpx 90rpx 0;
  469. line-height: 44rpx;
  470. text {
  471. display: inline-block;
  472. }
  473. }
  474. }
  475. .btn-cont {
  476. width: 368rpx;
  477. height: 80rpx;
  478. // position: relative;
  479. background: linear-gradient(268deg, #2ddbff 0%, #1599ff 49%, #005eff 100%);
  480. color: #fff;
  481. font-size: 34rpx;
  482. margin: 0 auto;
  483. text-align: center;
  484. line-height: 80rpx;
  485. &.back-btn {
  486. background: #fff !important;
  487. color: #2c83ff;
  488. border: 1px solid #2c83ff;
  489. margin-top: 30rpx;
  490. }
  491. .btn_bg {
  492. width: 100%;
  493. height: 80rpx;
  494. position: absolute;
  495. left: 0;
  496. top: 0;
  497. }
  498. .btn-txt {
  499. width: 100%;
  500. position: absolute;
  501. z-index: 1;
  502. }
  503. }
  504. }
  505. </style>