selectLock.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view>
  3. <u-navbar title="选择地锁" title-color="#101010"></u-navbar>
  4. <view class="top">
  5. <view class="search">
  6. <view class="searchBox">
  7. <u-search shape="square" placeholder="使用停车场名称/地锁编号搜索" maxlength="12" v-model="testName" :show-action="false"
  8. :animation="true"></u-search>
  9. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="body2">
  14. <view class="item" v-for="(item,i) in list" :key="i"
  15. @click="returnName( item)">
  16. <view class="v">
  17. <view class="v1" >
  18. 荆鹏停车场<span class="y">|</span>{{item.lockNo}}
  19. </view>
  20. <view class="v2" >
  21. 地锁名称:{{item.name}}
  22. </view>
  23. <view class="v2" v-if="item.locationAddress" >
  24. 地锁地址:{{item.locationAddress}}
  25. </view>
  26. </view>
  27. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  28. </view>
  29. </view>
  30. <u-divider color="#B6BDC3" :isnone="list.length==0">已经到底了</u-divider>
  31. </view>
  32. </template>
  33. <script>
  34. import * as API from '@/apis/pagejs/pagesTask.js'
  35. export default {
  36. data() {
  37. return {
  38. list: [],
  39. testName: "",
  40. queryName: "",
  41. type: 1,
  42. };
  43. },
  44. onLoad(op) {
  45. if (op.type) {
  46. this.type = op.type
  47. }
  48. this.getList()
  49. },
  50. methods: {
  51. getList() {
  52. uni.showLoading({
  53. title: "加载中",
  54. mask: true,
  55. })
  56. var obj = {
  57. name: this.testName
  58. }
  59. if (this.type == 3) {
  60. obj.buildMode = 2
  61. }
  62. API.findFloorLock(obj).then((res) => {
  63. this.queryName = this.testName
  64. var list = res.data.floorlockInfoList
  65. if (list == null) {
  66. list = []
  67. }
  68. this.list = list
  69. uni.hideLoading();
  70. }).catch(error => {
  71. uni.hideLoading();
  72. uni.showToast({
  73. title: error,
  74. icon: "none"
  75. })
  76. })
  77. },
  78. returnName( obj) {
  79. const eventChannel = this.getOpenerEventChannel();
  80. eventChannel.emit('acceptDataFromOpenerPage', {
  81. item: obj
  82. })
  83. uni.navigateBack()
  84. },
  85. testBtn() {
  86. this.list = []
  87. //this.listForm.pageIndex=1
  88. this.getList()
  89. },
  90. getInfo() {
  91. }
  92. }
  93. }
  94. </script>
  95. <style>
  96. page {
  97. background-color: rgba(242, 244, 246, 1);
  98. }
  99. </style>
  100. <style lang="scss" scoped>
  101. ::v-deep .u-content {
  102. width: 380% !important;
  103. }
  104. .search {
  105. padding: 16rpx 32rpx;
  106. background: #fff;
  107. .searchBox {
  108. display: flex;
  109. align-items: center;
  110. background: #F2F2F2;
  111. padding: 1px 16rpx;
  112. border-radius: 8px;
  113. justify-content: space-between;
  114. }
  115. }
  116. .body2 {
  117. .item:not(:last-child) {
  118. border-bottom: 1px solid rgba(232, 232, 232, 1);
  119. }
  120. .item {
  121. padding: 24rpx 32rpx;
  122. background: #fff;
  123. display: flex;
  124. justify-content: space-between;
  125. .vquery {
  126. display: flex;
  127. align-items: center;
  128. }
  129. .buildMode {
  130. font-size: 24rpx;
  131. border: 1px solid #bbbbbb;
  132. border-radius: 4px;
  133. color: #1677ff;
  134. padding: 2rpx 8rpx;
  135. margin: 0 8rpx;
  136. }
  137. .buildMode1 {
  138. color: #1677ff;
  139. border: 1px solid #1677ff;
  140. }
  141. .buildMode2 {
  142. color: #4CAF50;
  143. border: 1px solid #4CAF50;
  144. }
  145. .qName {
  146. color: #FF5100
  147. }
  148. .v1 {
  149. color: rgba(16, 16, 16, 1);
  150. font-size: 32rpx;
  151. }
  152. .y{
  153. margin: 0 8rpx;
  154. color:rgba(119, 119, 119, 1);
  155. }
  156. .v2 {
  157. color: rgba(119, 119, 119, 1);
  158. font-size: 24rpx;
  159. }
  160. }
  161. }
  162. </style>