tour_info.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="main">
  3. <view class="tour_item" @click="toInfo(item.id)" v-for="(item,index) in list" :key="index">
  4. <view class="titleStyle">
  5. {{item.title}}
  6. </view>
  7. <view class="tour_time">
  8. 丹棱检察 {{$u.timeFormat(item.created_at, 'yyyy/mm/dd')}}
  9. </view>
  10. <view class="content_tour">
  11. {{item.desc}}
  12. </view>
  13. </view>
  14. <uni-load-more :loadingType="loadingType" :contentText="contentText" />
  15. </view>
  16. </template>
  17. <script>
  18. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  19. export default {
  20. components: {
  21. uniLoadMore
  22. },
  23. data() {
  24. return {
  25. loadingType: 0,
  26. contentText: {
  27. contentdown: '上拉显示更多',
  28. contentrefresh: '正在加载...',
  29. contentnomore: '没有更多数据了'
  30. },
  31. indexPage: 1,
  32. list: [],
  33. }
  34. },
  35. onLoad() {
  36. this.getTourList()
  37. },
  38. methods: {
  39. async getTourList() {
  40. let res = await this.$u.get("/home/notice", {
  41. page: this.indexPage,
  42. })
  43. this.list = this.list.concat(res.data)
  44. this.indexPage++
  45. if (res.current_page == res.last_page) {
  46. this.loadingType = 2;
  47. } else {
  48. this.loadingType = 0;
  49. }
  50. },
  51. toInfo(id) {
  52. uni.navigateTo({
  53. url: '../news/newsInfo?id=' + id + '&type=4'+'&title=丹棱公告'
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style>
  60. .main {
  61. min-height: 100vh;
  62. padding: 30rpx 28rpx;
  63. }
  64. .tour_item {
  65. margin-bottom: 20rpx;
  66. padding: 30rpx;
  67. background: #fff;
  68. border-radius: 10rpx;
  69. }
  70. .titleStyle {
  71. font-size: 34rpx;
  72. font-family: PingFang-SC-Bold, PingFang-SC;
  73. font-weight: bold;
  74. color: #333333;
  75. }
  76. .tour_time {
  77. margin-top: 30rpx;
  78. font-size: 24rpx;
  79. font-family: PingFang-SC-Bold, PingFang-SC;
  80. font-weight: 500;
  81. color: #999;
  82. }
  83. .content_tour {
  84. margin-top: 16rpx;
  85. font-size: 28rpx;
  86. font-family: PingFang-SC-Bold, PingFang-SC;
  87. font-weight: 500;
  88. color: #555;
  89. }
  90. </style>