keyCompany.vue 11 KB

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