list.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="notice-list iPhone-bottom flex-common-css box-border-box">
  3. <Nav title='搜索' bgckgroundBox='#fff'></Nav>
  4. <scroll-view scroll-y="true" class="scroll-view-css box-border-box p-24" @scrolltolower="scrolltolower">
  5. <view class="card-box box-border-box p-24 mb-20" v-for="(item,i) in list" :key="i" @click="toDet(item)">
  6. <view class="text-overflow-ellipsis fs-32 fw-600 mb-8">{{item.title}}</view>
  7. <view class="fs-24 fw-400 fc-9 p-b-20 b-b-F9F9F9 mb-24">{{item.created_date}}</view>
  8. <view class="flex-justify-space align-items-center">
  9. <view class="fs-28 fw-400 fc-9">查看详情</view>
  10. <image src="@/static/img/toRight.png" mode=""></image>
  11. </view>
  12. </view>
  13. </scroll-view>
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. noticeList
  19. } from '@/api/notice.js';
  20. export default {
  21. data() {
  22. return {
  23. list: [],
  24. total: 0,
  25. page: 1,
  26. }
  27. },
  28. onShow() {},
  29. mounted() {
  30. this.page = 1;
  31. this.list = [];
  32. this.getList();
  33. },
  34. methods: {
  35. getList() {
  36. let operate_id = uni.getStorageSync('operate_id');
  37. let school_id = uni.getStorageSync('school_id');
  38. noticeList({
  39. page: this.page,
  40. operate_id: operate_id,
  41. school_id: school_id
  42. }).then((res) => {
  43. if (res.code === 1) {
  44. this.list = [...this.list, ...res.data.items];
  45. this.total = res.data.total;
  46. }
  47. })
  48. },
  49. scrolltolower() {
  50. if (this.list.length < this.total) {
  51. this.page += 1;
  52. this.getList();
  53. }
  54. },
  55. toDet(item) {
  56. uni.navigateTo({
  57. url: '/pages-my/notice/info?id=' + item.id
  58. })
  59. },
  60. },
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .notice-list {
  65. .card-box {
  66. width: 100%;
  67. min-height: 224rpx;
  68. background: #FFFFFF;
  69. border-radius: 16rpx;
  70. }
  71. image {
  72. width: 32rpx;
  73. height: 32rpx;
  74. }
  75. }
  76. </style>