classify.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="classify-page">
  3. <swiper class="swiper" autoplay interval>
  4. <swiper-item>
  5. <image @click="goFiccService" :src="globalImgUrls.ficcServiceImg+'?t='+new Date().getDay()" mode="aspectFill"/>
  6. </swiper-item>
  7. </swiper>
  8. <view class="list">
  9. <view class="item" @click="goDetail(item)" v-for="item in list" :key="item.classify_name_first">
  10. <image :src="item.icon_img_url" mode="aspectFill"/>
  11. <view>{{item.classify_name_first}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import {apiReportClassify} from '@/api/report'
  18. export default {
  19. data () {
  20. return {
  21. list:[]
  22. }
  23. },
  24. onLoad(options) {
  25. this.getClassifyList()
  26. },
  27. onPullDownRefresh() {
  28. this.getClassifyList()
  29. setTimeout(() => {
  30. uni.stopPullDownRefresh()
  31. }, 1500);
  32. },
  33. onShareAppMessage() {
  34. return {
  35. title:"FICC研报分类"
  36. }
  37. },
  38. methods: {
  39. async getClassifyList(){
  40. const res=await apiReportClassify()
  41. if(res.code===200){
  42. this.list=res.data
  43. }
  44. },
  45. goDetail(item){
  46. //redirect_type : 跳转页面类型:1,专栏列表,2报告列表,3专栏详情,4品种类型列表
  47. if(item.redirect_type==1){
  48. uni.navigateTo({ url: `/pages-report/specialColumn/list?classifyId=${item.classify_id_first}&classifyName=${item.classify_name_first}` })
  49. }
  50. if(item.redirect_type==2){
  51. uni.navigateTo({url:`/pages-report/reportList?classifyId=${item.classify_id_first}&classifyName=${item.classify_name_first}`})
  52. }
  53. if(item.redirect_type==3){
  54. uni.navigateTo({url:'/pages-report/specialColumn/detail?columnId='+item.classify_id_second})
  55. }
  56. if(item.redirect_type==4){
  57. uni.navigateTo({url:`/pages-report/reportForVariety/list?classifyId=${item.classify_id_first}&classifyName=${item.classify_name_first}`})
  58. }
  59. },
  60. goFiccService(){
  61. uni.navigateTo({url:'/pages-report/ficcService'})
  62. }
  63. }
  64. };
  65. </script>
  66. <style>
  67. page{
  68. padding-bottom: constant(safe-area-inset-bottom);
  69. padding-bottom: env(safe-area-inset-bottom);
  70. }
  71. </style>
  72. <style lang="scss" scoped>
  73. .classify-page {
  74. padding: 34rpx;
  75. .swiper{
  76. height: 300rpx;
  77. overflow: hidden;
  78. image{
  79. width: 100%;
  80. height: 100%;
  81. display: block;
  82. border-radius: 8rpx;
  83. }
  84. }
  85. .list{
  86. margin-top: 40rpx;
  87. display: flex;
  88. flex-wrap: wrap;
  89. .item{
  90. width: 25%;
  91. padding: 0 20rpx;
  92. margin-bottom: 30rpx;
  93. text-align: center;
  94. image{
  95. width: 128rpx;
  96. height: 128rpx;
  97. // background-color: #f5f5f5;
  98. }
  99. }
  100. }
  101. }
  102. </style>