industrialReport.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <!-- 季度策略 -->
  3. <view class="container industrial-container">
  4. <view class="collect-ul" v-if="haveData">
  5. <view class="collect-ltem" v-for="(item,index) in collectList" :key="index" @click="goDetail(item,index)">
  6. <view class="item-left">
  7. <text class="title text_twoLine">{{item.Title}}
  8. <text class="reg-text" v-if="item.IsRed"></text>
  9. </text>
  10. <!-- <view class="text_twoLine desc">{{item.PublishDate}} <text>1231231</text></vive> -->
  11. <view class="desc">
  12. <text :class="item.IsResearch ? 'publishDate' : ''">{{item.PublishDate}}</text>
  13. <text v-if="item.IsResearch" class="text_oneLine text-name">{{item.IndustryName}}</text>
  14. </view>
  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 class="nodata" v-else>
  21. <image src="@/static/img/nodata.png" mode="" class="nodata_ico"></image>
  22. <text>暂时没有报告的内容</text>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {Reports} from '@/config/api.js'
  28. import {Throttle} from '@/config/util.js'
  29. let app = getApp()
  30. export default {
  31. data() {
  32. return {
  33. refresh: false, //正在下拉
  34. page_no: 1,
  35. pageSize: 10,
  36. categoryId: null,
  37. collectList: [],
  38. haveData: true,
  39. status: 'loadmore',
  40. loadText: {
  41. loadmore: '上拉加载更多',
  42. loading: '加载中',
  43. nomore: '已经到底了'
  44. },
  45. typeIsPost: '', //
  46. genreIs: '', //作者还是文章
  47. totalPage: '',
  48. titleReport: '',
  49. idGenre: '',
  50. articleId: ''
  51. };
  52. },
  53. onLoad(option) {
  54. this.$store.dispatch("checkHandle", {
  55. type: 'load',
  56. val: option
  57. }).then(res => {
  58. this.categoryId = Number(option.id) || ''
  59. this.idGenre = Number(option.idGenre) || ''
  60. this.articleId = Number(option.idArticle) || ''
  61. this.typeIsPost = option.type || ''
  62. this.genreIs = option.isGenre || ''
  63. this.getCollectList()
  64. })
  65. },
  66. onShow() {},
  67. methods: {
  68. /* 获取列表 */
  69. async getCollectList() {
  70. const res = this.typeIsPost == '研选' && this.genreIs !== '标的' ? await Reports.industryReportList({
  71. PageSize: this.pageSize,
  72. CurrentIndex: this.page_no,
  73. DepartmentId: this.idGenre,
  74. IndustrialManagementId: this.categoryId,
  75. ArticleId: this.articleId
  76. }) : this.genreIs === '标的' ? await Reports.reportListNew({
  77. PageSize: this.pageSize,
  78. CurrentIndex: this.page_no,
  79. ArticleId: this.articleId
  80. }) : await Reports.getTactics({
  81. PageSize: this.pageSize,
  82. CurrentIndex: this.page_no,
  83. CategoryId: this.categoryId
  84. })
  85. if (res.Ret === 200) {
  86. if (!res.Data.HaveResearch && this.typeIsPost == '研选') {
  87. this.$util.modalShow('', '您暂无查看研选权限', '', () => {
  88. uni.reLaunch({
  89. url: '/pages/index/index'
  90. })
  91. })
  92. }
  93. uni.setNavigationBarTitle({
  94. title: this.genreIs == '作者' ? res.Data.NickName : this.genreIs === '标的' ?
  95. res.Data.IndustryName :res.Data.IndustryName ?res.Data.IndustryName: res.Data.MatchTypeName
  96. });
  97. this.titleReport = this.genreIs=='作者' ? res.Data.NickName : this.genreIs === '标的' ? res.Data.IndustryName :
  98. res.Data.IndustryName ? res.Data.IndustryName: res.Data.MatchTypeName
  99. this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
  100. this.totalPage = res.Data.Paging.Pages; //总页数
  101. if (res.Data.List.length > 0) {
  102. res.Data.List.forEach(item => {
  103. if (item.IsResearch) {
  104. item.PublishDate = item.PublishDate.slice(0, 10)
  105. }
  106. })
  107. }
  108. if (this.page_no === 1) {
  109. this.collectList = res.Data.List || [];
  110. this.haveData = this.collectList.length ? true : false
  111. if (this.refresh) {
  112. uni.stopPullDownRefresh();
  113. this.refresh = false;
  114. }
  115. } else {
  116. this.collectList = this.collectList.concat(res.Data.List)
  117. }
  118. }
  119. // if(this.typeIsPost =='研选'&& this.genreIs!=='标的') {
  120. // Reports.industryReportList({
  121. // PageSize: this.pageSize,
  122. // CurrentIndex: this.page_no,
  123. // DepartmentId:this.idGenre,
  124. // IndustrialManagementId:this.categoryId,
  125. // ArticleId:this.articleId
  126. // }).then(res => {
  127. // if(res.Ret === 200) {
  128. // if(!res.Data.HaveResearch){
  129. // this.$util.modalShow('','您暂无查看研选权限','',()=>{
  130. // uni.reLaunch({
  131. // url:'/pages/index/index'
  132. // })
  133. // })
  134. // }
  135. // uni.setNavigationBarTitle({
  136. // title: this.genreIs=='作者' ? res.Data.NickName :res.Data.IndustryName
  137. // });
  138. // if(res.Data.List.length>0){
  139. // res.Data.List.forEach(item =>{
  140. // item.PublishDate=item.PublishDate.slice(0,10)
  141. // })
  142. // }
  143. // this.titleReport = this.genreIs=='作者' ? res.Data.NickName :res.Data.IndustryName
  144. // this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
  145. // this.totalPage = res.Data.Paging.Pages;//总页数
  146. // if(this.page_no === 1) {
  147. // this.collectList = res.Data.List || [];
  148. // this.haveData = this.collectList.length ? true : false
  149. // if(this.refresh) {
  150. // uni.stopPullDownRefresh();
  151. // this.refresh = false;
  152. // }
  153. // }else {
  154. // this.collectList = this.collectList.concat(res.Data.List)
  155. // }
  156. // }
  157. // })
  158. // return
  159. // }else {
  160. // const res = this.genreIs==='标的' ? await Reports.reportListNew({
  161. // PageSize: this.pageSize,
  162. // CurrentIndex: this.page_no,
  163. // ArticleId:this.articleId
  164. // }) : await Reports.getTactics({
  165. // PageSize: this.pageSize,
  166. // CurrentIndex: this.page_no,
  167. // CategoryId:this.categoryId
  168. // })
  169. // if(res.Ret === 200) {
  170. // uni.setNavigationBarTitle({
  171. // title:this.genreIs==='标的' ? res.Data.IndustryName : res.Data.MatchTypeName
  172. // });
  173. // this.titleReport=this.genreIs==='标的' ? res.Data.IndustryName : res.Data.MatchTypeName
  174. // this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
  175. // this.totalPage = res.Data.Paging.Pages;//总页数
  176. // if(res.Data.List.length>0){
  177. // res.Data.List.forEach(item =>{
  178. // if(item.IsResearch){
  179. // item.PublishDate=item.PublishDate.slice(0,10)
  180. // }
  181. // })
  182. // }
  183. // if(this.page_no === 1) {
  184. // this.collectList = res.Data.List || [];
  185. // this.haveData = this.collectList.length ? true : false
  186. // if(this.refresh) {
  187. // uni.stopPullDownRefresh();
  188. // this.refresh = false;
  189. // }
  190. // }else {
  191. // this.collectList = this.collectList.concat(res.Data.List)
  192. // }
  193. // }
  194. // }
  195. },
  196. goDetail(item, index) {
  197. /* 无需授权且已绑定 检验是或否有权限 */
  198. this.collectList[index].IsRed = false
  199. this.$store.dispatch('checkHandle').then(res => {
  200. app.globalData.isAuth = res.IsAuth;
  201. app.globalData.isBind = res.IsBind;
  202. if ((!res.IsAuth) && (!res.IsBind)) { // 已授权已绑定
  203. uni.navigateTo({
  204. url: '/pages/reportDetail/reportDetail?id=' + item.ArticleId,
  205. });
  206. } else if (res.IsAuth) { //未授权
  207. uni.navigateTo({
  208. url: '/pages/authGuide/authGuide'
  209. })
  210. } else if (res.IsBind && !res.IsAuth) { //已授权未绑定
  211. uni.navigateTo({
  212. url: '/pages/login/login'
  213. })
  214. }
  215. })
  216. },
  217. },
  218. /* 触底 */
  219. onReachBottom: Throttle(function() {
  220. if (this.status === 'nomore') return;
  221. this.status = 'loading';
  222. this.page_no++;
  223. this.getCollectList()
  224. }),
  225. /* 下拉刷新 */
  226. onPullDownRefresh: Throttle(function() {
  227. this.page_no = 1;
  228. this.refresh = true;
  229. this.getCollectList()
  230. }),
  231. /**
  232. * 用户点击分享
  233. */
  234. onShareAppMessage: function(res) {
  235. return {
  236. title: this.titleReport,
  237. path: '/reportPages/industrialReport/industrialReport?id=' + this.categoryId + '&type=' + this
  238. .typeIsPost + '&isGenre=' + this.genreIs + '&idGenre=' + this.idGenre + '&idArticle=' + this
  239. .articleId,
  240. success: (res) => {},
  241. fail: (err) => {}
  242. }
  243. },
  244. }
  245. </script>
  246. <style scoped lang="scss">
  247. @import '../index.scss';
  248. .industrial-container {
  249. background-color: #f6f6f6;
  250. }
  251. </style>