industrialReport.vue 6.0 KB

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