学员端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
2.4 KiB

1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="行业政策"></topNavbar>
  4. <view class="pad">
  5. <view class="card" >
  6. <view class="li" v-for="(item,index) in listData" :key="index" @click="$goPage('/pages/indexEntry/iIndustryInfo/detail/detail?id='+item.id)">
  7. <view class="cover">
  8. <image :src="item.picture" mode="widthFix"></image>
  9. </view>
  10. <view class="rightCon">
  11. <view class="h2 towRowText">{{ item.title }}</view>
  12. <view class="date">{{ $u.timeFormat(item.createTime, 'yyyy/mm/dd') }}</view>
  13. </view>
  14. </view>
  15. </view>
  16. <view style="padding-bottom: 20rpx;" v-if="listData.length>10">
  17. <u-loadmore :status="status" />
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import { getarticlezcList } from '@/config/api.js'
  24. export default {
  25. data() {
  26. return {
  27. params: {
  28. pageNo: 1,
  29. pageSize: 20,
  30. type: 2
  31. },
  32. listData: [],
  33. total: 20,
  34. status: 'loading'
  35. }
  36. },
  37. onLoad() {
  38. this.getarticlezcListFn()
  39. },
  40. onPullDownRefresh() {
  41. this.listInit()
  42. },
  43. onReachBottom() {
  44. if(this.total>this.listData.length) {
  45. this.getarticlezcListFn()
  46. }
  47. },
  48. methods: {
  49. async listInit() {
  50. this.listData = []
  51. this.params.pageNo = 1
  52. await this.getarticlezcListFn()
  53. uni.stopPullDownRefresh()
  54. },
  55. async getarticlezcListFn() {
  56. const {data: res} = await getarticlezcList(this.params)
  57. this.listData.push(...res.list)
  58. this.total = res.total
  59. if(this.listData.length>=this.total) this.status = 'nomore'
  60. console.log(res)
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .pageBgImg {
  67. min-height: 100vh;
  68. .card {
  69. width: 100%;
  70. padding: 0 24rpx 10rpx 24rpx;
  71. .borderTop {
  72. border-bottom: 1px dashed #E8E9EC;
  73. height: 88rpx;
  74. display: flex;
  75. align-items: center;
  76. .tit {
  77. font-size: 28rpx;
  78. font-weight: 600;
  79. }
  80. }
  81. .li {
  82. display: flex;
  83. align-items: center;
  84. padding:20rpx 0;
  85. .cover {
  86. width: 184rpx;
  87. height: 148rpx;
  88. border-radius: 6rpx;
  89. overflow: hidden;
  90. }
  91. .rightCon {
  92. padding: 0 0 0 30rpx;
  93. display: flex;
  94. height: 148rpx;
  95. flex-direction: column;
  96. justify-content: space-between;
  97. flex: 1;
  98. .h2 {
  99. font-size: 24rpx;
  100. margin-top: 4rpx;
  101. }
  102. .date {
  103. font-size: 20rpx;
  104. color: #686B73;
  105. text-align: right;
  106. }
  107. }
  108. }
  109. }
  110. }
  111. </style>