classify.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. <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专栏详情
  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. },
  57. goFiccService(){
  58. uni.navigateTo({url:'/pages-report/ficcService'})
  59. }
  60. }
  61. };
  62. </script>
  63. <style lang="scss" scoped>
  64. .classify-page {
  65. padding: 34rpx;
  66. .swiper{
  67. height: 300rpx;
  68. overflow: hidden;
  69. image{
  70. width: 100%;
  71. height: 100%;
  72. display: block;
  73. border-radius: 8rpx;
  74. }
  75. }
  76. .list{
  77. margin-top: 40rpx;
  78. display: flex;
  79. flex-wrap: wrap;
  80. .item{
  81. width: 25%;
  82. padding: 0 20rpx;
  83. margin-bottom: 30rpx;
  84. text-align: center;
  85. image{
  86. width: 128rpx;
  87. height: 128rpx;
  88. // background-color: #f5f5f5;
  89. }
  90. }
  91. }
  92. }
  93. </style>