classify.vue 2.3 KB

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