keyCompany.vue 17 KB

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