researchChoose.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="resear-container" v-if="haveResearch">
  3. <view class="theme">
  4. <view class="theme-title">最新主题关键词</view>
  5. <view class="theme-item">
  6. <text @click="goDetail(item,'标的')" v-for="item in listNew" :key="item.ArticleId">{{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. <view class="img-box">
  12. <image :src="item.ImgUrl" @click="goDetail(item,'作者')"></image>
  13. </view>
  14. <text style="font-size: 28rpx;margin-top: 5rpx;" @click="goDetail(item,'作者')">{{item.NickName}}</text>
  15. <text class="attention attention-cancel" @click="reportFllowDepartment(item.DepartmentId)" v-if="item.IsMyFollow">取消关注</text>
  16. <text class="attention" @click="reportFllowDepartment(item.DepartmentId)" v-else>+关注</text>
  17. </view>
  18. <view class="label-item">
  19. <text v-for="val in item.List" :key="val.ArticleId" @click="goDetail(val)">{{val.IndustryName}}</text>
  20. </view>
  21. <view class="lucency">
  22. <image src="../../../static/img/broadside-ico.png" mode=""></image>
  23. </view>
  24. </view>
  25. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage>1"/>
  26. <view class="bottom-env">
  27. 【研选系列】是机构投资者分享研究内容和原创观点的平台,试行阶段,限时免费,欢迎有内容贡献意愿的客户联系对口销售了解参与方式
  28. </view>
  29. <u-modal v-model="goFollowShow" :content-style="{fontSize: '32rpx'}" @confirm="goFollowShowBtn"
  30. :show-cancel-button="isCancelBtn" :confirm-text="confirmText" @cancel="isCancelBtn=false"
  31. :show-title="false" :cancel-style="{borderRight:'1rpx solid #EBEBEB'}"
  32. :confirm-style="{fontWeight: '700'}">
  33. <view class="slot-content">
  34. <rich-text :nodes="accounts"></rich-text>
  35. </view>
  36. </u-modal>
  37. </view>
  38. </template>
  39. <script>
  40. import { Reports } from '@/config/api.js'
  41. import { Throttle } from '@/config/util.js'
  42. export default {
  43. props:{
  44. strategyIndex:{
  45. type:Number,
  46. required:true
  47. },
  48. tabAct:{
  49. type:Number,
  50. required:true
  51. },
  52. isNum:{
  53. type:Number,
  54. required:true
  55. },
  56. pageNumFather:{
  57. type:Number,
  58. default:'',
  59. required:true
  60. }
  61. },
  62. data() {
  63. return {
  64. dataList:[],
  65. pageSize:10,
  66. page_no:1,
  67. listNew:[],
  68. haveData:true,
  69. status:'loadmore',
  70. loadText: {
  71. loadmore: '上拉加载更多',
  72. loading: '加载中',
  73. nomore: '已经到底了'
  74. },
  75. totalPage:'',
  76. haveResearch:false,
  77. goFollowShow:false,
  78. accounts:'',
  79. confirmText:'知道了',
  80. isCancelBtn:false,
  81. };
  82. },
  83. watch:{
  84. strategyIndex:{
  85. handler(val){
  86. if(val==5){
  87. this.industryListByDepartment()
  88. }
  89. },
  90. immediate:true
  91. },
  92. isNum:{
  93. handler(val){
  94. if(val > 1 && this.strategyIndex){
  95. if(this.status === 'nomore') return ;
  96. this.status = 'loading';
  97. this.page_no++;
  98. this.industryListByDepartment()
  99. }
  100. }
  101. },
  102. pageNumFather:{
  103. handler(val){
  104. if(val==1){
  105. console.log(11);
  106. this.page_no=1;
  107. this.dataList=[],
  108. this.listNew=[]
  109. this.industryListByDepartment()
  110. this.$parent.pageNumFather=''
  111. }
  112. }
  113. }
  114. },
  115. methods:{
  116. reportFllowDepartment(id){
  117. Reports.reportFllowDepartment({
  118. DepartmentId:id
  119. }).then(res=>{
  120. if(res.Ret == 200){
  121. if(res.Data.Status==1){
  122. this.goFollowShow=true
  123. this.confirmText = res.Data.GoFollow ? '去关注':'知道了'
  124. if(res.Data.GoFollow){
  125. this.accounts=`作者关注成功 <br> 想要及时获取该作者新发报告时的消息推送,请关注【弘则研究】公众号`
  126. this.isCancelBtn=true
  127. }else {
  128. this.accounts='作者关注成功,该作者发布新的报告时,【弘则研究】公众号会为您推送微信消息提醒'
  129. }
  130. }else {
  131. uni.showToast({
  132. title: '已取消关注',
  133. duration: 2000,
  134. icon:'none'
  135. });
  136. }
  137. this.dataList.forEach(item=>{
  138. if(item.DepartmentId==id){
  139. item.IsMyFollow=!item.IsMyFollow
  140. }
  141. })
  142. }
  143. })
  144. },
  145. industryListByDepartment(){
  146. Reports.industryListByDepartment({
  147. PageSize:this.pageSize,
  148. CurrentIndex:this.page_no,
  149. ChartPermissionId:this.tabAct
  150. }).then(res=>{
  151. if(res.Ret===200){
  152. this.haveResearch=res.Data.HaveResearch
  153. if(!res.Data.HaveResearch){
  154. this.$util.modalShow('','您暂无查看研选权限','',()=>{
  155. uni.reLaunch({
  156. url:'/pages/index/index'
  157. })
  158. })
  159. }
  160. this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
  161. this.totalPage = res.Data.Paging.Pages;//总页数
  162. this.listNew=res.Data.ListnNew ||[]
  163. if(this.page_no === 1) {
  164. this.dataList = res.Data.List || [];
  165. this.haveData = this.dataList.length ? true : false
  166. if(this.refresh) {
  167. uni.stopPullDownRefresh();
  168. this.refresh = false;
  169. }
  170. }else {
  171. this.dataList = this.dataList.concat(res.Data.List)
  172. }
  173. }
  174. })
  175. },
  176. goDetail(item,genre=''){
  177. const {ArticleId,IndustrialManagementId,DepartmentId} = item
  178. let id = IndustrialManagementId || ''
  179. let article = ArticleId || ''
  180. let genreId = DepartmentId || ''
  181. uni.navigateTo({
  182. url:'/reportPages/industrialReport/industrialReport?id=' + id + '&idArticle=' + article + '&idGenre='+genreId +'&type=研选'+'&isGenre='+genre,
  183. });
  184. },
  185. goFollowShowBtn(){
  186. if(this.confirmText=='去关注') {
  187. uni.navigateTo({
  188. url: '/activityPages/accountsOfficial/accountsOfficial'
  189. })
  190. }
  191. this.goFollowShow=false
  192. }
  193. }
  194. }
  195. </script>
  196. <style lang="scss" scoped>
  197. .resear-container {
  198. padding: 220rpx 0 0;
  199. background-color: #F7F7F7;
  200. .theme {
  201. padding: 30rpx 34rpx 0 ;
  202. margin-bottom: 20rpx;
  203. background: #FFFFFF;
  204. .theme-title {
  205. font-size: 32rpx;
  206. font-weight: bold;
  207. margin-bottom: 20rpx;
  208. color: #333333;
  209. }
  210. .theme-item {
  211. display: flex;
  212. flex-wrap: wrap;
  213. text {
  214. box-sizing: border-box;
  215. padding: 13rpx 45rpx;
  216. color: #2C83FF;
  217. font-size: 28rpx;
  218. background: #EBF4FF;
  219. border-radius: 35rpx;
  220. margin: 0 30rpx 30rpx 0;
  221. overflow: hidden;
  222. white-space: nowrap;
  223. text-overflow:ellipsis;
  224. }
  225. }
  226. }
  227. .author-list {
  228. position: relative;
  229. margin-bottom: 10rpx;
  230. padding: 20rpx 30rpx 20rpx 55rpx;
  231. background: #FFFFFF;
  232. display: flex;
  233. .author-item {
  234. height: 240rpx;
  235. padding: 0rpx 78rpx 0rpx 0;
  236. border-right: 2rpx solid #E5E5E5;
  237. text-align: center;
  238. .img-box {
  239. width: 140rpx;
  240. height: 140rpx;
  241. overflow: hidden;
  242. border-radius: 10rpx;
  243. image {
  244. width: 100%;
  245. height: 100%;
  246. }
  247. }
  248. .attention {
  249. margin-top: 6rpx;
  250. padding: 4rpx 20rpx;
  251. font-size: 24rpx;
  252. border-radius: 30rpx;
  253. color: #FFFFFF ;
  254. background: #2C83FF;
  255. }
  256. .attention-cancel {
  257. color: #666666 !important;
  258. background: #F8F8FA !important;
  259. }
  260. }
  261. .label-item {
  262. padding: 10rpx 0 0 34rpx;
  263. overflow: hidden;
  264. white-space: nowrap;
  265. text {
  266. color: #2C83FF;
  267. font-size: 28rpx;
  268. margin-bottom: 12rpx;
  269. }
  270. }
  271. .lucency {
  272. position: absolute;
  273. top: 0;
  274. right: 0;
  275. width: 80rpx;
  276. height: 100%;
  277. image {
  278. width: 100%;
  279. height: 100%;
  280. }
  281. }
  282. }
  283. .bottom-env {
  284. background: #F7F7F7;
  285. padding: 10rpx 50rpx;
  286. color: #999999;
  287. font-size: 26rpx;
  288. }
  289. }
  290. </style>