keyCompany.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class="container content-conmpany">
  3. <view class="top-tabs">
  4. <view :class="['item', item.value == tabsActive && 'tabs-active']" v-for="item in tabList" :key="item.value" @click="topTabsChange(item)">
  5. {{ item.name }}
  6. <view v-if="item.value == tabsActive" class="item-active"></view>
  7. </view>
  8. </view>
  9. <view :class="['collect-ul', tabsActive == 1 && 'chart-content']" v-if="haveData">
  10. <block v-if="tabsActive == 2">
  11. <view class="collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item)">
  12. <text class="title text_twoLine"
  13. >{{ item.Title }}
  14. <text class="reg-text" v-if="item.IsRed"></text>
  15. </text>
  16. <view class="content">
  17. <view class="item-left">
  18. <view class="abstract">{{ item.Abstract }}</view>
  19. <view class="desc">
  20. <text class="publishDate">{{ item.PublishDate }}</text>
  21. </view>
  22. </view>
  23. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  24. </view>
  25. </view>
  26. </block>
  27. <block v-else>
  28. <view class="chart-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item)">
  29. <view class="ltem-title text_twoLine">{{ item.Title }}</view>
  30. <view class="item-content-img">
  31. <image :src="item.BodyHtml" mode=""></image>
  32. </view>
  33. <view class="chart-tag">
  34. <text class="tag-item" v-if="item.PtagName">{{ item.PtagName }}</text>
  35. <text class="tag-item" v-if="item.CtagName">{{ item.CtagName }}</text>
  36. </view>
  37. </view>
  38. </block>
  39. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  40. </view>
  41. <view class="nodata" v-else>
  42. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  43. <text>暂时没有报告的内容</text>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import { Reports } from "@/config/api.js";
  49. export default {
  50. data() {
  51. return {
  52. tabList: [
  53. { name: "季度关注", value: 1 },
  54. { name: "年度关注", value: 2 },
  55. ],
  56. tabsActive: 1,
  57. page_no: 1,
  58. pageSize: 10,
  59. collectList: [],
  60. haveData: true,
  61. totalPage: "",
  62. status: "loadmore",
  63. loadText: {
  64. loadmore: "上拉加载更多",
  65. loading: "加载中",
  66. nomore: "已经到底了",
  67. },
  68. };
  69. },
  70. methods: {
  71. // 头部选择框事件
  72. topTabsChange(item) {
  73. this.tabsActive = item.value;
  74. this.collectList = [];
  75. this.getList();
  76. },
  77. //获取数据
  78. async getList() {
  79. const res =
  80. this.tabsActive == 2
  81. ? await Reports.reportListByType({
  82. PageSize: this.pageSize,
  83. CurrentIndex: this.page_no,
  84. ReportType: 1,
  85. })
  86. : await Reports.getChartQuarter({
  87. PageSize: this.pageSize,
  88. CurrentIndex: this.page_no,
  89. });
  90. if (res.Ret == 200) {
  91. this.status = res.Data.Paging.IsEnd ? "nomore" : "loadmore";
  92. this.totalPage = res.Data.Paging.Pages; //总页数
  93. if (this.page_no === 1) {
  94. this.collectList = res.Data.List || [];
  95. this.haveData = this.collectList.length ? true : false;
  96. } else {
  97. this.collectList = this.collectList.concat(res.Data.List);
  98. }
  99. }
  100. },
  101. //跳转详情
  102. goDetail(item) {
  103. /* 无需授权且已绑定 检验是或否有权限 */
  104. if (this.tabsActive == 2) {
  105. item.IsRed = false;
  106. this.$store.dispatch("checkHandle", "/reportPages/reportSecretDetail/reportSecretDetail?type=1&id=" + item.ArticleId);
  107. } else {
  108. this.$store.dispatch("checkHandle", "/pageMy/chartPage/chartPage?id=" + item.ChartId);
  109. }
  110. },
  111. },
  112. onLoad() {
  113. this.getList();
  114. },
  115. onShow() {
  116. this.$store.commit("setRouterReport", "重点公司");
  117. },
  118. onReachBottom() {
  119. if (this.status === "nomore") return;
  120. this.status = "loading";
  121. this.page_no++;
  122. this.getList();
  123. },
  124. };
  125. </script>
  126. <style lang="scss" scoped>
  127. .content-conmpany {
  128. background: #f7f7f7;
  129. padding-bottom: 30rpx;
  130. .top-tabs {
  131. position: sticky;
  132. top: 0;
  133. left: 0;
  134. height: 78rpx;
  135. width: 100%;
  136. display: flex;
  137. padding: 10rpx 35rpx 20rpx;
  138. background: #fff;
  139. .item {
  140. position: relative;
  141. margin-right: 80rpx;
  142. height: 55rpx;
  143. font-size: 30rpx;
  144. color: #999999;
  145. .item-active {
  146. position: absolute;
  147. left: 50%;
  148. bottom: 0;
  149. height: 4rpx;
  150. width: 80%;
  151. transform: translateX(-50%);
  152. border-radius: 1rpx;
  153. background: linear-gradient(90deg, #2e85ff 0%, #7eeaf6 100%);
  154. }
  155. }
  156. .tabs-active {
  157. color: #3385ff;
  158. font-weight: 500;
  159. }
  160. }
  161. .collect-ul {
  162. padding-top: 4rpx;
  163. .collect-ltem {
  164. padding: 30rpx 20rpx 30rpx 34rpx;
  165. background: #fff;
  166. margin-bottom: 4rpx;
  167. width: 682rpx;
  168. margin: 20rpx auto 0;
  169. .title {
  170. position: relative;
  171. color: #4a4a4a;
  172. font-size: 34rpx;
  173. padding-left: 28rpx;
  174. .reg-text {
  175. position: absolute;
  176. top: 15rpx;
  177. left: 0rpx;
  178. width: 14rpx;
  179. height: 14rpx;
  180. background-color: #ff0000;
  181. border-radius: 50%;
  182. z-index: 9;
  183. }
  184. }
  185. .content {
  186. display: flex;
  187. align-items: center;
  188. justify-content: space-between;
  189. }
  190. .desc {
  191. display: flex;
  192. align-items: center;
  193. margin-top: 17rpx;
  194. padding-left: 28rpx;
  195. color: #999;
  196. }
  197. .publishDate {
  198. margin-right: 30rpx;
  199. white-space: nowrap;
  200. }
  201. .text-name {
  202. color: #2c83ff;
  203. font-size: 26rpx;
  204. }
  205. }
  206. .title {
  207. color: #333333;
  208. font-size: 30rpx;
  209. font-weight: 400;
  210. width: 100%;
  211. padding-bottom: 15rpx;
  212. border-bottom: 1px dashed #ccc;
  213. }
  214. .abstract {
  215. margin: 20rpx 0 0 30rpx;
  216. color: #666666;
  217. font-size: 28rpx;
  218. font-weight: 400;
  219. padding-right: 10rpx;
  220. }
  221. }
  222. .chart-content {
  223. display: flex;
  224. flex-wrap: wrap;
  225. justify-content: space-between;
  226. padding: 20rpx;
  227. }
  228. .chart-ltem {
  229. width: 350rpx;
  230. background: #ffffff;
  231. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
  232. border-radius: 8rpx;
  233. margin-bottom: 20rpx;
  234. padding: 20rpx;
  235. .ltem-title {
  236. font-size: 32rpx;
  237. font-weight: 500;
  238. color: #333333;
  239. line-height: 38rpx;
  240. border-bottom: 1rpx solid #dcdfe6;
  241. padding-bottom: 10rpx;
  242. }
  243. .item-content-img {
  244. display: flex;
  245. align-items: center;
  246. width: 330rpx;
  247. height: 286rpx;
  248. margin-left: -6rpx;
  249. margin-bottom: -20rpx;
  250. image {
  251. width: 100%;
  252. height: 286rpx;
  253. vertical-align: middle;
  254. }
  255. }
  256. .chart-tag {
  257. display: flex;
  258. justify-content: space-between;
  259. padding-top: 20rpx;
  260. border-top: 1rpx solid #dcdfe6;
  261. font-size: 24rpx;
  262. font-weight: 400;
  263. color: #3385ff;
  264. .tag-item {
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. width: 150rpx;
  269. height: 38rpx;
  270. background: #ffffff;
  271. border-radius: 28rpx;
  272. border: 2rpx solid #3189ff;
  273. }
  274. }
  275. }
  276. }
  277. </style>