cailist.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <view class="box">
  3. <view class="carlistBox">
  4. <view class="line" v-for="(item,index) in carList" @click="itemClick(item)">
  5. <view class="lineCont">
  6. <view>
  7. <image :src="item.brandLogo" mode="widthFix" class="brandLogo"></image>
  8. </view>
  9. <view style="padding-left: 29rpx;">
  10. <view class="carName">
  11. <span>{{item.brand}} {{item.series}}</span>
  12. <view class="plateNumber">{{item.plateNumber}}</view>
  13. </view>
  14. <view class="carMS">{{item.carModel}}</view>
  15. </view>
  16. </view>
  17. <view class="lineBottom">
  18. <view class="lineDel" @click.stop="editCar(item.id)">编辑</view>
  19. <view class="lineDel" @click.stop="maintain(item.id)">保养信息</view>
  20. <!-- <view class="Default" v-show="item.isDefault!=1" @click.stop="defaultCar(item)">设为默认</view>
  21. <view class="DefaultYES" v-show="item.isDefault==1">已设为默认</view> -->
  22. </view>
  23. <view class="DefaultIcon" v-show="item.isDefault==1">默认</view>
  24. </view>
  25. </view>
  26. <view v-if="carList==''&&loding" class="nodataBox">
  27. <image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png" mode="widthFix" class="nodataImg"></image>
  28. <view class="noTxt">暂无数据</view>
  29. </view>
  30. <view class="bottomView">
  31. <view class="saveCar" @click="addBtn">
  32. <!-- <image src="../../../static/img/icon_tianjiacheliang.png" mode=""
  33. style="width: 44rpx; height: 36rpx; margin-right: 10rpx;"></image> -->
  34. <view>添加爱车</view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. carList: '',
  44. loding: false,
  45. type: '',
  46. carId: '',
  47. fromMe: false,
  48. }
  49. },
  50. onLoad(opt) {
  51. this.$common.isUserId()
  52. this.type = opt.type;
  53. // console.log(this.type)
  54. this.fromMe = opt.fromMe
  55. },
  56. onShow() {
  57. this.getqueryMyBMemberCar();
  58. this.carId = uni.getStorageSync("maintainCarData").id
  59. },
  60. methods: {
  61. maintain(){
  62. },
  63. getqueryMyBMemberCar() {
  64. uni.showLoading({
  65. title: '加载中'
  66. })
  67. this.loding = false;
  68. this.$http('opencarOwnerHome/queryCarInfoList', {
  69. }, 'GET').then(res => {
  70. uni.hideLoading();
  71. this.carList = res.data;
  72. this.loding = true;
  73. })
  74. },
  75. addBtn() {
  76. uni.navigateTo({
  77. url: 'addCar'
  78. })
  79. },
  80. editCar(id) {
  81. uni.navigateTo({
  82. url: 'addCar?id=' + id + '&isEditCar=true'
  83. })
  84. },
  85. itemClick(item){
  86. this.$store.commit('mutationscarInfo', item)
  87. uni.navigateBack({
  88. delta: 1
  89. })
  90. },
  91. }
  92. }
  93. </script>
  94. <style scoped>
  95. .box {
  96. min-height: 100vh;
  97. background: #F4F5F7;
  98. }
  99. .nodataImg {
  100. width: 400rpx;
  101. padding-top: 100rpx;
  102. }
  103. .noTxt {
  104. font-size: 36rpx;
  105. color: #999999;
  106. padding-top: 50rpx;
  107. }
  108. .nodataBox {
  109. text-align: center;
  110. }
  111. .bottomView {
  112. background-color: #FFFFFF;
  113. width: 100%;
  114. height: 120rpx;
  115. position: fixed;
  116. bottom: 0rpx;
  117. padding-bottom: constant(safe-area-inset-bottom);
  118. padding-bottom: env(safe-area-inset-bottom);
  119. }
  120. .saveCar {
  121. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  122. margin: 23rpx 30rpx;
  123. height: 74rpx;
  124. border-radius: 37rpx;
  125. color: #FFFFFF;
  126. font-size: 30rpx;
  127. font-weight: bold;
  128. align-items: center;
  129. display: flex;
  130. justify-content: center;
  131. }
  132. .carlistBox {
  133. padding-bottom: 120rpx;
  134. }
  135. .carlistBox {
  136. padding: 24rpx;
  137. padding-bottom: 120rpx;
  138. }
  139. .brandLogo {
  140. width: 63rpx;
  141. height: 63rpx;
  142. }
  143. .line {
  144. background: #FFFFFF;
  145. padding: 27rpx 20rpx;
  146. border-radius: 10rpx;
  147. margin-bottom: 20rpx;
  148. position: relative;
  149. }
  150. .lineCont {
  151. display: flex;
  152. }
  153. .carName {
  154. color: #3C3C3C;
  155. font-size: 30rpx;
  156. display: flex;
  157. }
  158. .plateNumber {
  159. border-radius: 4px;
  160. border: 1px solid #F19D01;
  161. height: 32rpx;
  162. line-height: 32rpx;
  163. padding: 0 10rpx;
  164. color: #F19D01;
  165. font-size: 22rpx;
  166. margin-left: 20rpx;
  167. margin-top: 5rpx;
  168. }
  169. .carMS {
  170. color: #666666;
  171. font-size: 26rpx;
  172. padding-top: 5px;
  173. }
  174. .lineBottom {
  175. display: flex;
  176. justify-content: flex-end;
  177. padding-top: 20rpx;
  178. }
  179. .lineDel {
  180. /* width: 94rpx; */
  181. height: 50rpx;
  182. border-radius: 25rpx;
  183. border: 1px solid #DDDDDD;
  184. text-align: center;
  185. line-height: 50rpx;
  186. font-size: 26rpx;
  187. color: #3C3C3C;
  188. margin-right: 29rpx;
  189. padding: 0 20rpx;
  190. }
  191. .Default {
  192. width: 148rpx;
  193. height: 50rpx;
  194. border-radius: 25rpx;
  195. border: 1px solid #FF4F00;
  196. line-height: 50rpx;
  197. text-align: center;
  198. color: #FF4F00;
  199. font-size: 26rpx;
  200. }
  201. .DefaultYES {
  202. width: 148rpx;
  203. height: 50rpx;
  204. border-radius: 25rpx;
  205. border: 1px solid #DDDDDD;
  206. line-height: 50rpx;
  207. text-align: center;
  208. color: #999999;
  209. font-size: 26rpx;
  210. }
  211. .DefaultIcon {
  212. position: absolute;
  213. top: 0;
  214. right: 0;
  215. width: 109rpx;
  216. height: 40rpx;
  217. background: linear-gradient(131deg, #FFA72C 0%, #FF450F 100%);
  218. border-radius: 0px 10rpx 0px 10rpx;
  219. text-align: center;
  220. line-height: 40rpx;
  221. color: #FFFFFF;
  222. font-size: 22rpx;
  223. }
  224. </style>