strategy.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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.getCollectList();
  85. },
  86. },
  87. tabAct_idTwo: {
  88. handler() {
  89. (this.page_no = 1), (this.pageSize = 10), this.getCollectList();
  90. },
  91. // immediate:true
  92. },
  93. pageNumFather: {
  94. handler() {
  95. if (this.pageNumFather) {
  96. this.page_no = 1;
  97. this.getCollectList();
  98. this.$parent.pageNumFather = "";
  99. }
  100. },
  101. },
  102. },
  103. mounted() {
  104. if (this.tabAct_idTwo) {
  105. this.getCollectList();
  106. }
  107. },
  108. methods: {
  109. /* 获取列表 */
  110. getCollectList() {
  111. Reports.getTacticsList({
  112. PageSize: this.pageSize,
  113. CurrentIndex: this.page_no,
  114. CategoryId: this.tabAct_idTwo,
  115. }).then((res) => {
  116. if (res.Ret === 200) {
  117. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  118. this.totalPage = res.Data.Paging.Pages; //总页数
  119. if (this.page_no === 1) {
  120. this.collectList = res.Data.List || [];
  121. this.haveData = this.collectList.length ? true : false;
  122. if (this.refresh) {
  123. uni.stopPullDownRefresh();
  124. this.refresh = false;
  125. }
  126. } else {
  127. this.collectList = this.collectList.concat(res.Data.List);
  128. }
  129. }
  130. });
  131. },
  132. goDetail(item, index) {
  133. /* 无需授权且已绑定 检验是或否有权限 */
  134. if (index == 0) {
  135. this.$emit("hideIsred", this.isShow);
  136. }
  137. this.collectList[index].IsRed = false;
  138. this.$store.dispatch("checkHandle", "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId);
  139. },
  140. },
  141. /* 下拉刷新 */
  142. onPullDownRefresh: Throttle(function () {
  143. this.page_no = 1;
  144. this.refresh = true;
  145. this.getCollectList();
  146. }),
  147. };
  148. </script>
  149. <style scoped lang="scss">
  150. .industrial-container {
  151. background-color: #f6f6f6;
  152. .collect-ul {
  153. .collect-ltem {
  154. display: flex;
  155. padding: 30rpx 34rpx;
  156. background: #fff;
  157. margin-top: 10rpx;
  158. align-items: center;
  159. justify-content: space-between;
  160. .title {
  161. position: relative;
  162. max-width: 625rpx;
  163. color: #333;
  164. font-size: 30rpx;
  165. padding-left: 28rpx;
  166. .reg-text {
  167. position: absolute;
  168. top: 50%;
  169. left: 0rpx;
  170. width: 14rpx;
  171. height: 14rpx;
  172. transform: translateY(-50%);
  173. background-color: #ff0000;
  174. border-radius: 50%;
  175. z-index: 9;
  176. }
  177. }
  178. .desc {
  179. margin-top: 17rpx;
  180. padding-left: 28rpx;
  181. width: 625rpx;
  182. color: #999;
  183. }
  184. .text_one {
  185. max-width: 600rpx;
  186. padding-left: 28rpx;
  187. color: #666666;
  188. font-size: 28rpx;
  189. white-space: nowrap;
  190. text-overflow: ellipsis;
  191. overflow: hidden;
  192. }
  193. .text-threeFour {
  194. max-width: 600rpx;
  195. padding-left: 28rpx;
  196. color: #666666;
  197. font-size: 28rpx;
  198. text-overflow: -o-ellipsis-lastline;
  199. overflow: hidden;
  200. text-overflow: ellipsis;
  201. display: -webkit-box;
  202. -webkit-line-clamp: 2;
  203. line-clamp: 2;
  204. -webkit-box-orient: vertical;
  205. }
  206. }
  207. }
  208. }
  209. </style>