keyCompany.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. onReachBottom() {
  116. if (this.status === "nomore") return;
  117. this.status = "loading";
  118. this.page_no++;
  119. this.getList();
  120. },
  121. };
  122. </script>
  123. <style lang="scss" scoped>
  124. .content-conmpany {
  125. background: #f7f7f7;
  126. padding-bottom: 30rpx;
  127. .top-tabs {
  128. position: sticky;
  129. top: 0;
  130. left: 0;
  131. height: 78rpx;
  132. width: 100%;
  133. display: flex;
  134. padding: 10rpx 35rpx 20rpx;
  135. background: #fff;
  136. .item {
  137. position: relative;
  138. margin-right: 80rpx;
  139. height: 55rpx;
  140. font-size: 30rpx;
  141. color: #999999;
  142. .item-active {
  143. position: absolute;
  144. left: 50%;
  145. bottom: 0;
  146. height: 4rpx;
  147. width: 80%;
  148. transform: translateX(-50%);
  149. border-radius: 1rpx;
  150. background: linear-gradient(90deg, #2e85ff 0%, #7eeaf6 100%);
  151. }
  152. }
  153. .tabs-active {
  154. color: #3385ff;
  155. font-weight: 500;
  156. }
  157. }
  158. .collect-ul {
  159. padding-top: 4rpx;
  160. .collect-ltem {
  161. padding: 30rpx 20rpx 30rpx 34rpx;
  162. background: #fff;
  163. margin-bottom: 4rpx;
  164. width: 682rpx;
  165. margin: 20rpx auto 0;
  166. .title {
  167. position: relative;
  168. color: #4a4a4a;
  169. font-size: 34rpx;
  170. padding-left: 28rpx;
  171. .reg-text {
  172. position: absolute;
  173. top: 15rpx;
  174. left: 0rpx;
  175. width: 14rpx;
  176. height: 14rpx;
  177. background-color: #ff0000;
  178. border-radius: 50%;
  179. z-index: 9;
  180. }
  181. }
  182. .content {
  183. display: flex;
  184. align-items: center;
  185. justify-content: space-between;
  186. }
  187. .desc {
  188. display: flex;
  189. align-items: center;
  190. margin-top: 17rpx;
  191. padding-left: 28rpx;
  192. color: #999;
  193. }
  194. .publishDate {
  195. margin-right: 30rpx;
  196. white-space: nowrap;
  197. }
  198. .text-name {
  199. color: #2c83ff;
  200. font-size: 26rpx;
  201. }
  202. }
  203. .title {
  204. color: #333333;
  205. font-size: 30rpx;
  206. font-weight: 400;
  207. width: 100%;
  208. padding-bottom: 15rpx;
  209. border-bottom: 1px dashed #ccc;
  210. }
  211. .abstract {
  212. margin: 20rpx 0 0 30rpx;
  213. color: #666666;
  214. font-size: 28rpx;
  215. font-weight: 400;
  216. padding-right: 10rpx;
  217. }
  218. }
  219. .chart-content {
  220. display: flex;
  221. flex-wrap: wrap;
  222. justify-content: space-between;
  223. padding: 20rpx;
  224. }
  225. .chart-ltem {
  226. width: 350rpx;
  227. background: #ffffff;
  228. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
  229. border-radius: 8rpx;
  230. margin-bottom: 20rpx;
  231. padding: 20rpx;
  232. .ltem-title {
  233. font-size: 32rpx;
  234. font-weight: 500;
  235. color: #333333;
  236. line-height: 38rpx;
  237. border-bottom: 1rpx solid #dcdfe6;
  238. padding-bottom: 10rpx;
  239. }
  240. .item-content-img {
  241. display: flex;
  242. align-items: center;
  243. width: 330rpx;
  244. height: 286rpx;
  245. margin-left: -6rpx;
  246. margin-bottom: -20rpx;
  247. image {
  248. width: 100%;
  249. height: 286rpx;
  250. vertical-align: middle;
  251. }
  252. }
  253. .chart-tag {
  254. display: flex;
  255. justify-content: space-between;
  256. padding-top: 20rpx;
  257. border-top: 1rpx solid #dcdfe6;
  258. font-size: 24rpx;
  259. font-weight: 400;
  260. color: #3385ff;
  261. .tag-item {
  262. display: flex;
  263. align-items: center;
  264. justify-content: center;
  265. width: 150rpx;
  266. height: 38rpx;
  267. background: #ffffff;
  268. border-radius: 28rpx;
  269. border: 2rpx solid #3189ff;
  270. }
  271. }
  272. }
  273. }
  274. </style>