list.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. <text class="stage">第{{item.stage}}期</text>
  10. <image class="avatar" :src="item.home_img_url" mode="aspectFill" lazy-load></image>
  11. <view class="content">
  12. <view class="title">{{item.classify_name_second}}</view>
  13. <view class="van-ellipsis author">
  14. <text style="margin-right:20rpx">{{item.report_author}}</text>
  15. <text class="vip-text" v-if="item.vip_title">{{item.vip_title}}</text>
  16. <text v-else>{{item.author_descript}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {apiSpecialColumnList} from '@/api/report'
  25. export default {
  26. data () {
  27. return {
  28. classifyId:0,
  29. classifyName:'',
  30. list:[],
  31. finished:false
  32. }
  33. },
  34. onLoad(options) {
  35. this.classifyId=options.classifyId
  36. // 设置title
  37. this.classifyName=decodeURIComponent(options.classifyName)
  38. uni.setNavigationBarTitle({ title: decodeURIComponent(options.classifyName) })
  39. this.getList()
  40. },
  41. onPullDownRefresh() {
  42. this.list=[]
  43. this.finished=false
  44. this.getList()
  45. setTimeout(() => {
  46. uni.stopPullDownRefresh()
  47. }, 1500);
  48. },
  49. onShareAppMessage() {
  50. return {
  51. title:`FICC【${this.classifyName}】`
  52. }
  53. },
  54. methods: {
  55. async getList(){
  56. this.finished=false
  57. const res=await apiSpecialColumnList({classify_id_first:Number(this.classifyId)})
  58. if(res.code===200){
  59. this.list=res.data||[]
  60. this.finished=true
  61. }
  62. },
  63. goDetail(item){
  64. uni.navigateTo({ url: '/pages-report/specialColumn/detail?columnId='+item.classify_id_second })
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. page{
  71. padding-bottom: 0;
  72. }
  73. </style>
  74. <style lang="scss" scoped>
  75. .special-column-list-page{
  76. padding: 34rpx;
  77. .list{
  78. .item{
  79. margin-bottom: 20rpx;
  80. padding: 37rpx 30rpx 37rpx 37rpx;
  81. background: #FFFFFF;
  82. border: 1px solid #E6E6E6;
  83. box-sizing: border-box;
  84. box-shadow: 0px 0px 20rpx rgba(0, 0, 0, 0.08);
  85. border-radius: 16rpx;
  86. position: relative;
  87. overflow: hidden;
  88. align-items: center;
  89. .stage{
  90. position: absolute;
  91. top: 0;
  92. right: 0;
  93. display: block;
  94. background-color: #E3B377;
  95. border-bottom-left-radius: 16rpx;
  96. padding: 4rpx 10rpx;
  97. text-align: center;
  98. color: #FFFFFF;
  99. font-size: 24rpx;
  100. min-width: 126rpx;
  101. text-align: center;
  102. box-sizing: border-box;
  103. }
  104. .avatar{
  105. width: 180rpx;
  106. height: 180rpx;
  107. border-radius: 50%;
  108. flex-shrink: 0;
  109. margin-right: 20rpx;
  110. }
  111. .content{
  112. flex: 1;
  113. overflow: hidden;
  114. .title{
  115. font-size: 34rpx;
  116. font-weight: 700;
  117. padding-bottom: 20rpx;
  118. margin-bottom: 20rpx;
  119. border-bottom: 1px solid #E6E6E6;
  120. }
  121. .author{
  122. font-size: 28rpx;
  123. font-weight: 400;
  124. .vip-text{
  125. display: inline-block;
  126. background-color: #FAF7EE;
  127. font-size: 24rpx;
  128. padding: 8rpx 15rpx;
  129. border-radius: 23rpx;
  130. line-height: 1;
  131. position: relative;
  132. padding-left: 38rpx;
  133. &::before{
  134. content: '';
  135. display: inline-block;
  136. width: 30rpx;
  137. height: 30rpx;
  138. background-image: url('../static/tag.png');
  139. background-size: cover;
  140. line-height: 1;
  141. position: absolute;
  142. top: 6rpx;
  143. left: 8rpx;
  144. }
  145. }
  146. }
  147. }
  148. }
  149. }
  150. }
  151. </style>