strategy.vue 5.7 KB

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