industrialReport.vue 6.5 KB

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