car_show.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view>
  3. <view class="picture"><image src="../../static/car.jpg"></image></view>
  4. <view class="car_info">
  5. <view class="category">车辆信息</view>
  6. <view class="show">
  7. <view>车牌号</view>
  8. <view class="plate-number">
  9. <view>{{item.vehDataVo.plate || '-'}}</view>
  10. </view>
  11. <view class="batter_vin">
  12. <view>
  13. <view>{{item.vehDataVo.vehModel || '-'}}</view>
  14. <view class="title">车型</view>
  15. </view>
  16. <view>
  17. <view>{{item.vehDataVo.vin || '-'}}</view>
  18. <view class="title">车辆VIN码</view>
  19. </view>
  20. </view>
  21. <view class="battery-info">
  22. <view>
  23. <view>{{item.vehDataVo.battDistance || '-'}}CM</view>
  24. <view>前端电池距离</view>
  25. </view>
  26. <view>
  27. <view>{{item.vehDataVo.totalMileage || '-'}}km</view>
  28. <view>累计里程</view>
  29. </view>
  30. <view>
  31. <view>{{item.vehDataVo.totalExchangeCnt || '-'}}次</view>
  32. <view>累计换电次数</view>
  33. </view>
  34. <view>
  35. <view>{{item.vehDataVo.totalExchangePower || '-'}}kW/h</view>
  36. <view>累计换电量</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="category">车辆状态</view>
  41. <view class="show">
  42. <view>电池编号</view>
  43. <view class="plate-number">
  44. <view>{{item.vehStatusVo.sn || '-'}}</view>
  45. </view>
  46. <view class="battery-soc">
  47. <view>电池SOC</view>
  48. <view>
  49. <view class="strip">
  50. <!-- 第二层进度条的颜色 -->
  51. <view class="blue" :style="'width:'+item.vehStatusVo.soc+'%'">
  52. <!-- (进度条显示的图片 样式:根据父元素进行相对定位 ,本身绝对定位 ) -->
  53. <text class="protext" :style="'left:'+item.vehStatusVo.soc+'%'"></text>
  54. <view class="pronumber" :style="'left:'+(item.vehStatusVo.soc-6)+'%'">{{item.vehStatusVo.soc}}%</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="battery-info">
  60. <view>
  61. <view>{{item.vehStatusVo.drivingMileage || '-'}}KM</view>
  62. <view>已行驶里程</view>
  63. </view>
  64. <view>
  65. <view>{{item.vehStatusVo.remainderMileage || '-'}}km</view>
  66. <view>预计剩余里程</view>
  67. </view>
  68. <view>
  69. <view>{{item.vehStatusVo.voltage || '-'}}V</view>
  70. <view>电压</view>
  71. </view>
  72. <view>
  73. <view>{{item.vehStatusVo.current || '-'}}A</view>
  74. <view>电流</view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="records">
  79. <view class="top">
  80. <view>车辆换电记录</view>
  81. <view><navigator :url="'record?plate='+item.vehDataVo.plate">更多</navigator></view>
  82. </view>
  83. <view class="title">
  84. <view><text>{{item.exchangeList.month || '-'}}</text>月/{{item.exchangeList.year || '-'}}</view>
  85. <view class="money">
  86. <view>换电量 {{item.exchangeList.exchangePower || '-'}}(kW/h)</view>
  87. <view>换电费用 {{item.exchangeList.powerFee || '-'}}元</view>
  88. </view>
  89. </view>
  90. <view class="list">
  91. <view class="info" v-for="(data ,index) in item.exchangeList.list"
  92. :key="data.id">
  93. <view class="first">
  94. <view>{{data.plate || '-'}}</view><view>¥{{data.powerFee || '-'}}</view>
  95. </view>
  96. <view class="second">
  97. <view>{{data.createTime || '-'}}</view><view>{{data.exchangePower || '-'}}(kW.h)</view>
  98. </view>
  99. </view>
  100. <view class="info norecord" v-if="!item.exchangeList.list">暂无记录</view>
  101. </view>
  102. </view>
  103. </view>
  104. <tab-bar></tab-bar>
  105. </view>
  106. </template>
  107. <script>
  108. export default {
  109. data() {
  110. return {
  111. plate:null,
  112. item:{},
  113. }
  114. },
  115. onLoad(option) {
  116. if(option.plate){
  117. this.plate=option.plate
  118. }else{
  119. this.$utils.msg('丢失车牌号参数')
  120. }
  121. },
  122. mounted() {
  123. this.getexchangeCarDetail()
  124. },
  125. methods: {
  126. getexchangeCarDetail(){
  127. if(this.plate){
  128. this.$http.exchangeCarDetail(this.plate).then(rs=>{
  129. console.log(rs.data)
  130. if(rs.code === 0){
  131. this.item=rs.data
  132. }else{
  133. this.$utils.msg(rs.msg);
  134. }
  135. })
  136. .catch(error=>{
  137. this.$utils.msg(error);
  138. });
  139. }
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .picture{
  146. width: 750rpx;
  147. height: 570rpx;
  148. image{
  149. width: 100%;
  150. height: 100%;
  151. }
  152. }
  153. .car_info{
  154. width: 750rpx;
  155. min-height: 1000rpx;
  156. border-top-left-radius: 35rpx;
  157. border-top-right-radius: 35rpx;
  158. position: relative;
  159. top: -40rpx;
  160. background-color: #f8f9fb;
  161. padding: 0 23rpx;
  162. box-sizing: border-box;
  163. display: flex;
  164. flex-direction: column;
  165. .category{
  166. font-weight: bold;
  167. font-size: 32rpx;
  168. margin: 28rpx 0rpx;
  169. text-indent: 1em;
  170. }
  171. .show{
  172. width: 704rpx;
  173. height: 375rpx;
  174. padding: 32rpx;
  175. box-sizing: border-box;
  176. background-image: url(~@/static/ibg.png);
  177. background-size: 100% 100%;
  178. display: flex;
  179. flex-direction:column;
  180. .plate-number{
  181. display: flex;
  182. margin-top: 12rpx;
  183. image{
  184. width: 26rpx;
  185. height: 26rpx;
  186. vertical-align: middle;
  187. }
  188. view:first-child{
  189. font-weight: 600;
  190. font-size: 32rpx;
  191. padding-right: 15rpx;
  192. }
  193. }
  194. .batter_vin{
  195. display: flex;
  196. justify-content: space-between;
  197. font-weight: bold;
  198. font-size: 32rpx;
  199. margin: 30rpx 0;
  200. .title{
  201. text-align: center;
  202. color: #86909c;
  203. font-size: 28rpx;
  204. font-weight: normal;
  205. }
  206. }
  207. .battery-soc{
  208. display: flex;
  209. margin-top: 30rpx;
  210. margin-bottom: 60rpx;
  211. view:first-child{
  212. width: 138rpx;
  213. }
  214. view:last-child{
  215. flex: 1;
  216. .strip {
  217. /* 父元素相对定位 */
  218. position: relative;
  219. width: 480rpx;
  220. height: 18rpx;
  221. background-color: #fff;
  222. top: 10rpx;
  223. }
  224. .blue {
  225. height: 18rpx;
  226. background-color: #ff7d00;
  227. font-size: 28rpx;
  228. }
  229. .protext{
  230. width:2rpx;
  231. height:32rpx;
  232. background: #86909c;
  233. /* 子元素绝对定位 */
  234. position: absolute;
  235. /* 定位方向:属性值 */
  236. top:-9rpx
  237. }
  238. .pronumber{
  239. font-size: 26rpx;
  240. font-weight: bold;
  241. position: absolute;
  242. /* 定位方向:属性值 */
  243. top:30rpx;
  244. }
  245. }
  246. }
  247. .battery-info{
  248. display: flex;
  249. justify-content: space-between;
  250. margin-top: 20rpx;
  251. text-align: center;
  252. line-height: 36rpx;
  253. view > view:first-child{
  254. font-weight: bold;
  255. }
  256. view > view:last-child{
  257. color: #939da7;
  258. font-size: 28rpx;
  259. margin-top: 8rpx;
  260. }
  261. }
  262. }
  263. .records{
  264. width: 690rpx;
  265. padding: 0 7rpx;
  266. display: flex;
  267. flex-direction: column;
  268. .top{
  269. display: flex;
  270. flex-direction: row;
  271. padding: 0 5rpx;
  272. margin: 28rpx 0rpx;
  273. justify-content: space-between;
  274. font-size: 32rpx;
  275. font-weight: bold;
  276. text-indent: 12rpx;
  277. navigator{
  278. color: #58be6b;
  279. }
  280. }
  281. .title{
  282. width: 690rpx;
  283. height: 184rpx;
  284. background-image:url('https://xcx.xnymzx.com/zkstation/bgr.png');
  285. background-size: 100% 100%;
  286. display: flex;
  287. padding: 20rpx 30rpx;
  288. box-sizing: border-box;
  289. font-size: 30rpx;
  290. font-weight: bold;
  291. flex-direction: column;
  292. justify-content: space-around;
  293. .money{
  294. display: flex;
  295. justify-content: space-between;
  296. }
  297. text{
  298. font-size: 45rpx;
  299. }
  300. }
  301. .list{
  302. display: flex;
  303. background-color: #fff;
  304. width: 690rpx;
  305. border-bottom-left-radius: 35rpx;
  306. border-bottom-right-radius: 35rpx;
  307. margin-bottom: 100rpx;
  308. padding:0 35rpx;
  309. box-sizing: border-box;
  310. flex-direction: column;
  311. .info{
  312. width: 100%;
  313. margin-top: 30rpx;
  314. margin-bottom: 20rpx;
  315. }
  316. .norecord{
  317. text-align: center;
  318. color: #86909c;
  319. }
  320. .first{
  321. display: flex;
  322. justify-content: space-between;
  323. font-size: 30rpx;
  324. view:last-child{
  325. font-size: 32rpx;
  326. font-weight: bold;
  327. }
  328. }
  329. .second{
  330. color: #86909c;
  331. font-size: 28rpx;
  332. display: flex;
  333. justify-content: space-between;
  334. margin-top: 2rpx;
  335. }
  336. }
  337. }
  338. }
  339. </style>