industrialReport.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree"/>
  28. </view>
  29. </template>
  30. <script>
  31. import { Reports } from "@/config/api.js";
  32. import { Throttle } from "@/config/util.js";
  33. import freeCharge from '@/components/freeCharge'
  34. let app = getApp({allowDefault: true});
  35. export default {
  36. data() {
  37. return {
  38. refresh: false, //正在下拉
  39. page_no: 1,
  40. pageSize: 10,
  41. categoryId: null,
  42. collectList: [],
  43. haveData: true,
  44. status: "loadmore",
  45. loadText: {
  46. loadmore: "上拉加载更多",
  47. loading: "加载中",
  48. nomore: "已经到底了",
  49. },
  50. typeIsPost: "", //
  51. genreIs: "", //作者还是文章
  52. totalPage: "",
  53. titleReport: "",
  54. idGenre: "",
  55. articleId: "",
  56. };
  57. },
  58. onLoad(option) {
  59. this.categoryId = Number(option.id) || "";
  60. this.idGenre = Number(option.idGenre) || "";
  61. this.articleId = Number(option.idArticle) || "";
  62. this.typeIsPost = option.type || "";
  63. this.genreIs = option.isGenre || "";
  64. this.getCollectList();
  65. },
  66. onShow() {},
  67. methods: {
  68. /* 获取列表 */
  69. async getCollectList() {
  70. const res =
  71. this.typeIsPost == "研选" && this.genreIs !== "标的"
  72. ? await Reports.industryReportList({
  73. PageSize: this.pageSize,
  74. CurrentIndex: this.page_no,
  75. DepartmentId: this.idGenre,
  76. IndustrialManagementId: this.categoryId,
  77. ArticleId: this.articleId,
  78. })
  79. : this.genreIs === "标的"
  80. ? await Reports.reportListNew({
  81. PageSize: this.pageSize,
  82. CurrentIndex: this.page_no,
  83. ArticleId: this.articleId,
  84. })
  85. : await Reports.getTactics({
  86. PageSize: this.pageSize,
  87. CurrentIndex: this.page_no,
  88. CategoryId: this.categoryId,
  89. });
  90. if (res.Ret === 200) {
  91. if (!res.Data.HaveResearch && this.typeIsPost == "研选") {
  92. this.$util.modalShow("", "您暂无查看研选权限", "", () => {
  93. uni.reLaunch({
  94. url: "/pages/index/index",
  95. });
  96. });
  97. }
  98. uni.setNavigationBarTitle({
  99. title: this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName,
  100. });
  101. this.titleReport = this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName;
  102. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  103. this.totalPage = res.Data.Paging.Pages; //总页数
  104. if (res.Data.List.length > 0) {
  105. res.Data.List.forEach((item) => {
  106. if (item.IsResearch) {
  107. item.PublishDate = item.PublishDate.slice(0, 10);
  108. }
  109. });
  110. }
  111. if (this.page_no === 1) {
  112. this.collectList = res.Data.List || [];
  113. this.haveData = this.collectList.length ? true : false;
  114. if (this.refresh) {
  115. uni.stopPullDownRefresh();
  116. this.refresh = false;
  117. }
  118. } else {
  119. this.collectList = this.collectList.concat(res.Data.List);
  120. }
  121. }
  122. },
  123. goDetail(item, index) {
  124. /* 无需授权且已绑定 检验是或否有权限 */
  125. this.collectList[index].IsRed = false;
  126. this.$store.dispatch("checkHandle","/pageMy/reportDetail/reportDetail?id=" + item.ArticleId)
  127. },
  128. },
  129. components: {
  130. freeCharge
  131. },
  132. /* 触底 */
  133. onReachBottom: Throttle(function () {
  134. if (this.status === "nomore") return;
  135. this.status = "loading";
  136. this.page_no++;
  137. this.getCollectList();
  138. }),
  139. /* 下拉刷新 */
  140. onPullDownRefresh: Throttle(function () {
  141. this.page_no = 1;
  142. this.refresh = true;
  143. this.getCollectList();
  144. }),
  145. /**
  146. * 用户点击分享
  147. */
  148. onShareAppMessage: function (res) {
  149. return {
  150. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.titleReport,
  151. path:
  152. "/reportPages/industrialReport/industrialReport?id=" + this.categoryId + "&type=" + this.typeIsPost + "&isGenre=" + this.genreIs + "&idGenre=" + this.idGenre + "&idArticle=" + this.articleId,
  153. success: (res) => {},
  154. fail: (err) => {},
  155. };
  156. },
  157. };
  158. </script>
  159. <style scoped lang="scss">
  160. @import "../index.scss";
  161. .industrial-container {
  162. background-color: #f6f6f6;
  163. }
  164. .item-examine {
  165. display: flex;
  166. align-items: center;
  167. margin-right: 30rpx;
  168. image {
  169. width: 30rpx;
  170. height: 24rpx;
  171. margin: 0 10rpx 0 15rpx;
  172. }
  173. }
  174. </style>