researchChoose.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="resear-container">
  3. <view class="theme">
  4. <view class="theme-title">最新主题</view>
  5. <view class="theme-item">
  6. <text @click="goDetail(item.IndustrialManagementId)" v-for="item in listNew" :key="item.IndustrialManagementId">{{item.IndustryName}}</text>
  7. </view>
  8. </view>
  9. <view class="author-list" v-for="item in dataList" :key="item.DepartmentId">
  10. <view class="author-item">
  11. <image :src="item.ImgUrl" @click="goDetail(item.DepartmentId,'作者')"></image>
  12. <text style="font-size: 28rpx;" @click="goDetail(item.DepartmentId,'作者')">{{item.NickName}}</text>
  13. <text class="attention attention-cancel" @click="reportFllowDepartment(item.DepartmentId)" v-if="item.IsMyFollow">取消关注</text>
  14. <text class="attention" @click="reportFllowDepartment(item.DepartmentId)" v-else>+关注</text>
  15. </view>
  16. <view class="label-item">
  17. <text v-for="key in item.List" :key="key.IndustrialManagementId" @click="goDetail(key.IndustrialManagementId)">{{key.IndustryName}}</text>
  18. </view>
  19. </view>
  20. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage>1"/>
  21. <view class="bottom-env">
  22. 【研选系列】是机构投资者分享研究内容和原创观点的平台,试行阶段,限时免费,欢迎有内容贡献意愿的客户联系18621268829了解参与方式
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { Reports } from '@/config/api.js'
  28. import { Throttle } from '@/config/util.js'
  29. export default {
  30. props:{
  31. strategyIndex:{
  32. type:Number,
  33. required:true
  34. },
  35. tabAct:{
  36. type:Number,
  37. required:true
  38. },
  39. isNum:{
  40. type:Number,
  41. required:true
  42. },
  43. pageNumFather:{
  44. type:Number,
  45. default:'',
  46. required:true
  47. }
  48. },
  49. data() {
  50. return {
  51. dataList:[],
  52. pageSize:10,
  53. currentIndex:1,
  54. listNew:[],
  55. haveData:true,
  56. status:'loadmore',
  57. loadText: {
  58. loadmore: '上拉加载更多',
  59. loading: '加载中',
  60. nomore: '已经到底了'
  61. },
  62. totalPage:''
  63. };
  64. },
  65. watch:{
  66. strategyIndex:{
  67. handler(val){
  68. if(val==5){
  69. this.industryListByDepartment()
  70. }
  71. },
  72. immediate:true
  73. },
  74. isNum:{
  75. handler(val){
  76. if(val > 1 && this.strategyIndex){
  77. if(this.status === 'nomore') return ;
  78. this.status = 'loading';
  79. this.page_no++;
  80. this.industryListByDepartment()
  81. }
  82. }
  83. },
  84. pageNumFather:{
  85. handler(val){
  86. if(val==1){
  87. this.page_no=1;
  88. this.dataList=[],
  89. this.listNew=[]
  90. this.industryListByDepartment()
  91. }
  92. }
  93. }
  94. },
  95. methods:{
  96. reportFllowDepartment(id){
  97. Reports.reportFllowDepartment({
  98. DepartmentId:id
  99. }).then(res=>{
  100. if(res.Ret == 200){
  101. this.dataList.forEach(item=>{
  102. if(item.DepartmentId==id){
  103. item.IsMyFollow=!item.IsMyFollow
  104. }
  105. })
  106. uni.showToast({
  107. title: res.Msg,
  108. duration: 2000
  109. });
  110. }
  111. })
  112. },
  113. industryListByDepartment(){
  114. Reports.industryListByDepartment({
  115. PageSize:this.pageSize,
  116. CurrentIndex:this.currentIndex,
  117. ChartPermissionId:this.tabAct
  118. }).then(res=>{
  119. if(res.Ret===200){
  120. this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
  121. this.totalPage = res.Data.Paging.Pages;//总页数
  122. this.listNew=res.Data.ListnNew ||[]
  123. if(this.page_no === 1) {
  124. this.dataList = res.Data.List || [];
  125. this.haveData = this.dataList.length ? true : false
  126. if(this.refresh) {
  127. uni.stopPullDownRefresh();
  128. this.refresh = false;
  129. }
  130. }else {
  131. this.dataList = this.dataList.concat(res.Data.List)
  132. }
  133. }
  134. })
  135. },
  136. goDetail(id,genre=''){
  137. uni.navigateTo({
  138. url:'/reportPages/industrialReport/industrialReport?id=' + id +'&type=研选'+'&isGenre='+genre,
  139. });
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .resear-container {
  146. padding: 220rpx 0 140rpx;
  147. background-color: #F7F7F7;
  148. .theme {
  149. padding: 30rpx 34rpx;
  150. background: #FFFFFF;
  151. .theme-title {
  152. font-size: 32rpx;
  153. font-weight: bold;
  154. margin-bottom: 30rpx;
  155. color: #333333;
  156. }
  157. .theme-item {
  158. display: flex;
  159. flex-wrap: wrap;
  160. text {
  161. padding: 13rpx 45rpx;
  162. color: #2C83FF;
  163. font-size: 32rpx;
  164. background: #EBF4FF;
  165. border-radius: 35rpx;
  166. margin: 0 30rpx 30rpx 0;
  167. }
  168. }
  169. }
  170. .author-list {
  171. margin: 20rpx 0;
  172. padding: 20rpx 30rpx 20rpx 55rpx;
  173. background: #FFFFFF;
  174. display: flex;
  175. .author-item {
  176. height: 300rpx;
  177. padding: 20rpx 78rpx 20rpx 0;
  178. border-right: 2rpx solid #E5E5E5;
  179. text-align: center;
  180. image {
  181. width: 140rpx;
  182. height: 140rpx;
  183. }
  184. .attention {
  185. margin-top: 30rpx;
  186. padding: 4rpx 20rpx;
  187. font-size: 24rpx;
  188. border-radius: 30rpx;
  189. color: #FFFFFF ;
  190. background: #2C83FF;
  191. }
  192. .attention-cancel {
  193. color: #666666 !important;
  194. background: #F8F8FA !important;
  195. }
  196. }
  197. .label-item {
  198. padding: 26rpx 0 0 34rpx;
  199. text {
  200. color: #2C83FF;
  201. font-size: 28rpx;
  202. margin-bottom: 30rpx;
  203. }
  204. }
  205. }
  206. .bottom-env {
  207. background: #F7F7F7;
  208. position: fixed;
  209. bottom: 0;
  210. left: 0;
  211. padding: 20rpx 50rpx;
  212. color: #999999;
  213. font-size: 26rpx;
  214. }
  215. }
  216. </style>