car-card.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view >
  3. <view class="recommend-info" >
  4. <view class="goods-list">
  5. <view @click="showDetail(item)" class="list" v-for="(item,index) in list" :key="index">
  6. <view class="pictrue" >
  7. <image :src="item.outImgPath?item.outImgPath:'/static/index/noimg3.png'" mode="scaleToFill"></image>
  8. <view class="car">{{item.carNo}}</view>
  9. </view>
  10. <view class="content">
  11. <view class="">
  12. <text class="cuIcon-time margin-right-10"></text>
  13. <text>进:{{formatDate(item.enterTime)}}</text>
  14. </view>
  15. <view style="padding-top: 8rpx;">
  16. <text class="cuIcon-time margin-right-10"></text>
  17. <text>出:{{formatDate(item.outTime)}}</text>
  18. </view>
  19. <view class="flex justify-center" style="margin: 20rpx 0;">
  20. <view class="cu-btn line-blue round df" style="width: 70%;">
  21. 查看详情
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. props:{
  33. list: {
  34. type: Array,
  35. default: () => {
  36. return []
  37. }
  38. }
  39. },
  40. data() {
  41. return {
  42. }
  43. },
  44. computed:{
  45. formatDate(){
  46. return val=>{
  47. if (this.$isEmpty(val)) {
  48. return '未知'
  49. }
  50. return this.$u.timeFormat(new Date(val).getTime(), 'mm-dd hh:MM:ss')
  51. }
  52. },
  53. },
  54. methods: {
  55. showDetail(item){
  56. uni.navigateTo({
  57. url:"/pages/index/car/detail?id="+item.id
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. /* 为你推荐 */
  65. .recommend-info{
  66. width: 100%;
  67. .recommend-title{
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. width: 100%;
  72. height: 100rpx;
  73. .title{
  74. display: flex;
  75. align-items: center;
  76. image{
  77. width: 416rpx;
  78. height: 40rpx;
  79. }
  80. }
  81. }
  82. .goods-list{
  83. display: flex;
  84. flex-wrap: wrap;
  85. justify-content: space-between;
  86. padding: 0 30rpx;
  87. .list{
  88. width: 49%;
  89. height: 540rpx;
  90. margin-bottom: 20rpx;
  91. background-color: #FFFFFF;
  92. border-radius: 10rpx;
  93. overflow: hidden;
  94. .pictrue{
  95. width: 100%;
  96. position: relative;
  97. image{
  98. border-top-right-radius: 12rpx;
  99. border-top-left-radius: 12rpx;
  100. height: 330rpx;
  101. }
  102. .car{
  103. position: absolute;
  104. bottom: 20rpx;
  105. left: 10rpx;
  106. color: #FFFFFF;
  107. }
  108. }
  109. .content{
  110. padding: 20rpx;
  111. text{
  112. padding: 10rpx 0;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. </style>