strategy.vue 5.8 KB

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