car_show.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <view>
  3. <view class="picture"><image :src="item.vehDataVo.url"></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 || '-'}}</view>
  24. <view>前端电池距离cm</view>
  25. </view>
  26. <view>
  27. <view>{{item.vehDataVo.totalMileage || '-'}}</view>
  28. <view>里程km</view>
  29. </view>
  30. <view>
  31. <view>{{item.vehDataVo.totalExchangeCnt || '-'}}</view>
  32. <view>换电次数</view>
  33. </view>
  34. <view>
  35. <view>{{item.vehDataVo.totalExchangePower || '-'}}</view>
  36. <view>换电量kW/h</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-3)+'%'">{{item.vehStatusVo.soc}}%</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="battery-info">
  60. <view>
  61. <view>{{item.vehStatusVo.drivingMileage || '-'}}</view>
  62. <view>已行驶里程km</view>
  63. </view>
  64. <view>
  65. <view>{{item.vehStatusVo.remainderMileage || '-'}}</view>
  66. <view>预计剩余里程km</view>
  67. </view>
  68. <view>
  69. <view>{{item.vehStatusVo.voltage || '-'}}</view>
  70. <view>电压V</view>
  71. </view>
  72. <view>
  73. <view>{{item.vehStatusVo.current || '-'}}</view>
  74. <view>电流A</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 class="left">{{item.exchangeList.month || '-'}}</text><text class="right">月/{{item.exchangeList.year || '-'}}</text></view>
  85. <view class="money">
  86. <view class="Exchangelist"><view class="unit">换电量</view> <view class="value">{{item.exchangeList.exchangePower || '-'}}(kW/h)</view></view>
  87. <view class="Exchangelist"><view class="unit">换电费用</view> <view class="value">{{item.exchangeList.powerFee || '-'}}元</view></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. if(rs.code === 0){
  130. this.item=rs.data
  131. }else{
  132. this.$utils.msg(rs.msg);
  133. }
  134. })
  135. .catch(error=>{
  136. this.$utils.msg(error);
  137. });
  138. }
  139. }
  140. }
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. .picture{
  145. width: 750rpx;
  146. height: 570rpx;
  147. image{
  148. width: 100%;
  149. height: 100%;
  150. }
  151. }
  152. .car_info{
  153. width: 750rpx;
  154. min-height: 1000rpx;
  155. border-top-left-radius: 35rpx;
  156. border-top-right-radius: 35rpx;
  157. position: relative;
  158. top: -40rpx;
  159. background-color: #FBFDFF;
  160. padding: 0 30rpx;
  161. box-sizing: border-box;
  162. display: flex;
  163. flex-direction: column;
  164. .category{
  165. font-weight: bold;
  166. font-size: 32rpx;
  167. margin: 20rpx 0rpx;
  168. text-indent: 1em;
  169. }
  170. .show{
  171. width: 690rpx;
  172. height: 375rpx;
  173. background: #F2F4F7;
  174. box-shadow: 0rpx 0rpx 10rpx 0rpx #DAE1EC;
  175. border-radius: 24rpx;
  176. opacity: 1;
  177. padding: 32rpx 26rpx;
  178. box-sizing: border-box;
  179. display: flex;
  180. flex-direction:column;
  181. .plate-number{
  182. display: flex;
  183. margin-top: 12rpx;
  184. image{
  185. width: 26rpx;
  186. height: 26rpx;
  187. vertical-align: middle;
  188. }
  189. view:first-child{
  190. font-weight: 600;
  191. font-size: 36rpx;
  192. padding-right: 15rpx;
  193. }
  194. }
  195. .batter_vin{
  196. display: flex;
  197. justify-content: space-between;
  198. font-weight: bold;
  199. font-size: 26rpx;
  200. margin: 20rpx 0;
  201. .title{
  202. text-align: center;
  203. color: #86909c;
  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: 105rpx;
  213. font-size: 22rpx;
  214. }
  215. view:last-child{
  216. flex: 1;
  217. .strip {
  218. /* 父元素相对定位 */
  219. position: relative;
  220. width: 525rpx;
  221. height: 18rpx;
  222. background-color: #fff;
  223. top: 10rpx;
  224. }
  225. .blue {
  226. height: 18rpx;
  227. background-color: #ff7d00;
  228. font-size: 28rpx;
  229. }
  230. .protext{
  231. width:2rpx;
  232. height:32rpx;
  233. background: #86909c;
  234. /* 子元素绝对定位 */
  235. position: absolute;
  236. /* 定位方向:属性值 */
  237. top:-9rpx
  238. }
  239. .pronumber{
  240. font-size: 26rpx;
  241. font-weight: bold;
  242. position: absolute;
  243. /* 定位方向:属性值 */
  244. top:30rpx;
  245. }
  246. }
  247. }
  248. .battery-info{
  249. display: flex;
  250. justify-content: space-between;
  251. margin-top: 20rpx;
  252. text-align: center;
  253. line-height: 36rpx;
  254. view > view:first-child{
  255. font-weight: bold;
  256. }
  257. view > view:last-child{
  258. color: #939da7;
  259. font-size: 24rpx;
  260. margin-top: 3rpx;
  261. }
  262. }
  263. }
  264. .records{
  265. width: 690rpx;
  266. display: flex;
  267. flex-direction: column;
  268. .top{
  269. display: flex;
  270. flex-direction: row;
  271. padding: 0 5rpx;
  272. margin: 20rpx 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: 0rpx 30rpx;
  288. box-sizing: border-box;
  289. font-size: 30rpx;
  290. font-weight: bold;
  291. flex-direction: column;
  292. .money{
  293. display: flex;
  294. justify-content: space-between;
  295. line-height: 60rpx;
  296. .Exchangelist{
  297. display: flex;
  298. .unit{
  299. font-size: 24rpx;
  300. font-weight: 600;
  301. }
  302. .value{
  303. font-size: 30rpx;
  304. font-weight: 600;
  305. padding-left: 8rpx;
  306. }
  307. }
  308. }
  309. .left{
  310. font-size: 80rpx;
  311. }
  312. .right{
  313. color: #505968;
  314. }
  315. }
  316. .list{
  317. display: flex;
  318. background-color: #fff;
  319. width: 690rpx;
  320. border-bottom-left-radius: 35rpx;
  321. border-bottom-right-radius: 35rpx;
  322. margin-bottom: 100rpx;
  323. padding:0 35rpx;
  324. box-sizing: border-box;
  325. flex-direction: column;
  326. .info{
  327. width: 100%;
  328. margin: 30rpx 0rpx;
  329. }
  330. .norecord{
  331. text-align: center;
  332. color: #86909c;
  333. }
  334. .first{
  335. display: flex;
  336. justify-content: space-between;
  337. font-size: 30rpx;
  338. view:last-child{
  339. font-size: 32rpx;
  340. font-weight: bold;
  341. }
  342. }
  343. .second{
  344. color: #86909c;
  345. font-size: 28rpx;
  346. display: flex;
  347. justify-content: space-between;
  348. margin-top: 2rpx;
  349. }
  350. }
  351. }
  352. }
  353. </style>