strategy.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. }
  104. }
  105. }
  106. },
  107. mounted() {
  108. if (this.tabAct_idTwo) {
  109. this.getCollectList()
  110. }
  111. },
  112. methods: {
  113. /* 获取列表 */
  114. getCollectList() {
  115. Reports.getTacticsList({
  116. PageSize: this.pageSize,
  117. CurrentIndex: this.page_no,
  118. CategoryId: this.tabAct_idTwo
  119. }).then(res => {
  120. if (res.Ret === 200) {
  121. this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
  122. this.totalPage = res.Data.Paging.Pages; //总页数
  123. if (this.page_no === 1) {
  124. this.collectList = res.Data.List || [];
  125. this.haveData = this.collectList.length ? true : false
  126. if (this.refresh) {
  127. uni.stopPullDownRefresh();
  128. this.refresh = false;
  129. }
  130. } else {
  131. this.collectList = this.collectList.concat(res.Data.List)
  132. }
  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. // console.log(this.collectList[index])
  143. this.$store.dispatch('checkHandle').then(res => {
  144. app.globalData.isAuth = res.IsAuth;
  145. app.globalData.isBind = res.IsBind;
  146. if ((!res.IsAuth) && (!res.IsBind)) { // 已授权已绑定
  147. uni.navigateTo({
  148. url: '/pages/reportDetail/reportDetail?idReport=' + item.ArticleId,
  149. });
  150. } else if (res.IsAuth) { //未授权
  151. uni.navigateTo({
  152. url: '/pages/authGuide/authGuide'
  153. })
  154. } else if (res.IsBind && !res.IsAuth) { //已授权未绑定
  155. uni.navigateTo({
  156. url: '/pages/login/login'
  157. })
  158. }
  159. })
  160. },
  161. },
  162. /* 下拉刷新 */
  163. onPullDownRefresh: Throttle(function() {
  164. this.page_no = 1;
  165. this.refresh = true;
  166. this.getCollectList()
  167. }),
  168. }
  169. </script>
  170. <style scoped lang="scss">
  171. .industrial-container {
  172. background-color: #f6f6f6;
  173. margin-top: 132rpx;
  174. .collect-ul {
  175. // margin-top: 10rpx;
  176. // background-color: #f6f6f6;
  177. // padding-top: rpx;
  178. .collect-ltem {
  179. display: flex;
  180. padding: 30rpx 34rpx;
  181. background: #fff;
  182. margin-top: 10rpx;
  183. align-items: center;
  184. justify-content: space-between;
  185. .title {
  186. position: relative;
  187. max-width: 625rpx;
  188. color: #333;
  189. font-size: 30rpx;
  190. padding-left: 28rpx;
  191. .reg-text {
  192. position: absolute;
  193. top: 50%;
  194. left: 0rpx;
  195. width: 14rpx;
  196. height: 14rpx;
  197. transform: translateY(-50%);
  198. background-color: #FF0000;
  199. border-radius: 50%;
  200. z-index: 9;
  201. }
  202. }
  203. .desc {
  204. margin-top: 17rpx;
  205. padding-left: 28rpx;
  206. width: 625rpx;
  207. color: #999;
  208. }
  209. .text_one {
  210. max-width: 600rpx;
  211. padding-left: 28rpx;
  212. color: #666666;
  213. font-size: 28rpx;
  214. white-space: nowrap;
  215. text-overflow: ellipsis;
  216. overflow: hidden;
  217. }
  218. .text-threeFour {
  219. max-width: 600rpx;
  220. padding-left: 28rpx;
  221. color: #666666;
  222. font-size: 28rpx;
  223. text-overflow: -o-ellipsis-lastline;
  224. overflow: hidden;
  225. text-overflow: ellipsis;
  226. display: -webkit-box;
  227. -webkit-line-clamp: 2;
  228. line-clamp: 2;
  229. -webkit-box-orient: vertical;
  230. }
  231. }
  232. }
  233. }
  234. </style>