list.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. noticeList({
  37. page: this.page
  38. }).then((res) => {
  39. if (res.code === 1) {
  40. this.list = [...this.list, ...res.data.items];
  41. this.total = res.data.total;
  42. }
  43. })
  44. },
  45. scrolltolower() {
  46. if (this.list.length < this.total) {
  47. this.page += 1;
  48. this.getList();
  49. }
  50. },
  51. toDet(item) {
  52. uni.navigateTo({
  53. url: '/pages-my/notice/info?id=' + item.id
  54. })
  55. },
  56. },
  57. }
  58. </script>
  59. <style scoped lang="scss">
  60. .notice-list {
  61. .card-box {
  62. width: 100%;
  63. min-height: 224rpx;
  64. background: #FFFFFF;
  65. border-radius: 16rpx;
  66. }
  67. image {
  68. width: 32rpx;
  69. height: 32rpx;
  70. }
  71. }
  72. </style>