morningAll.vue 2.3 KB

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