list.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="special-column-list-page">
  3. <view class="report-empty-box" v-if="finished&&list.length==0">
  4. <image :src="globalImgUrls.chartEmpty" mode="widthFix" />
  5. <view>暂无数据</view>
  6. </view>
  7. <view class="list" v-else>
  8. <view class="flex item" v-for="item in list" :key="item.classify_id_second" @click="goDetail(item)">
  9. <image class="avatar" :src="item.home_img_url" mode="aspectFill" lazyload/>
  10. <view class="content">
  11. <view class="name">{{item.classify_name_second}}</view>
  12. <view class="author">主讲人:{{item.report_author}}</view>
  13. <view class="van-ellipsis job">{{item.author_descript}}</view>
  14. <view class="num">第{{item.stage}}期 | {{item.product_name}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 分享海报 -->
  19. <sharePoster
  20. :style="{bottom:'140rpx'}"
  21. :shareData="{type:'specialColumnList',params:{classify_id_first:classifyId}}"
  22. ></sharePoster>
  23. </view>
  24. </template>
  25. <script>
  26. import {apiSpecialColumnList} from '@/api/report'
  27. import sharePoster from '@/components/sharePoster/sharePoster.vue'
  28. export default {
  29. components: {
  30. sharePoster
  31. },
  32. data () {
  33. return {
  34. classifyId:0,
  35. classifyName:'',
  36. list:[],
  37. finished:false
  38. }
  39. },
  40. onLoad(options) {
  41. this.classifyId=options.classifyId
  42. // 设置title
  43. this.classifyName=decodeURIComponent(options.classifyName)
  44. uni.setNavigationBarTitle({ title: decodeURIComponent(options.classifyName) })
  45. this.getList()
  46. },
  47. onPullDownRefresh() {
  48. this.list=[]
  49. this.finished=false
  50. this.getList()
  51. setTimeout(() => {
  52. uni.stopPullDownRefresh()
  53. }, 1500);
  54. },
  55. onShareAppMessage() {
  56. return {
  57. title:this.classifyName
  58. }
  59. },
  60. methods: {
  61. async getList(){
  62. this.finished=false
  63. const res=await apiSpecialColumnList({classify_id_first:Number(this.classifyId)})
  64. if(res.code===200){
  65. this.list=res.data||[]
  66. this.finished=true
  67. }
  68. },
  69. goDetail(item){
  70. uni.navigateTo({ url: '/pages-report/specialColumn/detail?columnId='+item.classify_id_second })
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. page{
  77. padding-bottom: 0;
  78. }
  79. </style>
  80. <style lang="scss" scoped>
  81. .special-column-list-page{
  82. padding: 34rpx;
  83. .list{
  84. .item{
  85. margin-bottom: 30rpx;
  86. .avatar{
  87. flex-shrink: 0;
  88. margin-right: 30rpx;
  89. width: 160rpx;
  90. height: 214rpx;
  91. border-radius: 16rpx;
  92. background-color: #f5f5f5;
  93. }
  94. .content{
  95. flex: 1;
  96. overflow: hidden;
  97. .name{
  98. font-size: 32rpx;
  99. font-weight: bold;
  100. }
  101. .author{
  102. color: #666;
  103. margin: 10rpx 0;
  104. }
  105. .job{
  106. color: #666;
  107. }
  108. .num{
  109. margin-top: 20rpx;
  110. color: #E3B377;
  111. }
  112. }
  113. }
  114. }
  115. }
  116. </style>