industrialReport.vue 6.0 KB

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