strategy.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <!-- 季度策略 -->
  3. <view class="industrial-container">
  4. <!-- 季度策略 -->
  5. <view class="collect-ul">
  6. <view class="global_card_content collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
  7. <view class="item-left">
  8. <text class="title global_title text_twoLine"
  9. >{{ item.Title }}
  10. <text class="reg-text" v-if="item.IsRed"></text>
  11. </text>
  12. <view style="margin-top: 10rpx" v-if="matchTypeName == '每日复盘'" :class="threeFour ? 'text-threeFour' : 'text_one'">
  13. <!-- <mp-html :content="'摘要:' + item.Abstract" /> -->
  14. 摘要:{{ item.Abstract }}
  15. </view>
  16. <!-- <text v-else-if="isText" :class="threeFour ? 'text-threeFour' : 'text_one'">
  17. {{ item.Abstract }}
  18. </text> -->
  19. <text class="text_twoLine desc">{{ item.PublishDate }}</text>
  20. </view>
  21. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  22. </view>
  23. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { Reports } from "@/config/api.js";
  29. import { Throttle } from "@/config/util.js";
  30. let app = getApp({ allowDefault: true });
  31. export default {
  32. props: {
  33. strategyIndexTwo: {
  34. type: Number,
  35. },
  36. isNum: {
  37. type: Number,
  38. },
  39. tabAct_idTwo: {
  40. type: Number,
  41. },
  42. pageNumFather: {
  43. type: Number,
  44. default: null,
  45. },
  46. matchTypeName: {
  47. type: String,
  48. },
  49. tabAct_id: {
  50. type: Number,
  51. },
  52. },
  53. data() {
  54. return {
  55. refresh: false, //正在下拉
  56. page_no: 1,
  57. pageSize: 10,
  58. collectList: [],
  59. haveData: true,
  60. status: "loadmore",
  61. loadText: {
  62. loadmore: "上拉加载更多",
  63. loading: "加载中",
  64. nomore: "已经到底了",
  65. },
  66. totalPage: "",
  67. isShow: false,
  68. threeFour: false,
  69. isText: true,
  70. };
  71. },
  72. watch: {
  73. matchTypeName: {
  74. handler() {
  75. if (this.matchTypeName == "资金流向" || this.matchTypeName == "大类资产") {
  76. this.threeFour = true;
  77. }
  78. if (this.matchTypeName == "周度思考" || this.matchTypeName == "估值研究") {
  79. this.isText = false;
  80. } else {
  81. this.isText = true;
  82. }
  83. },
  84. immediate: true,
  85. },
  86. isNum: {
  87. handler() {
  88. if (this.status === "nomore") return;
  89. this.status = "loading";
  90. this.page_no++;
  91. this.tabAct_idTwo && this.getCollectList();
  92. },
  93. },
  94. tabAct_idTwo: {
  95. handler(newValue) {
  96. this.collectList = [];
  97. if (newValue && newValue != 99999) {
  98. this.page_no = 1;
  99. this.pageSize = 10;
  100. this.getCollectList();
  101. }
  102. },
  103. immediate: true,
  104. },
  105. pageNumFather: {
  106. handler() {
  107. if (this.pageNumFather) {
  108. this.page_no = 1;
  109. this.tabAct_idTwo && this.getCollectList();
  110. this.$parent.pageNumFather = "";
  111. }
  112. },
  113. },
  114. },
  115. mounted() {},
  116. methods: {
  117. /* 获取列表 */
  118. async getCollectList() {
  119. let params = { PageSize: this.pageSize, CurrentIndex: this.page_no, CategoryId: this.tabAct_idTwo };
  120. const res = this.tabAct_id == 148 || this.tabAct_id == 62 ? await Reports.getZhouQiTacticsList(params) : await Reports.getTacticsList(params);
  121. if (res.Ret === 200) {
  122. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  123. this.totalPage = res.Data.Paging.Pages; //总页数
  124. if (this.page_no === 1) {
  125. this.collectList = res.Data.List || [];
  126. this.haveData = this.collectList.length ? true : false;
  127. if (this.refresh) {
  128. uni.stopPullDownRefresh();
  129. this.refresh = false;
  130. }
  131. } else {
  132. this.collectList = this.collectList.concat(res.Data.List);
  133. }
  134. }
  135. },
  136. goDetail(item, index) {
  137. /* 无需授权且已绑定 检验是或否有权限 */
  138. if (index == 0) {
  139. this.$emit("hideIsred", this.isShow);
  140. }
  141. this.collectList[index].IsRed = false;
  142. this.$store.commit("setRouterReport", "深度研究策略");
  143. if (item.Resource === 2) {
  144. // 跳转产品内测详情
  145. uni.navigateTo({
  146. url: "/reportPages/internalDetials/internalDetials?id=" + item.ArticleId,
  147. });
  148. } else if (item.Resource === 1) {
  149. uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId });
  150. } else if (item.Resource === 3) {
  151. uni.navigateTo({ url: "/pages-ficc/reportDetail/reportDetail?id=" + item.ReportId });
  152. }
  153. },
  154. },
  155. /* 下拉刷新 */
  156. onPullDownRefresh: Throttle(function () {
  157. this.page_no = 1;
  158. this.refresh = true;
  159. this.getCollectList();
  160. }),
  161. };
  162. </script>
  163. <style scoped lang="scss">
  164. .industrial-container {
  165. background-color: #f6f6f6;
  166. .collect-ul {
  167. padding: 0 25rpx;
  168. .collect-ltem {
  169. display: flex;
  170. padding: 20rpx;
  171. background: #fff;
  172. margin-top: 20rpx;
  173. align-items: center;
  174. justify-content: space-between;
  175. border-top: 4rpx solid #376cbb;
  176. .title {
  177. position: relative;
  178. max-width: 625rpx;
  179. color: #333;
  180. font-size: 30rpx;
  181. padding-left: 28rpx;
  182. .reg-text {
  183. position: absolute;
  184. top: 50%;
  185. left: 0rpx;
  186. width: 14rpx;
  187. height: 14rpx;
  188. transform: translateY(-50%);
  189. background-color: #ff0000;
  190. border-radius: 50%;
  191. z-index: 9;
  192. }
  193. }
  194. .desc {
  195. margin-top: 17rpx;
  196. padding-left: 28rpx;
  197. width: 625rpx;
  198. font-size: 22rpx;
  199. color: #999;
  200. }
  201. .text_one {
  202. max-width: 600rpx;
  203. padding-left: 28rpx;
  204. color: #666666;
  205. font-size: 28rpx;
  206. white-space: nowrap;
  207. text-overflow: ellipsis;
  208. overflow: hidden;
  209. }
  210. .text-threeFour {
  211. max-width: 600rpx;
  212. padding-left: 28rpx;
  213. color: #666666;
  214. font-size: 28rpx;
  215. text-overflow: -o-ellipsis-lastline;
  216. overflow: hidden;
  217. text-overflow: ellipsis;
  218. display: -webkit-box;
  219. -webkit-line-clamp: 2;
  220. line-clamp: 2;
  221. -webkit-box-orient: vertical;
  222. }
  223. }
  224. }
  225. }
  226. </style>