selectLock.vue 3.9 KB

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