keyCompany.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <view id="keyconmpany" class="container content-conmpany" v-if="haveData">
  3. <block v-if="Object.keys(reportDetail).length > 0">
  4. <view class="report-content-title">{{ reportDetail.Title }}</view>
  5. <view class="author-time">
  6. <text>{{ reportDetail.Department }}</text>
  7. <text>{{ reportDetail.PublishDate }}</text>
  8. </view>
  9. <view class="content-statement">
  10. <text>注:请务必阅读</text>
  11. <text class="statement" @click="isShowStatement = true">免责声明 </text>
  12. </view>
  13. <view class="content-abstract">
  14. <text>产品说明:</text>
  15. <text>{{ reportDetail.ProductDescription }} </text>
  16. </view>
  17. <view class="macro-strategy">
  18. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/macro-strategy.png"></image>
  19. 宏观策略
  20. </view>
  21. <view class="description">
  22. <mp-html :content="strFontSize(reportDetail.MarketStrategy)" />
  23. <view class="detailed">
  24. <text>详细策略报告请</text>
  25. <text @click="reportDetailLink">点击查看</text>
  26. </view>
  27. </view>
  28. <view class="industry-ul">
  29. <view class="industry-li" v-for="(item, index) in dataListSubject" :key="index">
  30. <view class="industry-name">{{ item.PermissionName }}</view>
  31. <view :class="['industry-subject', item.ListSubject.length < 3 && 'industry-top-border']">
  32. <view
  33. :class="['subject-item', 'text_oneLine', item.ListSubject.length < 3 && 'subject-item-top-border']"
  34. @click="positionSubject(key)"
  35. v-for="key in item.ListSubject"
  36. :key="key.IndustrialSubjectId"
  37. >
  38. {{ key.SubjectName }}
  39. <image v-if="key.IsNew" class="icon_subject" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/new_subject.png"></image>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="content-ul">
  45. <view class="content-li" v-for="item in dataList" :key="item.PermissionName">
  46. <view class="content-title">
  47. <image :src="item.IcoLink"></image>
  48. {{ item.PermissionName }}
  49. </view>
  50. <mp-html :content="strFontSize(item.BodyChartSummary)" />
  51. <view class="li-list">
  52. <view class="li-item" v-for="key in item.List" :key="key.IndustrialSubjectId">
  53. <view :id="'subject' + key.IndustrialSubjectId" class="li-subject">
  54. <view class="item-name">
  55. <text style="display: inline-block; vertical-align: middle; font-weight: 600">{{ key.SubjectName }}</text>
  56. <image v-if="key.IsNew" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/new_report.png"></image>
  57. </view>
  58. <text class="itel-label" v-for="val in key.CompanyLabel" :key="val"># {{ val }}</text>
  59. </view>
  60. <mp-html :content="strFontSize(key.Body)" />
  61. <view class="subject-detali" v-if="key.OverviewArticleId > 0">
  62. <text style="display: inline-block">公司综述报告请</text>
  63. <text style="color: #3385ff; margin-left: 10rpx; display: inline-block" @click="goArticle(key.OverviewArticleId)">点击查看</text>
  64. </view>
  65. <view class="subject-detali" v-if="key.List">
  66. <text style="display: inline-block">相关调研纪要、深度报告请</text>
  67. <text style="color: #3385ff; margin-left: 10rpx; display: inline-block" @click="industry(key.List)">点击查看</text>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="back-top" v-if="isShowBackTop" @click="goBackTop">
  74. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_top.png"></image>
  75. </view>
  76. <statement :show="isShowStatement" />
  77. <view class="select-box">
  78. <u-popup v-model="areacodeShow" mode="bottom" @close="cancel">
  79. <view class="box" style="color: #2c83ff" v-for="item in list" :key="item.IndustrialManagementId" @click="industryDetitle(item)"> {{ item.IndustryName }}</view>
  80. <view class="box box-bottom" style="color: #a9afb8" @click="cancel">取消</view>
  81. </u-popup>
  82. </view>
  83. </block>
  84. </view>
  85. <view class="nodata" v-else>
  86. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/report_loading_icon.png" class="nodata_img"></image>
  87. <view class="nodata-tip">正在努力编辑中,请耐心等待...</view>
  88. </view>
  89. </template>
  90. <script>
  91. import { Reports } from "@/config/api.js";
  92. import statement from "@/reportPages/components/statement.vue";
  93. export default {
  94. data() {
  95. return {
  96. list: [],
  97. dataList: [],
  98. dataListSubject: [],
  99. reportDetail: {},
  100. isShowBackTop: false,
  101. isShowStatement: false,
  102. areacodeShow: false,
  103. haveData: true,
  104. };
  105. },
  106. components: { statement },
  107. methods: {
  108. // 返回top
  109. goBackTop() {
  110. wx.pageScrollTo({
  111. selector: ".industry-ul",
  112. duration: 300,
  113. });
  114. },
  115. async reportSelectionDetail() {
  116. const res = await Reports.reportSelectionDetail({
  117. IsBestNew: true,
  118. });
  119. if (res.Ret === 200) {
  120. this.reportDetail = res.Data.Detail;
  121. this.haveData = this.reportDetail ? true : false;
  122. this.dataList = res.Data.List;
  123. this.dataListSubject = res.Data.ListPermissionSubject;
  124. } else {
  125. this.haveData = false;
  126. }
  127. },
  128. // 详细策略报告请
  129. reportDetailLink() {
  130. if (this.reportDetail.CeLueArticleId > 0) {
  131. this.$store.dispatch("checkHandle", "/pageMy/reportDetail/reportDetail?id=" + this.reportDetail.CeLueArticleId);
  132. } else {
  133. uni.showToast({
  134. title: "文章ID有误",
  135. icon: "error",
  136. duration: 2000,
  137. });
  138. }
  139. },
  140. // 锚点
  141. async positionSubject(item) {
  142. let className = `#subject${item.IndustrialSubjectId}`;
  143. uni
  144. .createSelectorQuery()
  145. .select(className)
  146. .boundingClientRect((con) => {
  147. uni
  148. .createSelectorQuery()
  149. .select("#keyconmpany")
  150. .boundingClientRect((res) => {
  151. // 获取根元素要滑动的元素
  152. uni.pageScrollTo({
  153. selector: "#keyconmpany", // 滑动的元素
  154. duration: 300,
  155. scrollTop: con.top - res.top, //到达距离顶部的top值
  156. });
  157. })
  158. .exec();
  159. })
  160. .exec();
  161. const res = await Reports.reportClickHistory({
  162. ArticleId: this.reportDetail.ArticleId,
  163. IndustrialSubjectId: item.IndustrialSubjectId,
  164. });
  165. },
  166. // 公司综述报告请
  167. goArticle(id) {
  168. this.$store.dispatch("checkHandle", "/pageMy/reportDetail/reportDetail?id=" + id);
  169. },
  170. // 判断一个还是多个
  171. industry(item) {
  172. if (item.length > 1) {
  173. this.list = item;
  174. this.areacodeShow = true;
  175. } else if (item.length > 0 || item.length == 1) {
  176. uni.navigateTo({
  177. url: "/reportPages/IndustryReport/IndustryReport?id=" + item[0].IndustrialManagementId,
  178. });
  179. }
  180. },
  181. // 选择后的事件
  182. industryDetitle(item) {
  183. uni.navigateTo({
  184. url: "/reportPages/IndustryReport/IndustryReport?id=" + item.IndustrialManagementId,
  185. });
  186. this.areacodeShow = false;
  187. },
  188. // 选择的取消
  189. cancel() {
  190. this.areacodeShow = false;
  191. },
  192. },
  193. onLoad() {
  194. this.reportSelectionDetail();
  195. },
  196. onShow() {
  197. this.$store.commit("setRouterReport", "重点公司");
  198. },
  199. onPageScroll(e) {
  200. this.isShowBackTop = e.scrollTop > 180 ? true : false;
  201. },
  202. onShareAppMessage() {
  203. return {
  204. title: "重点公司",
  205. path: "/reportPages/keyCompany/keyCompany",
  206. };
  207. },
  208. };
  209. </script>
  210. <style lang="scss" scoped>
  211. .content-conmpany {
  212. padding: 30rpx 34rpx;
  213. color: #333;
  214. font-size: 28rpx;
  215. .author-time {
  216. display: flex;
  217. justify-content: space-between;
  218. line-height: 39rpx;
  219. margin: 25rpx 0 35rpx;
  220. }
  221. .content-statement {
  222. display: flex;
  223. color: #707070;
  224. .statement {
  225. margin-left: 10rpx;
  226. color: #3385ff;
  227. }
  228. }
  229. .content-abstract {
  230. margin-top: 30rpx;
  231. :first-child {
  232. float: left;
  233. font-weight: 500;
  234. }
  235. }
  236. .description {
  237. color: #666666;
  238. .detailed {
  239. display: flex;
  240. justify-content: flex-end;
  241. color: #3385ff;
  242. margin: 20rpx 0;
  243. :first-child {
  244. float: left;
  245. margin-right: 10rpx;
  246. color: #333333;
  247. font-weight: 500;
  248. }
  249. }
  250. }
  251. .industry-ul {
  252. margin-bottom: 20rpx;
  253. .industry-li {
  254. display: flex;
  255. margin-bottom: 10rpx;
  256. .industry-name {
  257. width: 42rpx;
  258. display: flex;
  259. justify-content: center;
  260. align-items: center;
  261. background: #3385ff;
  262. color: #fff;
  263. writing-mode: tb-rl;
  264. }
  265. .industry-subject {
  266. border-top: 1px solid #ececec;
  267. flex: 1;
  268. display: flex;
  269. flex-wrap: wrap;
  270. .subject-item {
  271. position: relative;
  272. width: 213rpx;
  273. height: 63rpx;
  274. display: flex;
  275. justify-content: center;
  276. align-items: center;
  277. line-height: 39rpx;
  278. border-bottom: 1px solid #ececec;
  279. border-right: 1px solid #ececec;
  280. text-decoration: underline;
  281. .icon_subject {
  282. position: absolute;
  283. top: 0;
  284. left: 0;
  285. width: 48rpx;
  286. height: 48rpx;
  287. }
  288. }
  289. }
  290. .industry-top-border {
  291. border-top: none !important;
  292. }
  293. .subject-item-top-border {
  294. border-top: 1px solid #ececec;
  295. }
  296. }
  297. }
  298. .back-top {
  299. position: fixed;
  300. z-index: 99;
  301. bottom: 200rpx;
  302. right: 50rpx;
  303. width: 100rpx;
  304. height: 100rpx;
  305. image {
  306. width: 100%;
  307. height: 100%;
  308. }
  309. }
  310. .content-ul {
  311. .content-li {
  312. margin-top: 30rpx;
  313. padding-bottom: 20rpx;
  314. border-bottom: 2rpx dashed #e2e2e2;
  315. font-size: 28rpx;
  316. .content-title {
  317. display: flex;
  318. justify-content: center;
  319. align-items: center;
  320. width: 195rpx;
  321. padding: 3rpx 0;
  322. border-radius: 0rpx 50rpx 50rpx 0rpx;
  323. background-color: #3385ff;
  324. color: #fff;
  325. margin-bottom: 20rpx;
  326. font-size: 32rpx;
  327. image {
  328. width: 32rpx;
  329. height: 34rpx;
  330. margin-right: 15rpx;
  331. }
  332. }
  333. .li-list {
  334. margin-top: 20rpx;
  335. .li-subject {
  336. padding: 20rpx;
  337. margin-bottom: 20rpx;
  338. background: #f2f2f2;
  339. .item-name {
  340. display: inline-block;
  341. font-size: 30rpx;
  342. margin-right: 27rpx;
  343. line-height: 60rpx;
  344. }
  345. .itel-label {
  346. display: inline-block;
  347. margin-right: 27rpx;
  348. color: #3385ff;
  349. line-height: 60rpx;
  350. vertical-align: middle;
  351. }
  352. image {
  353. width: 60rpx;
  354. height: 30rpx;
  355. vertical-align: middle;
  356. margin-left: 10rpx;
  357. }
  358. }
  359. .li-item {
  360. margin-top: 20rpx;
  361. }
  362. }
  363. }
  364. .subject-detali {
  365. text-align: right;
  366. margin-top: 20rpx;
  367. }
  368. }
  369. .macro-strategy {
  370. display: flex;
  371. align-items: center;
  372. width: 230rpx;
  373. height: 50rpx;
  374. padding-left: 35rpx;
  375. background-color: #3385ff;
  376. color: #fff;
  377. border-radius: 0rpx 50rpx 50rpx 0rpx;
  378. margin: 30rpx 0;
  379. image {
  380. width: 36rpx;
  381. height: 36rpx;
  382. margin-right: 10rpx;
  383. }
  384. }
  385. .nodata-tip {
  386. color: #999;
  387. font-size: 30rpx;
  388. }
  389. }
  390. </style>