myCar.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!-- 我的汽车 -->
  2. <template>
  3. <view class="">
  4. <view class="item" v-for="(item,index) in data" :key="index">
  5. <view class="content">
  6. <view class="left">
  7. <image src="../../static/car_icon_automobile@2x.png" style="width: 50rpx;height: 40rpx;" v-if="item.status==1"></image>
  8. <image src="../../static/car_icon_%20bicycle@2x.png" style="width: 50rpx;height: 40rpx;" v-if="item.status==2"></image>
  9. <view class="num">{{item.number}}</view>
  10. </view>
  11. <view class="right" @tap="seeMore(index)">
  12. <view class="tong">通行记录</view>
  13. <image src="../../static/icon_combo_nor@2x.png" style="width: 20rpx;height: 12rpx;margin-top: 15rpx;" v-show="!item.show"></image>
  14. <image src="../../static/icon_combo_set@2x.png" style="width: 20rpx;height: 12rpx;margin-top: 15rpx;" v-show="item.show"></image>
  15. </view>
  16. </view>
  17. <view class="more" v-show="item.show">
  18. <view class="list" v-for="(list,index) in item.moreInfo" :key="index">
  19. <view class="listText">
  20. {{list.title}}
  21. </view>
  22. <view class="date">
  23. {{list.date}}
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 绑定新的车辆 -->
  29. <view class="btn" @tap="addCar">
  30. 绑定新的车辆
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. isShow: false,
  39. data: [{
  40. status: 1,
  41. number: "鲁Q 6666",
  42. show: false,
  43. moreInfo: [{
  44. title: '通过花园小区东门',
  45. date: '2020-01-02 12:25'
  46. },
  47. {
  48. title: '通过花园小区东门',
  49. date: '2020-01-02 12:25'
  50. },]
  51. }, {
  52. status: 2,
  53. show: false,
  54. number: "鲁Q 888",
  55. moreInfo: [{
  56. title: '通过花园小区东门',
  57. date: '2020-01-02 12:25'
  58. }, ]
  59. }, ]
  60. }
  61. },
  62. methods: {
  63. // 查看或隐藏记录
  64. seeMore(index) {
  65. this.data[index].show=!this.data[index].show
  66. },
  67. // 绑定新的车辆
  68. addCar() {
  69. uni.navigateTo({
  70. url: "addCar"
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style>
  77. .btn {
  78. width: 702rpx;
  79. height: 90rpx;
  80. background: rgba(41, 138, 253, 1);
  81. opacity: 1;
  82. border-radius: 18rpx;
  83. font-size: 32rpx;
  84. font-family: PingFang SC;
  85. font-weight: bold;
  86. color: rgba(255, 255, 255, 1);
  87. text-align: center;
  88. line-height: 90rpx;
  89. position: fixed;
  90. bottom: 56rpx;
  91. left: 26rpx;
  92. }
  93. .list {
  94. width: 100%;
  95. height: 36rpx;
  96. display: flex;
  97. justify-content: space-between;
  98. }
  99. .listText {
  100. height: 100%;
  101. font-size: 26rpx;
  102. font-family: PingFang SC;
  103. font-weight: 400;
  104. color: rgba(51, 51, 51, 1);
  105. }
  106. .date {
  107. width: 240rpx;
  108. height: 34rpx;
  109. font-size: 24rpx;
  110. font-family: PingFang SC;
  111. font-weight: 400;
  112. color: rgba(153, 153, 153, 1);
  113. text-align: right;
  114. }
  115. .right {
  116. width: 160rpx;
  117. height: 40rpx;
  118. display: flex;
  119. }
  120. .tong {
  121. font-size: 28rpx;
  122. font-family: PingFang SC;
  123. font-weight: 400;
  124. color: rgba(153, 153, 153, 1);
  125. margin-right: 25rpx;
  126. }
  127. .left {
  128. width: 210rpx;
  129. display: flex;
  130. }
  131. .num {
  132. width: 160rpx;
  133. height: 40rpx;
  134. font-size: 28rpx;
  135. font-family: PingFang SC;
  136. font-weight: bold;
  137. line-height: 40rpx;
  138. color: rgba(41, 138, 253, 1);
  139. margin-left: 14rpx;
  140. }
  141. .item {
  142. width: 702rpx;
  143. margin: 0 auto;
  144. margin-top: 40rpx;
  145. background: rgba(249, 252, 255, 1);
  146. opacity: 1;
  147. }
  148. .content {
  149. width: 620rpx;
  150. margin: 0 auto;
  151. padding-top: 26rpx;
  152. padding-bottom: 26rpx;
  153. display: flex;
  154. justify-content: space-between;
  155. }
  156. .more {
  157. width: 620rpx;
  158. margin: 0 auto;
  159. }
  160. </style>