list.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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" 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 {noticeList} from '@/api/notice.js';
  18. export default {
  19. data(){
  20. return{
  21. list:[],
  22. total:0,
  23. page:1,
  24. }
  25. },
  26. onShow() {
  27. this.page = 1;
  28. this.list = [];
  29. this.getList();
  30. },
  31. methods:{
  32. getList(){
  33. noticeList({page:this.page}).then((res)=>{
  34. if(res.code === 1){
  35. this.list = [...this.list,...res.data.items];
  36. this.total = res.data.total;
  37. }
  38. })
  39. },
  40. scrolltolower(){
  41. if(this.list.length < this.total){
  42. this.page += 1;
  43. this.getList();
  44. }
  45. },
  46. toDet(item){
  47. uni.navigateTo({
  48. url: '/pages-my/notice/info?id=' +item.id
  49. })
  50. },
  51. },
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .notice-list{
  56. .card-box{
  57. width: 100%;
  58. min-height: 224rpx;
  59. background: #FFFFFF;
  60. border-radius: 16rpx;
  61. }
  62. image{
  63. width: 32rpx;
  64. height: 32rpx;
  65. }
  66. }
  67. </style>