stationMy.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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"
  8. :show-action="false" :animation="true"></u-search>
  9. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="list">
  14. <view class="item" v-for="(item,index) in list" :key="index">
  15. <view class="v1">
  16. {{item.stationNo}}<span class="y">|</span>{{item.name}}
  17. </view>
  18. <view class="v2" v-if="item.stationAddress">
  19. {{item.stationAddress}}
  20. </view>
  21. </view>
  22. </view>
  23. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  24. <view class="floating-button">
  25. <view class="button " @click="gotoTask">
  26. 关联场站
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import * as API from '@/apis/pagejs/pagesTeam.js'
  33. export default {
  34. data() {
  35. return {
  36. list: [],
  37. listForm: {
  38. pageIndex: 1,
  39. pageSize: 20,
  40. recordsTotal: 1,
  41. status: 0,
  42. roleName: "XJ,XJADMIN",
  43. roleName: "XJ",
  44. },
  45. id: "",
  46. testName: "",
  47. queryName: "",
  48. };
  49. },
  50. onLoad(op) {
  51. this.id = op.id
  52. this.getList()
  53. },
  54. onShow() {
  55. },
  56. onReachBottom() {
  57. if (this.list.length < this.listForm.recordsTotal) {
  58. this.myLoadmore();
  59. }
  60. },
  61. methods: {
  62. gotoTask(){
  63. uni.navigateTo({
  64. url: '/pages/team/stationAdd?id='+this.id,
  65. events: {
  66. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  67. acceptDataFromOpenerPage: (data)=>{
  68. console.log(data)
  69. this.getList(1)
  70. },
  71. }
  72. })
  73. },
  74. myLoadmore() {
  75. this.listForm.pageIndex += 1;
  76. this.getList()
  77. },
  78. showqueryName(item) {
  79. if (this.queryName) {
  80. var name = item.name
  81. return name.indexOf(this.queryName) != -1
  82. } else {
  83. return true
  84. }
  85. },
  86. testBtn() {
  87. this.queryName = this.testName
  88. this.getList(1)
  89. },
  90. getList(bl) {
  91. if (bl) {
  92. this.listForm.pageIndex = 1
  93. }
  94. uni.showLoading({
  95. title: "加载中",
  96. mask: true,
  97. })
  98. this.listForm.id = this.id
  99. this.listForm.queryContent=this.queryName
  100. API.teamUserStation(this.listForm).then((res) => {
  101. var list = this.list
  102. if (this.listForm.pageIndex == 1) {
  103. list = res.data.data;
  104. } else {
  105. list = [
  106. ...list,
  107. ...res.data.data
  108. ];
  109. }
  110. this.list =list
  111. this.listForm.recordsTotal=res.data.recordsTotal
  112. uni.hideLoading();
  113. }).catch(error => {
  114. uni.hideLoading();
  115. uni.showToast({
  116. title: error,
  117. icon: "none"
  118. })
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .list {
  126. padding-top: 20rpx;
  127. padding-bottom: 120rpx;
  128. .item:not(:last-child) {
  129. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  130. }
  131. .item {
  132. padding: 24rpx 32rpx;
  133. background: #fff;
  134. display: flex;
  135. flex-direction: column;
  136. .vquery {
  137. display: flex;
  138. align-items: center;
  139. }
  140. .buildMode {
  141. font-size: 24rpx;
  142. border: 2rpx solid #bbbbbb;
  143. border-radius: 8rpx;
  144. color: #1677ff;
  145. padding: 2rpx 8rpx;
  146. margin: 0 8rpx;
  147. }
  148. .buildMode1 {
  149. color: #1677ff;
  150. border: 2rpx solid #1677ff;
  151. }
  152. .buildMode2 {
  153. color: #4CAF50;
  154. border: 2rpx solid #4CAF50;
  155. }
  156. .qName {
  157. color: #FF5100
  158. }
  159. .v1 {
  160. color: rgba(16, 16, 16, 1);
  161. font-size: 32rpx;
  162. }
  163. .y {
  164. margin: 0 8rpx;
  165. color: rgba(119, 119, 119, 1);
  166. }
  167. .v2 {
  168. color: rgba(119, 119, 119, 1);
  169. font-size: 24rpx;
  170. }
  171. }
  172. }
  173. .top {
  174. border-bottom: 2rpx solid #e8e8e8;
  175. }
  176. .search {
  177. padding: 16rpx 32rpx;
  178. background: #fff;
  179. .searchBox {
  180. display: flex;
  181. align-items: center;
  182. background: #F2F2F2;
  183. padding: 2rpx 16rpx;
  184. border-radius: 16rpx;
  185. justify-content: space-between;
  186. }
  187. }
  188. .floating-button {
  189. z-index: 999;
  190. position: fixed;
  191. bottom: 0;
  192. width: 100%;
  193. display: flex;
  194. height: 120rpx;
  195. justify-content: space-around;
  196. background-color: rgba(255, 255, 255, 1);
  197. .button {
  198. margin-top: 24rpx;
  199. border-radius: 50px;
  200. height: 80rpx;
  201. width: 80%;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. padding: 12rpx;
  206. background-color: rgba(22, 119, 255, 1);
  207. color: rgba(255, 255, 255, 1);
  208. font-size: 32rpx;
  209. }
  210. }
  211. </style>