strategy.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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">{{item.Title}}
  9. <text class="reg-text" v-if="item.IsRed"></text>
  10. </text>
  11. <text v-if="isText" :class="threeFour?'text-threeFour':'text_one'">
  12. {{item.Abstract}}
  13. </text>
  14. <text class="text_twoLine desc">{{item.PublishDate}}</text>
  15. </view>
  16. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  17. </view>
  18. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage>1" />
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. Reports
  25. } from '@/config/api.js'
  26. import {
  27. Throttle
  28. } from '@/config/util.js'
  29. let app = getApp()
  30. export default {
  31. props: {
  32. strategyIndexTwo: {
  33. type: Number
  34. },
  35. isNum: {
  36. type: Number
  37. },
  38. tabAct_idTwo: {
  39. type: Number
  40. },
  41. pageNumFather: {
  42. type: Number,
  43. default: null
  44. },
  45. matchTypeName: {
  46. type: String
  47. }
  48. },
  49. data() {
  50. return {
  51. refresh: false, //正在下拉
  52. page_no: 1,
  53. pageSize: 10,
  54. collectList: [],
  55. haveData: true,
  56. status: 'loadmore',
  57. loadText: {
  58. loadmore: '上拉加载更多',
  59. loading: '加载中',
  60. nomore: '已经到底了'
  61. },
  62. totalPage: '',
  63. isShow: false,
  64. threeFour: false,
  65. isText: true
  66. };
  67. },
  68. watch: {
  69. matchTypeName: {
  70. handler() {
  71. if (this.matchTypeName == "资金流向" || this.matchTypeName == "大类资产") {
  72. this.threeFour = true
  73. }
  74. if (this.matchTypeName == "周度思考" || this.matchTypeName == "估值研究") {
  75. this.isText = false
  76. } else {
  77. this.isText = true
  78. }
  79. },
  80. immediate: true
  81. },
  82. isNum: {
  83. handler() {
  84. if (this.status === 'nomore') return;
  85. this.status = 'loading';
  86. this.page_no++;
  87. this.getCollectList()
  88. },
  89. },
  90. tabAct_idTwo: {
  91. handler() {
  92. this.page_no = 1,
  93. this.pageSize = 10,
  94. this.getCollectList()
  95. },
  96. // immediate:true
  97. },
  98. pageNumFather: {
  99. handler() {
  100. if (this.pageNumFather) {
  101. this.page_no = 1
  102. this.getCollectList()
  103. this.$parent.pageNumFather=''
  104. }
  105. }
  106. }
  107. },
  108. mounted() {
  109. if (this.tabAct_idTwo) {
  110. this.getCollectList()
  111. }
  112. },
  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. // console.log(this.collectList[index])
  144. this.$store.dispatch('checkHandle').then(res => {
  145. app.globalData.isAuth = res.IsAuth;
  146. app.globalData.isBind = res.IsBind;
  147. if ((!res.IsAuth) && (!res.IsBind)) { // 已授权已绑定
  148. uni.navigateTo({
  149. url: '/pages/reportDetail/reportDetail?id=' + item.ArticleId,
  150. });
  151. } else if (res.IsAuth) { //未授权
  152. uni.navigateTo({
  153. url: '/pages/authGuide/authGuide'
  154. })
  155. } else if (res.IsBind && !res.IsAuth) { //已授权未绑定
  156. uni.navigateTo({
  157. url: '/pages/login/login'
  158. })
  159. }
  160. })
  161. },
  162. },
  163. /* 下拉刷新 */
  164. onPullDownRefresh: Throttle(function() {
  165. this.page_no = 1;
  166. this.refresh = true;
  167. this.getCollectList()
  168. }),
  169. }
  170. </script>
  171. <style scoped lang="scss">
  172. .industrial-container {
  173. background-color: #f6f6f6;
  174. margin-top: 132rpx;
  175. .collect-ul {
  176. .collect-ltem {
  177. display: flex;
  178. padding: 30rpx 34rpx;
  179. background: #fff;
  180. margin-top: 10rpx;
  181. align-items: center;
  182. justify-content: space-between;
  183. .title {
  184. position: relative;
  185. max-width: 625rpx;
  186. color: #333;
  187. font-size: 30rpx;
  188. padding-left: 28rpx;
  189. .reg-text {
  190. position: absolute;
  191. top: 50%;
  192. left: 0rpx;
  193. width: 14rpx;
  194. height: 14rpx;
  195. transform: translateY(-50%);
  196. background-color: #FF0000;
  197. border-radius: 50%;
  198. z-index: 9;
  199. }
  200. }
  201. .desc {
  202. margin-top: 17rpx;
  203. padding-left: 28rpx;
  204. width: 625rpx;
  205. color: #999;
  206. }
  207. .text_one {
  208. max-width: 600rpx;
  209. padding-left: 28rpx;
  210. color: #666666;
  211. font-size: 28rpx;
  212. white-space: nowrap;
  213. text-overflow: ellipsis;
  214. overflow: hidden;
  215. }
  216. .text-threeFour {
  217. max-width: 600rpx;
  218. padding-left: 28rpx;
  219. color: #666666;
  220. font-size: 28rpx;
  221. text-overflow: -o-ellipsis-lastline;
  222. overflow: hidden;
  223. text-overflow: ellipsis;
  224. display: -webkit-box;
  225. -webkit-line-clamp: 2;
  226. line-clamp: 2;
  227. -webkit-box-orient: vertical;
  228. }
  229. }
  230. }
  231. }
  232. </style>