industrialReport.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <!-- 季度策略 -->
  3. <view class="container industrial-container">
  4. <view class="collect-ul" v-if="haveData">
  5. <view class="collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
  6. <view class="item-left">
  7. <text class="title text_twoLine">{{ item.Title }}
  8. <text class="reg-text" v-if="item.IsRed"></text>
  9. </text>
  10. <view class="desc">
  11. <text :class="item.IsResearch ? 'publishDate' : ''">{{ item.PublishDate }}</text>
  12. <view class="item-examine" v-if="item.IsResearch">
  13. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/examine_icon.png"></image>
  14. <text>{{ item.Pv }}</text>
  15. </view>
  16. <text v-if="item.IsResearch" class="text_oneLine text-name">{{ item.IndustryName }}</text>
  17. </view>
  18. </view>
  19. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  20. </view>
  21. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  22. </view>
  23. <view class="nodata" v-else>
  24. <image src="@/static/img/nodata.png" mode="" class="nodata_ico"></image>
  25. <text>暂时没有报告的内容</text>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import { Reports } from "@/config/api.js";
  31. import { Throttle } from "@/config/util.js";
  32. let app = getApp({allowDefault: true});
  33. export default {
  34. data() {
  35. return {
  36. refresh: false, //正在下拉
  37. page_no: 1,
  38. pageSize: 10,
  39. categoryId: null,
  40. collectList: [],
  41. haveData: true,
  42. status: "loadmore",
  43. loadText: {
  44. loadmore: "上拉加载更多",
  45. loading: "加载中",
  46. nomore: "已经到底了",
  47. },
  48. typeIsPost: "", //
  49. genreIs: "", //作者还是文章
  50. totalPage: "",
  51. titleReport: "",
  52. idGenre: "",
  53. articleId: "",
  54. };
  55. },
  56. onLoad(option) {
  57. this.categoryId = Number(option.id) || "";
  58. this.idGenre = Number(option.idGenre) || "";
  59. this.articleId = Number(option.idArticle) || "";
  60. this.typeIsPost = option.type || "";
  61. this.genreIs = option.isGenre || "";
  62. this.getCollectList();
  63. },
  64. onShow() {},
  65. methods: {
  66. /* 获取列表 */
  67. async getCollectList() {
  68. const res =
  69. this.typeIsPost == "研选" && this.genreIs !== "标的"
  70. ? await Reports.industryReportList({
  71. PageSize: this.pageSize,
  72. CurrentIndex: this.page_no,
  73. DepartmentId: this.idGenre,
  74. IndustrialManagementId: this.categoryId,
  75. ArticleId: this.articleId,
  76. })
  77. : this.genreIs === "标的"
  78. ? await Reports.reportListNew({
  79. PageSize: this.pageSize,
  80. CurrentIndex: this.page_no,
  81. ArticleId: this.articleId,
  82. })
  83. : await Reports.getTactics({
  84. PageSize: this.pageSize,
  85. CurrentIndex: this.page_no,
  86. CategoryId: this.categoryId,
  87. });
  88. if (res.Ret === 200) {
  89. if (!res.Data.HaveResearch && this.typeIsPost == "研选") {
  90. this.$util.modalShow("", "您暂无查看研选权限", "", () => {
  91. uni.reLaunch({
  92. url: "/pages/index/index",
  93. });
  94. });
  95. }
  96. uni.setNavigationBarTitle({
  97. title: this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName,
  98. });
  99. this.titleReport = this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName;
  100. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  101. this.totalPage = res.Data.Paging.Pages; //总页数
  102. if (res.Data.List.length > 0) {
  103. res.Data.List.forEach((item) => {
  104. if (item.IsResearch) {
  105. item.PublishDate = item.PublishDate.slice(0, 10);
  106. }
  107. });
  108. }
  109. if (this.page_no === 1) {
  110. this.collectList = res.Data.List || [];
  111. this.haveData = this.collectList.length ? true : false;
  112. if (this.refresh) {
  113. uni.stopPullDownRefresh();
  114. this.refresh = false;
  115. }
  116. } else {
  117. this.collectList = this.collectList.concat(res.Data.List);
  118. }
  119. }
  120. },
  121. goDetail(item, index) {
  122. /* 无需授权且已绑定 检验是或否有权限 */
  123. this.collectList[index].IsRed = false;
  124. this.$store.dispatch("checkHandle","/pageMy/reportDetail/reportDetail?id=" + item.ArticleId)
  125. },
  126. },
  127. /* 触底 */
  128. onReachBottom: Throttle(function () {
  129. if (this.status === "nomore") return;
  130. this.status = "loading";
  131. this.page_no++;
  132. this.getCollectList();
  133. }),
  134. /* 下拉刷新 */
  135. onPullDownRefresh: Throttle(function () {
  136. this.page_no = 1;
  137. this.refresh = true;
  138. this.getCollectList();
  139. }),
  140. /**
  141. * 用户点击分享
  142. */
  143. onShareAppMessage: function (res) {
  144. return {
  145. title: this.titleReport,
  146. path:
  147. "/reportPages/industrialReport/industrialReport?id=" + this.categoryId + "&type=" + this.typeIsPost + "&isGenre=" + this.genreIs + "&idGenre=" + this.idGenre + "&idArticle=" + this.articleId,
  148. success: (res) => {},
  149. fail: (err) => {},
  150. };
  151. },
  152. };
  153. </script>
  154. <style scoped lang="scss">
  155. @import "../index.scss";
  156. .industrial-container {
  157. background-color: #f6f6f6;
  158. }
  159. .item-examine {
  160. display: flex;
  161. align-items: center;
  162. margin-right: 30rpx;
  163. image {
  164. width: 30rpx;
  165. height: 24rpx;
  166. margin: 0 10rpx 0 15rpx;
  167. }
  168. }
  169. </style>