list.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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="flex author">
  14. <text style="margin-right:20rpx;flex-shrink: 0;">{{item.report_author}}</text>
  15. <text class="van-ellipsis vip-text" v-if="item.vip_title">{{item.vip_title}}</text>
  16. <text class="van-ellipsis" v-else>{{item.author_descript}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 分享海报 -->
  22. <sharePoster
  23. :style="{bottom:'140rpx'}"
  24. :shareData="{
  25. type:'special_column_list',
  26. code_page:'pages-report/specialColumn/list',
  27. code_scene:code_scene,
  28. data:shareParams
  29. }"
  30. ></sharePoster>
  31. </view>
  32. </template>
  33. <script>
  34. import {apiSpecialColumnList} from '@/api/report'
  35. import {apiGetSceneToParams} from '@/api/common'
  36. import sharePoster from '@/components/sharePoster/sharePoster.vue'
  37. export default {
  38. components: {
  39. sharePoster
  40. },
  41. computed: {
  42. shareParams(){
  43. let obj={
  44. list_title:this.classifyName,
  45. stage_1:'',
  46. avatar_1:'',
  47. title_1:'',
  48. author_1:'',
  49. tag_1:'',
  50. stage_2:'',
  51. avatar_2:'',
  52. title_2:'',
  53. author_2:'',
  54. tag_2:'',
  55. }
  56. if(this.list[0]){
  57. obj.stage_1=this.list[0].stage.toString()
  58. obj.avatar_1=this.list[0].home_img_url
  59. obj.title_1=this.list[0].classify_name_second
  60. obj.author_1=this.list[0].report_author
  61. obj.tag_1=this.list[0].author_descript
  62. }
  63. if(this.list[1]){
  64. obj.stage_2=this.list[1].stage.toString()
  65. obj.avatar_2=this.list[1].home_img_url
  66. obj.title_2=this.list[1].classify_name_second
  67. obj.author_2=this.list[1].report_author
  68. obj.tag_2=this.list[1].author_descript
  69. }
  70. return obj
  71. },
  72. code_scene(){
  73. return JSON.stringify({classifyId:this.classifyId,classifyName:this.classifyName})
  74. }
  75. },
  76. data () {
  77. return {
  78. classifyId:0,
  79. classifyName:'',
  80. list:[],
  81. finished:false
  82. }
  83. },
  84. onLoad(options) {
  85. if(options.scene){
  86. this.init(options.scene)
  87. }else{
  88. this.classifyId=options.classifyId
  89. // 设置title
  90. this.classifyName=decodeURIComponent(options.classifyName)
  91. uni.setNavigationBarTitle({ title: decodeURIComponent(options.classifyName) })
  92. this.getList()
  93. }
  94. },
  95. onPullDownRefresh() {
  96. this.list=[]
  97. this.finished=false
  98. this.getList()
  99. setTimeout(() => {
  100. uni.stopPullDownRefresh()
  101. }, 1500);
  102. },
  103. onShareAppMessage() {
  104. return {
  105. title:`FICC【${this.classifyName}】`
  106. }
  107. },
  108. methods: {
  109. async init(e){
  110. const res=await apiGetSceneToParams({scene_key:e})
  111. if(res.code==200){
  112. const obj=JSON.parse(res.data)
  113. this.classifyId=obj.classifyId
  114. this.classifyName=decodeURIComponent(obj.classifyName)
  115. uni.setNavigationBarTitle({ title: decodeURIComponent(obj.classifyName) })
  116. this.getList()
  117. }
  118. },
  119. async getList(){
  120. this.finished=false
  121. const res=await apiSpecialColumnList({classify_id_first:Number(this.classifyId)})
  122. if(res.code===200){
  123. this.list=res.data||[]
  124. this.finished=true
  125. }
  126. },
  127. goDetail(item){
  128. uni.navigateTo({ url: '/pages-report/specialColumn/detail?columnId='+item.classify_id_second })
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss">
  134. page{
  135. padding-bottom: 0;
  136. }
  137. </style>
  138. <style lang="scss" scoped>
  139. .special-column-list-page{
  140. padding: 34rpx;
  141. .list{
  142. .item{
  143. margin-bottom: 20rpx;
  144. padding: 37rpx 30rpx 37rpx 37rpx;
  145. background: #FFFFFF;
  146. border: 1px solid #E6E6E6;
  147. box-sizing: border-box;
  148. box-shadow: 0px 0px 20rpx rgba(0, 0, 0, 0.08);
  149. border-radius: 16rpx;
  150. position: relative;
  151. overflow: hidden;
  152. align-items: center;
  153. .stage{
  154. position: absolute;
  155. top: 0;
  156. right: 0;
  157. display: block;
  158. background-color: #E3B377;
  159. border-bottom-left-radius: 16rpx;
  160. padding: 4rpx 10rpx;
  161. text-align: center;
  162. color: #FFFFFF;
  163. font-size: 24rpx;
  164. min-width: 126rpx;
  165. text-align: center;
  166. box-sizing: border-box;
  167. }
  168. .avatar{
  169. width: 180rpx;
  170. height: 180rpx;
  171. border-radius: 50%;
  172. flex-shrink: 0;
  173. margin-right: 20rpx;
  174. }
  175. .content{
  176. flex: 1;
  177. overflow: hidden;
  178. .title{
  179. font-size: 34rpx;
  180. font-weight: 700;
  181. padding-bottom: 20rpx;
  182. margin-bottom: 20rpx;
  183. border-bottom: 1px solid #E6E6E6;
  184. }
  185. .author{
  186. font-size: 28rpx;
  187. font-weight: 400;
  188. align-items: center;
  189. .vip-text{
  190. display: inline-block;
  191. background-color: #FAF7EE;
  192. font-size: 24rpx;
  193. padding: 8rpx 15rpx;
  194. border-radius: 23rpx;
  195. line-height: 1;
  196. position: relative;
  197. padding-left: 38rpx;
  198. &::before{
  199. content: '';
  200. display: inline-block;
  201. width: 30rpx;
  202. height: 30rpx;
  203. background-image: url('../static/tag.png');
  204. background-size: cover;
  205. line-height: 1;
  206. position: absolute;
  207. top: 6rpx;
  208. left: 8rpx;
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </style>