p-i-vehicle.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="top_item item_1">
  5. <view class="name">地面总车辆数</view>
  6. <view class="num">{{groundCarCount}}辆</view>
  7. </view>
  8. <view class="top_item item_2">
  9. <view class="name">井下总车辆数</view>
  10. <view class="num">{{pitCarCount}}辆</view>
  11. </view>
  12. </view>
  13. <view class="list">
  14. <view class="item" v-for="item in carList" :key="item.CarID">
  15. <view class="box_1">
  16. <view class="left">
  17. <view class="icon">
  18. <image src="./icon/vehicle.png" mode=""></image>
  19. </view>
  20. <view class="name">{{item.CarUserNo}}</view>
  21. </view>
  22. <view class="right">
  23. <view class="icon"></view>
  24. <view class="speed">{{item.InterzoneNo}}km/h</view>
  25. <view class="icon_right">
  26. <uni-icons type="arrowright"></uni-icons>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="box_2">
  31. <view class="icon"></view>
  32. <view class="name">{{item.InterzoneName}}</view>
  33. </view>
  34. <view class="box_3">
  35. <view class="text">车辆型号:{{item.CarModel}}</view>
  36. <view class="text">设备类型:{{item.DeviceType}}</view>
  37. <view class="text">车辆类型:{{item.CarType}}</view>
  38. <view class="text">平均速度:{{item.AvgSpeed}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="phone_btn">
  43. <view class="icon"></view>
  44. <view class="text">一键叫车</view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. carList:[],
  53. // 地面总车辆
  54. groundCarCount:'',
  55. // 井下总车辆
  56. pitCarCount:''
  57. };
  58. },
  59. onLoad() {
  60. this.getCarList()
  61. },
  62. methods:{
  63. async getCarList(){
  64. const res = await this.$myRequest({
  65. url:"/car/list"
  66. })
  67. console.log(res.data.data.carList)
  68. this.carList = res.data.data.carList
  69. this.groundCarCount = res.data.data.groundCarCount
  70. this.pitCarCount = res.data.data.pitCarCount
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. page{
  77. background-color: #f3f3f3;
  78. }
  79. .top{
  80. margin-top: 20rpx;
  81. display: flex;
  82. justify-content: space-around;
  83. .top_item{
  84. box-sizing: border-box;
  85. padding: 25rpx 15rpx 0;
  86. width: 334rpx;
  87. height: 143rpx;
  88. background: #E67E22;
  89. border-radius: 21rpx;
  90. text-align: center;
  91. font-size: 33rpx;
  92. font-family: PingFangSC-Medium, PingFang SC;
  93. font-weight: 500;
  94. color: #FFFFFF;
  95. line-height: 47rpx;
  96. }
  97. .item_2{
  98. background: #27AE60;
  99. }
  100. }
  101. .list{
  102. margin-top: 20rpx;
  103. .item{
  104. margin: 0 auto;
  105. margin-bottom: 20rpx;
  106. width: 720rpx;
  107. background: #FFFFFF;
  108. border-radius: 15rpx;
  109. box-sizing: border-box;
  110. padding: 15rpx 22rpx;
  111. .box_1{
  112. display: flex;
  113. justify-content: space-between;
  114. height: 78rpx;
  115. .left{
  116. height: 78rpx;
  117. display: flex;
  118. align-items: center;
  119. .icon{
  120. width: 78rpx;
  121. height: 78rpx;
  122. image{
  123. width: 78rpx;
  124. height: 78rpx;
  125. }
  126. }
  127. .name{
  128. margin-left: 18rpx;
  129. font-size: 33rpx;
  130. font-family: PingFangSC-Medium, PingFang SC;
  131. font-weight: 500;
  132. color: #232627;
  133. line-height: 78rpx;
  134. }
  135. }
  136. .right{
  137. height: 78rpx;
  138. display: flex;
  139. align-items: center;
  140. .icon{
  141. width: 47rpx;
  142. height: 47rpx;
  143. background-image: url(icon/speed.png);
  144. background-size: cover;
  145. background-repeat: no-repeat;
  146. }
  147. .speed{
  148. margin-left: 10rpx;
  149. font-size: 33rpx;
  150. font-family: PingFangSC-Semibold, PingFang SC;
  151. font-weight: 600;
  152. color: #2ECC71;
  153. }
  154. .icon_right{
  155. margin-left: 28rpx;
  156. }
  157. }
  158. }
  159. .box_2{
  160. margin: 0 auto;
  161. margin-top: 30rpx;
  162. width: 670rpx;
  163. height: 77rpx;
  164. background: #009FE8;
  165. border-radius: 37rpx;
  166. display: flex;
  167. align-items: center;
  168. box-sizing: border-box;
  169. padding-left: 21rpx;
  170. .icon{
  171. width: 47rpx;
  172. height: 47rpx;
  173. background-image: url(icon/position.png);
  174. background-size: cover;
  175. background-repeat: no-repeat;
  176. }
  177. .name{
  178. margin-left: 18rpx;
  179. font-size: 29rpx;
  180. font-family: PingFangSC-Regular, PingFang SC;
  181. font-weight: 400;
  182. color: #FFFFFF;
  183. }
  184. }
  185. .box_3{
  186. margin-top: 25rpx;
  187. display: flex;
  188. flex-wrap: wrap;
  189. .text{
  190. margin-bottom: 24rpx;
  191. width: 338rpx;
  192. font-size: 29rpx;
  193. font-family: PingFangSC-Regular, PingFang SC;
  194. font-weight: 400;
  195. color: #6C6F74;
  196. line-height: 42rpx;
  197. }
  198. }
  199. }
  200. }
  201. .phone_btn{
  202. position: fixed;
  203. left: 250rpx;
  204. bottom: 60rpx;
  205. width: 250rpx;
  206. height: 77rpx;
  207. background: #2ECC71;
  208. border-radius: 47rpx;
  209. display: flex;
  210. justify-content: center;
  211. align-items: center;
  212. .icon{
  213. width: 37rpx;
  214. height: 43rpx;
  215. background-image: url(icon/phone.png);
  216. background-size: cover;
  217. background-repeat: no-repeat;
  218. }
  219. .text{
  220. margin-left: 18rpx;
  221. font-size: 33rpx;
  222. font-family: PingFangSC-Medium, PingFang SC;
  223. font-weight: 500;
  224. color: #FFFFFF;
  225. }
  226. }
  227. </style>