tripHint.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="tripHint">
  3. <!-- 导航栏 -->
  4. <navigationBar title="出行提示">
  5. <template #operate>
  6. <view class="time">
  7. <u-icon name="clock" color="#2C2B30" size="38"></u-icon>
  8. </view>
  9. </template>
  10. </navigationBar>
  11. <view class="main">
  12. <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="lower">
  13. <view class="scroll-view-item" v-for="(v,i) in ListData" :key="i"
  14. @click="$goBack(2,'/pages/tripHint/tripHintDetails?id=' + v.id)">
  15. <view class="list titleList">
  16. <text class="name">{{v.roadName}}</text>
  17. <view class="btn">
  18. 纠错
  19. </view>
  20. </view>
  21. <view class="list">
  22. <text class="name">详细地址:</text>
  23. <text class="content">{{v.address}}</text>
  24. </view>
  25. <view class="list">
  26. <text class="name">预警提示:</text>
  27. <text class="content">{{v.warnHint}}</text>
  28. </view>
  29. <view class="list timeList">
  30. <text class="name">发布时间:</text>
  31. <text class="content">{{v.createTime}}</text>
  32. <u-icon name="map-fill" color="#2C2B30" size="35"></u-icon>
  33. </view>
  34. </view>
  35. <u-loadmore :status="status" v-if="total != 0" fontSize="30" iconSize="30" />
  36. </scroll-view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import {
  42. getTripData
  43. } from "@/api/list.js"
  44. export default {
  45. data() {
  46. return {
  47. // 竖向滚动条位置
  48. scrollTop: 0,
  49. old: {
  50. scrollTop: 0
  51. },
  52. // 查询参数
  53. queryParams: {
  54. sendType: 0,
  55. pageNum: 1,
  56. pageSize: 10,
  57. },
  58. // 列表数据
  59. ListData: [],
  60. // 总数
  61. total: 0,
  62. // 加载更多
  63. status: 'loadmore',
  64. };
  65. },
  66. onLoad() {
  67. this.getList()
  68. },
  69. methods: {
  70. // 触底事件
  71. lower(e) {
  72. if (this.ListData.length < this.total) {
  73. this.status = 'loading'
  74. this.queryParams.pageSize += 10
  75. this.getList()
  76. } else {
  77. this.status = 'nomore'
  78. }
  79. },
  80. // 获取列表数据
  81. async getList() {
  82. let res = await getTripData(this.queryParams)
  83. if (res.code == 200) {
  84. this.total = res.total
  85. this.ListData = res.rows
  86. this.status = 'loadmore'
  87. }
  88. }
  89. },
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .tripHint {
  94. height: 100%;
  95. .list {
  96. display: flex;
  97. padding: 8.42rpx 0;
  98. .name {
  99. font-weight: 600;
  100. width: 136.84rpx;
  101. flex: none;
  102. margin-right: 10.53rpx;
  103. }
  104. .content {
  105. color: #7F7F7F;
  106. }
  107. }
  108. .titleList {
  109. justify-content: space-between;
  110. .name {
  111. font-size: 33.68rpx;
  112. }
  113. .btn {
  114. width: 109.47rpx;
  115. height: 44.21rpx;
  116. line-height: 44.21rpx;
  117. background-color: #D7ECFF;
  118. border-radius: 105.26rpx;
  119. text-align: center;
  120. font-weight: 600;
  121. color: #041F34;
  122. }
  123. }
  124. .timeList {
  125. justify-content: space-between;
  126. .content {
  127. flex: 1;
  128. }
  129. }
  130. }
  131. </style>