morningAll.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="container morning-all-content">
  3. <view class="content-ul" v-for="item in collectList" :key="item.Id" @click="lookDetails(item)">
  4. <view class="title">{{ item.Title }}</view>
  5. <view class="body">
  6. <text style="flex: 1">{{ item.IndustryName }}</text>
  7. <view><van-icon name="arrow" /></view>
  8. </view>
  9. </view>
  10. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="page_no > 1" />
  11. </view>
  12. </template>
  13. <script>
  14. import { Reports } from "@/config/api.js";
  15. export default {
  16. data() {
  17. return {
  18. collectList: [],
  19. page_no: 1,
  20. pageSize: 10,
  21. status: "loadmore",
  22. loadText: {
  23. loadmore: "上拉加载更多",
  24. loading: "加载中",
  25. nomore: "已经到底了",
  26. },
  27. };
  28. },
  29. methods: {
  30. // 获取数据
  31. async getDataList() {
  32. const res = await Reports.getMorningMeetingList({
  33. PageSize: this.pageSize,
  34. CurrentIndex: this.page_no,
  35. });
  36. if (res.Ret === 200) {
  37. this.status = res.Data.Paging.IsEnd ? "nomore" : "loadmore";
  38. this.collectList = this.page_no == 1 ? res.Data.List || [] : this.collectList.concat(res.Data.List);
  39. }
  40. },
  41. // 查看资源包
  42. lookDetails(item) {
  43. uni.navigateTo({
  44. url: "/reportPages/morningDetails/morningDetails?id=" + item.Id,
  45. });
  46. },
  47. },
  48. onLoad() {
  49. this.getDataList();
  50. },
  51. // 上滑触底触发分页
  52. onReachBottom() {
  53. if (this.status === "nomore") return;
  54. this.page_no++;
  55. this.status = "loading";
  56. this.getDataList();
  57. },
  58. };
  59. </script>
  60. <style scoped lang="scss">
  61. .morning-all-content {
  62. background: #f7f7f7;
  63. padding: 35rpx;
  64. .content-ul {
  65. padding: 20rpx 30rpx;
  66. background-color: #fff;
  67. margin-bottom: 20rpx;
  68. border-radius: 4rpx;
  69. .title {
  70. font-weight: 500;
  71. font-size: 30rpx;
  72. line-height: 42rpx;
  73. color: #333333;
  74. padding-bottom: 16rpx;
  75. border-bottom: 2rpx dashed #ececec;
  76. }
  77. .body {
  78. padding: 20rpx 0;
  79. display: flex;
  80. align-items: center;
  81. font-weight: 400;
  82. font-size: 28rpx;
  83. line-height: 39rpx;
  84. color: #666666;
  85. }
  86. }
  87. }
  88. </style>