strategy.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. <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. },
  50. data() {
  51. return {
  52. refresh: false, //正在下拉
  53. page_no: 1,
  54. pageSize: 10,
  55. collectList: [],
  56. haveData: true,
  57. status: "loadmore",
  58. loadText: {
  59. loadmore: "上拉加载更多",
  60. loading: "加载中",
  61. nomore: "已经到底了",
  62. },
  63. totalPage: "",
  64. isShow: false,
  65. threeFour: false,
  66. isText: true,
  67. };
  68. },
  69. watch: {
  70. matchTypeName: {
  71. handler() {
  72. if (this.matchTypeName == "资金流向" || this.matchTypeName == "大类资产") {
  73. this.threeFour = true;
  74. }
  75. if (this.matchTypeName == "周度思考" || this.matchTypeName == "估值研究") {
  76. this.isText = false;
  77. } else {
  78. this.isText = true;
  79. }
  80. },
  81. immediate: true,
  82. },
  83. isNum: {
  84. handler() {
  85. if (this.status === "nomore") return;
  86. this.status = "loading";
  87. this.page_no++;
  88. this.tabAct_idTwo && this.getCollectList();
  89. },
  90. },
  91. tabAct_idTwo: {
  92. handler(newValue) {
  93. this.collectList = [];
  94. if (newValue && newValue != 99999) {
  95. this.page_no = 1;
  96. this.pageSize = 10;
  97. this.getCollectList();
  98. }
  99. },
  100. immediate: true,
  101. },
  102. pageNumFather: {
  103. handler() {
  104. if (this.pageNumFather) {
  105. this.page_no = 1;
  106. this.tabAct_idTwo && this.getCollectList();
  107. this.$parent.pageNumFather = "";
  108. }
  109. },
  110. },
  111. },
  112. mounted() {},
  113. methods: {
  114. /* 获取列表 */
  115. getCollectList() {
  116. Reports.getTacticsList({
  117. PageSize: this.pageSize,
  118. CurrentIndex: this.page_no,
  119. CategoryId: this.tabAct_idTwo,
  120. }).then((res) => {
  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. },
  137. goDetail(item, index) {
  138. /* 无需授权且已绑定 检验是或否有权限 */
  139. if (index == 0) {
  140. this.$emit("hideIsred", this.isShow);
  141. }
  142. this.collectList[index].IsRed = false;
  143. this.$store.commit("setRouterReport", "深度研究策略");
  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({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId });
  151. }
  152. },
  153. },
  154. /* 下拉刷新 */
  155. onPullDownRefresh: Throttle(function () {
  156. this.page_no = 1;
  157. this.refresh = true;
  158. this.getCollectList();
  159. }),
  160. };
  161. </script>
  162. <style scoped lang="scss">
  163. .industrial-container {
  164. background-color: #f6f6f6;
  165. .collect-ul {
  166. .collect-ltem {
  167. display: flex;
  168. padding: 30rpx 34rpx;
  169. background: #fff;
  170. margin-top: 10rpx;
  171. align-items: center;
  172. justify-content: space-between;
  173. .title {
  174. position: relative;
  175. max-width: 625rpx;
  176. color: #333;
  177. font-size: 30rpx;
  178. padding-left: 28rpx;
  179. .reg-text {
  180. position: absolute;
  181. top: 50%;
  182. left: 0rpx;
  183. width: 14rpx;
  184. height: 14rpx;
  185. transform: translateY(-50%);
  186. background-color: #ff0000;
  187. border-radius: 50%;
  188. z-index: 9;
  189. }
  190. }
  191. .desc {
  192. margin-top: 17rpx;
  193. padding-left: 28rpx;
  194. width: 625rpx;
  195. color: #999;
  196. }
  197. .text_one {
  198. max-width: 600rpx;
  199. padding-left: 28rpx;
  200. color: #666666;
  201. font-size: 28rpx;
  202. white-space: nowrap;
  203. text-overflow: ellipsis;
  204. overflow: hidden;
  205. }
  206. .text-threeFour {
  207. max-width: 600rpx;
  208. padding-left: 28rpx;
  209. color: #666666;
  210. font-size: 28rpx;
  211. text-overflow: -o-ellipsis-lastline;
  212. overflow: hidden;
  213. text-overflow: ellipsis;
  214. display: -webkit-box;
  215. -webkit-line-clamp: 2;
  216. line-clamp: 2;
  217. -webkit-box-orient: vertical;
  218. }
  219. }
  220. }
  221. }
  222. </style>