keyCompany.vue 11 KB

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