car.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view>
  3. <view class="car-box">
  4. <uni-swiper-dot :info="datalist" :current="current" field="content" mode="default" :dots-styles="dotsStyles">
  5. <swiper class="swiper-box" @change="change">
  6. <swiper-item v-for="(item ,index) in datalist"
  7. :key="item.id"
  8. @click="$utils.navigateTo('ucenter/car_show',{plate: item.plate})">
  9. <view class="swiper-item">
  10. <view class="top">
  11. <view>{{item.plate || '-'}}</view>
  12. <view><image src="../../static/icon-car.png"></image></view>
  13. </view>
  14. <view class="bottom">
  15. <view class="carpic"><image src="../../static/car.jpg"></image></view>
  16. <view class="list">
  17. <view>车型:</view><view>{{item.vehModel || '-'}}</view>
  18. </view>
  19. <view class="list">
  20. <view>VIN码:</view><view>{{item.vin || '-'}}</view>
  21. </view>
  22. <view class="list">
  23. <view>累计行驶里程:</view><view>{{item.totalMileage || '-'}}km</view>
  24. </view>
  25. <view class="list">
  26. <view>累计换电次数:</view><view>{{item.totalExchangeCnt || '-'}}次</view>
  27. </view>
  28. <view class="list">
  29. <view>累计换电量:</view><view>{{item.totalExchangePower || '-'}}(kW/h)</view>
  30. </view>
  31. </view>
  32. </view>
  33. </swiper-item>
  34. </swiper>
  35. </uni-swiper-dot>
  36. </view>
  37. <tab-bar></tab-bar>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. datalist: [],
  45. current: 0,
  46. dotsStyles:{
  47. backgroundColor: 'rgba(88, 190, 107,0.6)',
  48. selectedBackgroundColor: 'rgba(88, 190, 107,0.9)',
  49. }
  50. }
  51. },
  52. mounted() {
  53. this.getexchangeHistoryCar()
  54. },
  55. methods: {
  56. change(e) {
  57. this.current = e.detail.current;
  58. },
  59. getexchangeHistoryCar(){
  60. this.$http.exchangeHistoryCar().then(rs=>{
  61. if(rs.code === 0){
  62. this.datalist=rs.data
  63. }else{
  64. this.$utils.msg(rs.msg)
  65. }
  66. })
  67. .catch(error=>{
  68. this.$utils.msg(error);
  69. });
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .car-box{
  76. padding: 0 30rpx;
  77. .swiper-box{
  78. width: 100%;
  79. display: flex;
  80. background-color:#fff;
  81. border-radius: 20rpx;
  82. border-top-right-radius: 40rpx;
  83. min-height: 1050rpx;
  84. margin-top: 15rpx;
  85. .swiper-item{
  86. display: flex;
  87. flex-direction: column;
  88. .top{
  89. display: flex;
  90. padding-left: 50rpx;
  91. justify-content: space-between;
  92. view:first-child{
  93. padding-top: 40rpx;
  94. font-size: 30rpx;
  95. font-weight: bold;
  96. }
  97. image{
  98. width: 110rpx;
  99. height: 98rpx;
  100. }
  101. }
  102. .bottom{
  103. padding:0 30rpx;
  104. display: flex;
  105. flex-direction: column;
  106. .carpic{
  107. text-align: center;
  108. margin-bottom: 30rpx;
  109. }
  110. image{
  111. width: 630rpx;
  112. height: 480rpx;
  113. border-radius:28rpx;
  114. }
  115. .list{
  116. width: 100%;
  117. padding: 0 30rpx;
  118. box-sizing: border-box;
  119. display: flex;
  120. height: 80rpx;
  121. justify-content: space-between;
  122. font-size: 30rpx;
  123. view:first-child{
  124. color: #86909c;
  125. }
  126. view:last-child{
  127. color: #1d2129;
  128. }
  129. }
  130. }
  131. }
  132. }
  133. }
  134. </style>