industrialReport.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <!-- 季度策略 -->
  3. <view class="container industrial-container">
  4. <view class="collect-ul" v-if="haveData">
  5. <view class="global_card_content collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
  6. <view class="item-left">
  7. <text class="title global_title text_twoLine">
  8. {{ item.Title }}
  9. <text class="reg-text" v-if="item.IsRed"></text>
  10. </text>
  11. <view v-if="isShowAbstract" class="abstract-box text_twoLine">摘要:{{ item.Abstract }} </view>
  12. <view class="item-more">
  13. <text :class="item.IsResearch ? 'publishDate' : ''">{{ item.PublishDate }}</text>
  14. <view class="global_pv-ollect">
  15. <view>
  16. <image class="pv" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/examine_icon.png"></image>
  17. {{ item.Pv }}
  18. </view>
  19. <view @click.stop="collectClick(item)" v-if="item.Resource == 1">
  20. <image v-if="item.IsCollect" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_act.png"></image>
  21. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_ico.png"></image>
  22. {{ item.CollectNum }}
  23. </view>
  24. </view>
  25. <text v-if="item.IsResearch" class="text_oneLine text-name">{{ item.IndustryName }}</text>
  26. </view>
  27. </view>
  28. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  29. </view>
  30. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  31. </view>
  32. <view class="nodata" v-else>
  33. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  34. <text>暂时没有报告的内容</text>
  35. </view>
  36. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  37. <Loading />
  38. </view>
  39. </template>
  40. <script>
  41. import { Reports, Report } from "@/config/api.js";
  42. import { Throttle } from "@/config/util.js";
  43. import freeCharge from "@/components/freeCharge";
  44. let app = getApp({ allowDefault: true });
  45. export default {
  46. data() {
  47. return {
  48. refresh: false, //正在下拉
  49. page_no: 1,
  50. pageSize: 10,
  51. categoryId: null,
  52. collectList: [],
  53. haveData: true,
  54. status: "loadmore",
  55. loadText: {
  56. loadmore: "上拉加载更多",
  57. loading: "加载中",
  58. nomore: "已经到底了",
  59. },
  60. typeIsPost: "", //
  61. genreIs: "", //作者还是文章
  62. totalPage: "",
  63. titleReport: "",
  64. idGenre: "",
  65. articleId: "",
  66. isShowAbstract: false,
  67. };
  68. },
  69. onLoad(option) {
  70. this.categoryId = Number(option.id) || "";
  71. this.idGenre = Number(option.idGenre) || "";
  72. this.articleId = Number(option.idArticle) || "";
  73. this.typeIsPost = option.type || "";
  74. this.genreIs = option.isGenre || "";
  75. this.getCollectList();
  76. },
  77. onShow() {
  78. this.$store.commit("setRouterReport", "行业综述");
  79. },
  80. methods: {
  81. /* 获取列表 */
  82. async getCollectList() {
  83. const res =
  84. this.typeIsPost == "研选" && this.genreIs !== "标的"
  85. ? await Reports.industryReportList({
  86. PageSize: this.pageSize,
  87. CurrentIndex: this.page_no,
  88. DepartmentId: this.idGenre,
  89. IndustrialManagementId: this.categoryId,
  90. ArticleId: this.articleId,
  91. })
  92. : this.genreIs === "标的"
  93. ? await Reports.reportListNew({
  94. PageSize: this.pageSize,
  95. CurrentIndex: this.page_no,
  96. ArticleId: this.articleId,
  97. })
  98. : await Reports.getTactics({
  99. PageSize: this.pageSize,
  100. CurrentIndex: this.page_no,
  101. CategoryId: this.categoryId,
  102. });
  103. if (res.Ret === 200) {
  104. if (!res.Data.HaveResearch && this.typeIsPost == "研选") {
  105. this.$util.modalShow("", "您暂无查看研选权限", "", () => {
  106. uni.reLaunch({
  107. url: "/pages/index/index",
  108. });
  109. });
  110. }
  111. uni.setNavigationBarTitle({
  112. title: this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName,
  113. });
  114. this.titleReport = this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName;
  115. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  116. this.totalPage = res.Data.Paging.Pages; //总页数
  117. this.isShowAbstract = res.Data.IsShowAbstract;
  118. if (res.Data.List.length > 0) {
  119. res.Data.List.forEach((item) => {
  120. if (item.IsResearch) {
  121. item.PublishDate = item.PublishDate.slice(0, 10);
  122. }
  123. });
  124. }
  125. if (this.page_no === 1) {
  126. this.collectList = res.Data.List || [];
  127. this.haveData = this.collectList.length ? true : false;
  128. if (this.refresh) {
  129. uni.stopPullDownRefresh();
  130. this.refresh = false;
  131. }
  132. } else {
  133. this.collectList = this.collectList.concat(res.Data.List);
  134. }
  135. }
  136. },
  137. goDetail(item, index) {
  138. /* 无需授权且已绑定 检验是或否有权限 */
  139. this.collectList[index].IsRed = false;
  140. if (item.Resource === 2) {
  141. // 跳转产品内测详情
  142. uni.navigateTo({
  143. url: "/reportPages/internalDetials/internalDetials?id=" + item.ArticleId,
  144. });
  145. } else if (item.Resource === 1) {
  146. uni.navigateTo({
  147. url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
  148. });
  149. }
  150. },
  151. // 收藏
  152. async collectClick(item) {
  153. const res = await Report.collectRpt({ ArticleId: item.ArticleId, PageRouter: this.$store.state.pageRouterReport });
  154. if (res.Ret === 200) {
  155. item.IsCollect = !item.IsCollect;
  156. item.IsCollect
  157. ? (item.CollectNum += 1) &&
  158. uni.showToast({
  159. title: "收藏成功",
  160. icon: "none",
  161. duration: 2000,
  162. })
  163. : (item.CollectNum -= 1);
  164. !item.IsCollect &&
  165. uni.showToast({
  166. title: "已取消收藏",
  167. icon: "none",
  168. duration: 2000,
  169. });
  170. }
  171. },
  172. },
  173. components: {
  174. freeCharge,
  175. },
  176. /* 触底 */
  177. onReachBottom: Throttle(function () {
  178. if (this.status === "nomore") return;
  179. this.status = "loading";
  180. this.page_no++;
  181. this.getCollectList();
  182. }),
  183. /* 下拉刷新 */
  184. onPullDownRefresh: Throttle(function () {
  185. this.page_no = 1;
  186. this.refresh = true;
  187. this.getCollectList();
  188. }),
  189. /**
  190. * 用户点击分享
  191. */
  192. onShareAppMessage: function (res) {
  193. return {
  194. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.titleReport,
  195. path:
  196. "/reportPages/industrialReport/industrialReport?id=" + this.categoryId + "&type=" + this.typeIsPost + "&isGenre=" + this.genreIs + "&idGenre=" + this.idGenre + "&idArticle=" + this.articleId,
  197. success: (res) => {},
  198. fail: (err) => {},
  199. };
  200. },
  201. };
  202. </script>
  203. <style scoped lang="scss">
  204. @import "../index.scss";
  205. .industrial-container {
  206. background-color: $uni-bg-color;
  207. padding: 30rpx 25rpx;
  208. .abstract-box {
  209. margin-top: 10rpx;
  210. padding: 0 20rpx 0 28rpx;
  211. color: #666666;
  212. font-size: 28rpx;
  213. }
  214. }
  215. .collect-ltem {
  216. border-top: 4rpx solid $uni-color-new;
  217. margin-bottom: 20rpx !important;
  218. padding: 22rpx 12rpx !important;
  219. }
  220. .item-examine {
  221. display: flex;
  222. align-items: center;
  223. margin-right: 30rpx;
  224. image {
  225. width: 30rpx;
  226. height: 30rpx;
  227. margin: 0 10rpx 0 15rpx;
  228. }
  229. }
  230. .item-left {
  231. flex: 1;
  232. .item-more {
  233. padding-left: 20rpx;
  234. }
  235. }
  236. </style>