companyTabulation.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="container container-secret">
  3. <view class="collect-ul" v-if="haveData">
  4. <view class="global_card_content collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item)">
  5. <view>
  6. <text class="title global_title text_twoLine">
  7. {{ item.Title }}
  8. <text class="reg-text" v-if="item.IsRed"></text>
  9. </text>
  10. <view class="content" v-if="item.SubjectName">
  11. {{ "更新:" + item.SubjectName }}
  12. </view>
  13. <view class="desc">{{ item.PublishDate }} </view>
  14. </view>
  15. <view class="right-icon">
  16. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  17. </view>
  18. </view>
  19. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  20. </view>
  21. <view class="nodata" v-else>
  22. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  23. <text>暂时没有报告的内容</text>
  24. </view>
  25. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  26. <Loading />
  27. </view>
  28. </template>
  29. <script>
  30. import { Reports } from "@/config/api.js";
  31. import { Throttle } from "@/config/util.js";
  32. import freeCharge from "@/components/freeCharge";
  33. let app = getApp({ allowDefault: true });
  34. export default {
  35. data() {
  36. return {
  37. refresh: false, //正在下拉
  38. page_no: 1,
  39. pageSize: 10,
  40. collectList: [],
  41. haveData: true,
  42. totalPage: "",
  43. status: "loadmore",
  44. loadText: {
  45. loadmore: "上拉加载更多",
  46. loading: "加载中",
  47. nomore: "已经到底了",
  48. },
  49. };
  50. },
  51. components: {
  52. freeCharge,
  53. },
  54. computed: {},
  55. methods: {
  56. //点击头部的tabs
  57. tabsHandler(item) {
  58. this.isType = item.value;
  59. this.page_no = 1;
  60. this.getList();
  61. },
  62. //获取数据
  63. async getList() {
  64. const res = await Reports.hetReport_selectionList({
  65. PageSize: this.pageSize,
  66. CurrentIndex: this.page_no,
  67. });
  68. if (res.Ret == 200) {
  69. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  70. this.totalPage = res.Data.Paging.Pages; //总页数
  71. if (this.page_no === 1) {
  72. this.collectList = res.Data.List || [];
  73. this.haveData = this.collectList.length ? true : false;
  74. if (this.refresh) {
  75. uni.stopPullDownRefresh();
  76. this.refresh = false;
  77. }
  78. } else {
  79. this.collectList = this.collectList.concat(res.Data.List);
  80. }
  81. }
  82. },
  83. //跳转详情
  84. goDetail(item) {
  85. /* 无需授权且已绑定 检验是或否有权限 */
  86. item.IsRed = false;
  87. uni.navigateTo({ url: "/reportPages/keyCompany/keyCompany?id=" + item.ArticleId });
  88. },
  89. },
  90. onLoad() {
  91. this.getList();
  92. },
  93. /* 触底 */
  94. onReachBottom: Throttle(function () {
  95. if (this.status === "nomore") return;
  96. this.status = "loading";
  97. this.page_no++;
  98. this.getList();
  99. }),
  100. /* 下拉刷新 */
  101. onPullDownRefresh: Throttle(function () {
  102. this.page_no = 1;
  103. this.refresh = true;
  104. this.getList();
  105. }),
  106. };
  107. </script>
  108. <style lang="scss" scoped>
  109. .container-secret {
  110. background: $uni-bg-color;
  111. padding-bottom: 30rpx;
  112. .collect-ul {
  113. padding-top: 4rpx;
  114. .collect-ltem {
  115. padding: 20rpx 20rpx;
  116. border-top: 4rpx solid $uni-color-new;
  117. background: #fff;
  118. margin-bottom: 4rpx;
  119. width: 682rpx;
  120. margin: 20rpx auto 0;
  121. display: flex;
  122. justify-content: space-between;
  123. .right-icon {
  124. display: flex;
  125. align-items: center;
  126. }
  127. .title {
  128. position: relative;
  129. padding-left: 28rpx;
  130. margin-bottom: 10rpx;
  131. .reg-text {
  132. position: absolute;
  133. top: 15rpx;
  134. left: 0rpx;
  135. width: 14rpx;
  136. height: 14rpx;
  137. background-color: #ff0000;
  138. border-radius: 50%;
  139. z-index: 9;
  140. }
  141. }
  142. .content {
  143. width: 610rpx;
  144. margin-right: 10rpx;
  145. background-color: #f8f8fa;
  146. padding: 10rpx 20rpx 10rpx 25rpx;
  147. color: #999;
  148. border-radius: 4rpx;
  149. }
  150. .desc {
  151. display: flex;
  152. align-items: center;
  153. margin-top: 17rpx;
  154. padding-left: 24rpx;
  155. color: #999;
  156. }
  157. }
  158. }
  159. }
  160. </style>