学员端小程序
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.

119 lines
2.6 KiB

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