selectStation.vue 3.6 KB

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