mycar_detail.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="container">
  3. <view class="introduce-section">
  4. <view v-for="(item, index) in carInfo" :key="index" class="guess-item">
  5. <view class="grid col-4 car-title">
  6. <view class="cu-tag radius line-green">{{item.carNo}}</view>
  7. <view class='cu-tag radius line-green'>{{item.driver}}</view>
  8. <view class='cu-tag radius line-green'>{{item.driverPhone}}</view>
  9. </view>
  10. <view class="grid col-3 grid-square flex-sub">
  11. <view class="bg-img" v-if="item.personNoImg != ''" @tap="ViewImage" :data-url="item.personNoImg">
  12. <image :src="item.personNoImg" mode="aspectFit"></image>
  13. </view>
  14. <view class="bg-img" v-if="item.personNoImg1 != ''" @tap="ViewImage" :data-url="item.personNoImg1">
  15. <image :src="item.personNoImg1" mode="aspectFit"></image>
  16. </view>
  17. <view class="bg-img" v-if="item.driverNoImg != ''" @tap="ViewImage" :data-url="item.driverNoImg">
  18. <image :src="item.driverNoImg" mode="aspectFit"></image>
  19. </view>
  20. </view>
  21. <view class="grid col-3 grid-square flex-sub">
  22. <view class="bg-img" v-if="item.carNoImg != ''" @tap="ViewImage" :data-url="item.carNoImg">
  23. <image :src="item.carNoImg" mode="aspectFit"></image>
  24. </view>
  25. <view class="bg-img" v-if="item.carNoImg1 != ''" @tap="ViewImage" :data-url="item.carNoImg1">
  26. <image :src="item.carNoImg1" mode="aspectFit"></image>
  27. </view>
  28. <view class="bg-img" v-if="item.driverNoImg1 != ''" @tap="ViewImage" :data-url="item.driverNoImg1">
  29. <image :src="item.driverNoImg1" mode="aspectFit"></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view v-show="isLoadMore">
  34. <uni-load-more :status="loadStatus"></uni-load-more>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. mapState
  42. } from 'vuex';
  43. export default {
  44. data() {
  45. return {
  46. carInfo:[]
  47. };
  48. },
  49. computed: {
  50. ...mapState(['hasLogin','userInfo'])
  51. },
  52. onShow() {
  53. },
  54. onLoad(options) {
  55. const that = this
  56. uni.showLoading({
  57. title: '正在加载',
  58. mask:true
  59. })
  60. that.$api.request('tran', 'getMyCarListByCarNo', {
  61. carNo: options.carNo
  62. }, failres => {
  63. if(failres.errmsg){
  64. uni.showToast({
  65. title: failres.errmsg,
  66. icon: 'none',
  67. duration: 2000
  68. })
  69. }
  70. else{
  71. uni.showToast({
  72. title: "系统异常,请联系管理员",
  73. icon: 'none',
  74. duration: 2000
  75. })
  76. }
  77. uni.hideLoading()
  78. }).then(res => {
  79. that.carInfo = res.data
  80. uni.hideLoading()
  81. })
  82. },
  83. methods: {
  84. ViewImage(e) {
  85. var img = [];
  86. img = e.currentTarget.dataset.url.split(' ')
  87. uni.previewImage({
  88. current:0,
  89. urls: img
  90. });
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang='scss'>
  96. .car-title{
  97. padding-top: 20rpx;
  98. padding-bottom: 20rpx;
  99. }
  100. /* 销售信息 */
  101. .introduce-section {
  102. background: #fff;
  103. padding: 20upx 30upx;
  104. padding-bottom: 100upx;
  105. .guess-item {
  106. padding-bottom: 20upx;
  107. border-bottom: 1px solid #ccc;
  108. }
  109. .title {
  110. font-size: 28upx;
  111. color: $font-color-dark;
  112. font-weight:bold;
  113. height: 50upx;
  114. line-height: 50upx;
  115. flex:2.5;
  116. }
  117. .title-tip {
  118. flex:1;
  119. }
  120. .price-box {
  121. display: flex;
  122. align-items: baseline;
  123. height: 70upx;
  124. padding: 10upx 0;
  125. font-size: 26upx;
  126. color: $uni-color-primary;
  127. }
  128. .price {
  129. font-size: $font-lg + 2upx;
  130. }
  131. .m-price {
  132. margin: 0 12upx;
  133. color: $font-color-light;
  134. text-decoration: line-through;
  135. }
  136. .coupon-tip {
  137. align-items: center;
  138. padding: 4upx 10upx;
  139. background: $uni-color-primary;
  140. font-size: $font-sm;
  141. color: #fff;
  142. border-radius: 6upx;
  143. line-height: 1;
  144. transform: translateY(-4upx);
  145. }
  146. .bot-row {
  147. display: flex;
  148. align-items: center;
  149. height: 50upx;
  150. font-size: $font-sm;
  151. color: $font-color-light;
  152. view {
  153. flex: 1;
  154. }
  155. }
  156. }
  157. </style>