江西小程序管理端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
2.9 KiB

11 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="驾校场地"></topNavbar>
  4. <view class="pad">
  5. <view class="search_Box">
  6. <searchRow placeholder="搜索场地名称" @searchFn="searchFn"></searchRow>
  7. </view>
  8. <view class="ul">
  9. <view class="card" v-for="(item,index) in list" :key="index">
  10. <view class="name_row">
  11. <view class="icon">
  12. <image src="@/static/images/userCenter/siteIcon.png" mode=""></image>
  13. </view>
  14. <view class="name">{{item.name}}</view>
  15. </view>
  16. <view class="addres_row">
  17. <view class="icon">
  18. <image src="@/static/images/userCenter/adsIcon.png" mode=""></image>
  19. </view>
  20. <view class="ads">{{item.address}}</view>
  21. </view>
  22. <view class="status_row">
  23. 使用状态<text v-if="item.siteStatus==1">正常</text> <text v-if="item.siteStatus==0" class="orange">停用</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view style="padding-bottom: 20rpx;" v-if="list.length">
  29. <u-loadmore :status="status" />
  30. </view>
  31. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  32. </view>
  33. </template>
  34. <script>
  35. import { sitePage } from '@/config/api.js'
  36. export default {
  37. data() {
  38. return {
  39. list: [],
  40. params: {
  41. pageNo: 1,
  42. pageSize: 20
  43. },
  44. total: 20,
  45. status: 'loading'
  46. }
  47. },
  48. onLoad() {
  49. this.sitePageFn()
  50. },
  51. onPullDownRefresh() {
  52. this.list = []
  53. this.params.pageNo = 1
  54. this.sitePageFn().then(()=>{uni.stopPullDownRefresh()})
  55. },
  56. onReachBottom() {
  57. if(this.total>this.list.length) {
  58. this.sitePageFn()
  59. }
  60. },
  61. methods: {
  62. async sitePageFn() {
  63. const {data: res} = await sitePage(this.params)
  64. this.params.pageNo ++
  65. this.list.push(...res.list)
  66. this.total = res.total
  67. if(this.list.length>=this.total) {
  68. this.status = 'nomore'
  69. }else {
  70. this.status = 'loading'
  71. }
  72. console.log(res)
  73. },
  74. searchFn(val) {
  75. console.log(val)
  76. this.params.name = val
  77. this.list = []
  78. this.params.pageNo = 1
  79. this.sitePageFn()
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .pageBgImg {
  86. .search_Box {
  87. margin-bottom: 20rpx;
  88. searchrow {
  89. }
  90. }
  91. .ul {
  92. width: 100%;
  93. .card {
  94. padding: 28rpx 30rpx;
  95. margin-bottom: 20rpx;
  96. .name_row {
  97. display: flex;
  98. align-items: center;
  99. .icon {
  100. width: 30rpx;
  101. height: 32rpx;
  102. }
  103. .name {
  104. font-size: 32rpx;
  105. font-weight: 600;
  106. color: #333333;
  107. margin-left: 10rpx;
  108. }
  109. }
  110. .addres_row {
  111. padding: 16rpx 0 36rpx 0;
  112. display: flex;
  113. align-items: center;
  114. .icon {
  115. width: 30rpx;
  116. height: 32rpx;
  117. }
  118. .ads {
  119. font-size: 24rpx;
  120. color: #333333;
  121. margin-left: 10rpx;
  122. }
  123. }
  124. .status_row {
  125. font-size: 24rpx;
  126. color: #686B73;
  127. text {
  128. color: #1989FA;
  129. &.orange {
  130. color: #FF6A2A;
  131. }
  132. }
  133. }
  134. }
  135. }
  136. }
  137. </style>