洛阳学员端
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.

116 lines
2.5 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar :title="params.type==1?'行业资讯':'政策法规'"></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: 1
  31. },
  32. listData: [],
  33. total: 20,
  34. status: 'loading',
  35. }
  36. },
  37. onLoad(options) {
  38. this.params.type = options.type
  39. this.getarticlezcListFn()
  40. },
  41. onPullDownRefresh() {
  42. this.listInit()
  43. },
  44. onReachBottom() {
  45. if(this.total>this.listData.length) {
  46. this.getarticlezcListFn()
  47. }
  48. },
  49. methods: {
  50. async listInit() {
  51. this.listData = []
  52. this.params.pageNo = 1
  53. await this.getarticlezcListFn()
  54. uni.stopPullDownRefresh()
  55. },
  56. async getarticlezcListFn() {
  57. const {data: res} = await getarticlezcList(this.params)
  58. this.listData.push(...res.list)
  59. this.total = res.total
  60. if(this.listData.length>=this.total) this.status = 'nomore'
  61. console.log(res)
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .pageBgImg {
  68. min-height: 100vh;
  69. .card {
  70. width: 100%;
  71. padding: 0 24rpx 10rpx 24rpx;
  72. .li {
  73. display: flex;
  74. align-items: center;
  75. padding:20rpx 0;
  76. border-bottom: 1px solid #f2f3f5;
  77. &:last-child {
  78. border: none;
  79. }
  80. .cover {
  81. width: 184rpx;
  82. height: 148rpx;
  83. border-radius: 6rpx;
  84. overflow: hidden;
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. background: #f2f3f5;
  89. }
  90. .rightCon {
  91. padding: 0 0 0 30rpx;
  92. display: flex;
  93. height: 148rpx;
  94. flex-direction: column;
  95. justify-content: space-between;
  96. flex: 1;
  97. .h2 {
  98. font-size: 24rpx;
  99. margin-top: 4rpx;
  100. }
  101. .date {
  102. font-size: 20rpx;
  103. color: #686B73;
  104. text-align: right;
  105. }
  106. }
  107. }
  108. }
  109. }
  110. </style>