index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="station_item"
  3. @click="handleNavStation(item)">
  4. <view class="station_item-title">
  5. <text class="font13">{{ item.stationName }}</text>
  6. </view>
  7. <view class="station_item-status">
  8. <text class="station_item-status-text">{{ item.stationStatus == 'Normal' ? '营业中' : '暂停营业' }}</text>
  9. </view>
  10. <view class="station_item-content">
  11. <view class="station_item-content-left">
  12. <view class="station_item-content-left-label">
  13. <view class="font12 station_item-content-left-label-left">
  14. <text class="station_item-content-left-label-left_idle">空闲</text>
  15. <text class="station_item-content-left-label-left_count">{{ item.parkingNum }}/{{ item.parkingNum }}</text>
  16. </view>
  17. <!-- <uv-tags size="small" class="station_item-content-left-label_tag" text="洗车机" plain shape="circle"></uv-tags>-->
  18. <!-- <view class="station_item-content-left-label_func">{{ ['清洁', '泡沫', '吸尘', '消毒', '充电']?.join(" | ") }}</view>-->
  19. </view>
  20. <view class="station_item-content-left-position">
  21. <uv-icon name="empty-address" size="20" color="#aaa"></uv-icon>
  22. <text>{{ item.address }}</text>
  23. </view>
  24. </view>
  25. <view class="station_item-content-right">
  26. <!-- <image
  27. style="width: 20px; height: 20px;color: #eeeeee;"
  28. src="/static/nav.png"
  29. />-->
  30. <uv-icon name="map" color="#19A497"></uv-icon>
  31. <text class="font12" @click.stop="handleNavMap(item)">{{ item.distance }}km</text>
  32. <!-- <uv-tags text="1222km" type="warning" plain size="mini"></uv-tags>-->
  33. </view>
  34. </view>
  35. <view class="station_item-distance">
  36. <uv-text type="primary" :text="item.parkingFee" size="12"></uv-text>
  37. </view>
  38. </view>
  39. </template>
  40. <script setup lang="ts" name="Station">
  41. const props = defineProps({
  42. item: {
  43. type: Object,
  44. }
  45. })
  46. const handleNavMap = (station:any) => {
  47. let location = JSON.parse(station.location)
  48. uni.openLocation({
  49. latitude: location.stationLat,
  50. longitude: location.stationLng,
  51. scale: 18,
  52. name: station.stationName,
  53. address: station.address,
  54. });
  55. }
  56. const handleNavStation = (station: any) => {
  57. getApp<any>().globalData.last.station = station
  58. uni.navigateTo({
  59. url: '/pages-wash/station/index?id='+station.id
  60. })
  61. console.log(station)
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. .station_item {
  66. display: flex;
  67. flex-direction: column;
  68. border-radius: 10rpx;
  69. margin-top: 20rpx;
  70. padding: 15rpx;
  71. background: #fafafa;
  72. position: relative;
  73. &-title {
  74. display: inline-flex;
  75. padding-left: 5px;
  76. }
  77. &-status {
  78. position: absolute;
  79. right: 6rpx;
  80. top: 0;
  81. &-text {
  82. background: $uni-color-primary;
  83. padding: 6rpx;
  84. color: white;
  85. font-size: 12px;
  86. border-radius: 20rpx 6rpx;
  87. }
  88. }
  89. &-content {
  90. display: flex;
  91. justify-content: space-between;
  92. width: 100%;
  93. &-left {
  94. flex: 1;
  95. display: flex;
  96. flex-direction: column;
  97. padding: 5rpx;
  98. &-label {
  99. padding: 4rpx 8rpx;
  100. display: inline-flex;
  101. margin-top: 8rpx;
  102. //justify-content: space-between;
  103. &-left {
  104. //border: 1px solid $uni-color-primary;
  105. border-radius: 4rpx;
  106. &_idle {
  107. background: $uni-color-primary;
  108. padding: 6rpx;
  109. color: white;
  110. border-radius: 4rpx;
  111. }
  112. &_count {
  113. //border-radius: 4rpx;
  114. margin-left: 10px;
  115. color: $uni-color-primary;
  116. font-size: 13px;
  117. }
  118. &_tag {
  119. width: 30rpx;
  120. }
  121. }
  122. &_func {
  123. padding-left: 50rpx;
  124. font-size: 24rpx;
  125. color: #aaa;
  126. }
  127. }
  128. &-position {
  129. display: inline-flex;
  130. font-size: 24rpx;
  131. margin-top: 8rpx;
  132. }
  133. }
  134. &-right {
  135. border-radius: 10rpx;
  136. background-color: #eee;
  137. //border: 1px solid $uni-color-primary;
  138. width: 120rpx;
  139. display: flex;
  140. flex-direction: column;
  141. justify-content: center;
  142. align-content: center;
  143. align-items: center;
  144. }
  145. }
  146. &-distance {
  147. font-size: 24rpx;
  148. padding-left: 5px;
  149. margin-top: 8rpx;
  150. }
  151. }
  152. </style>