cailist.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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)">保养信息</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(item){
  62. uni.navigateTo({
  63. url:'../../index/handbook?mileage='+item.milage+'&liyangId='+item.nLevelID
  64. })
  65. },
  66. getqueryMyBMemberCar() {
  67. uni.showLoading({
  68. title: '加载中'
  69. })
  70. this.loding = false;
  71. this.$http('opencarOwnerHome/queryCarInfoList', {
  72. }, 'GET').then(res => {
  73. uni.hideLoading();
  74. this.carList = res.data;
  75. this.loding = true;
  76. })
  77. },
  78. addBtn() {
  79. uni.navigateTo({
  80. url: 'addCar'
  81. })
  82. },
  83. editCar(id) {
  84. uni.navigateTo({
  85. url: 'addCar?id=' + id + '&isEditCar=true'
  86. })
  87. },
  88. itemClick(item){
  89. this.$store.commit('mutationscarInfo', item)
  90. uni.navigateBack({
  91. delta: 1
  92. })
  93. },
  94. }
  95. }
  96. </script>
  97. <style scoped>
  98. .box {
  99. min-height: 100vh;
  100. background: #F4F5F7;
  101. }
  102. .nodataImg {
  103. width: 400rpx;
  104. padding-top: 100rpx;
  105. }
  106. .noTxt {
  107. font-size: 36rpx;
  108. color: #999999;
  109. padding-top: 50rpx;
  110. }
  111. .nodataBox {
  112. text-align: center;
  113. }
  114. .bottomView {
  115. background-color: #FFFFFF;
  116. width: 100%;
  117. height: 120rpx;
  118. position: fixed;
  119. bottom: 0rpx;
  120. padding-bottom: constant(safe-area-inset-bottom);
  121. padding-bottom: env(safe-area-inset-bottom);
  122. }
  123. .saveCar {
  124. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  125. margin: 23rpx 30rpx;
  126. height: 74rpx;
  127. border-radius: 37rpx;
  128. color: #FFFFFF;
  129. font-size: 30rpx;
  130. font-weight: bold;
  131. align-items: center;
  132. display: flex;
  133. justify-content: center;
  134. }
  135. .carlistBox {
  136. padding-bottom: 120rpx;
  137. }
  138. .carlistBox {
  139. padding: 24rpx;
  140. padding-bottom: 120rpx;
  141. }
  142. .brandLogo {
  143. width: 63rpx;
  144. height: 63rpx;
  145. }
  146. .line {
  147. background: #FFFFFF;
  148. padding: 27rpx 20rpx;
  149. border-radius: 10rpx;
  150. margin-bottom: 20rpx;
  151. position: relative;
  152. }
  153. .lineCont {
  154. display: flex;
  155. }
  156. .carName {
  157. color: #3C3C3C;
  158. font-size: 30rpx;
  159. display: flex;
  160. }
  161. .plateNumber {
  162. border-radius: 4px;
  163. border: 1px solid #F19D01;
  164. height: 32rpx;
  165. line-height: 32rpx;
  166. padding: 0 10rpx;
  167. color: #F19D01;
  168. font-size: 22rpx;
  169. margin-left: 20rpx;
  170. margin-top: 5rpx;
  171. }
  172. .carMS {
  173. color: #666666;
  174. font-size: 26rpx;
  175. padding-top: 5px;
  176. }
  177. .lineBottom {
  178. display: flex;
  179. justify-content: flex-end;
  180. padding-top: 20rpx;
  181. }
  182. .lineDel {
  183. /* width: 94rpx; */
  184. height: 50rpx;
  185. border-radius: 25rpx;
  186. border: 1px solid #DDDDDD;
  187. text-align: center;
  188. line-height: 50rpx;
  189. font-size: 26rpx;
  190. color: #3C3C3C;
  191. margin-right: 29rpx;
  192. padding: 0 20rpx;
  193. }
  194. .Default {
  195. width: 148rpx;
  196. height: 50rpx;
  197. border-radius: 25rpx;
  198. border: 1px solid #FF4F00;
  199. line-height: 50rpx;
  200. text-align: center;
  201. color: #FF4F00;
  202. font-size: 26rpx;
  203. }
  204. .DefaultYES {
  205. width: 148rpx;
  206. height: 50rpx;
  207. border-radius: 25rpx;
  208. border: 1px solid #DDDDDD;
  209. line-height: 50rpx;
  210. text-align: center;
  211. color: #999999;
  212. font-size: 26rpx;
  213. }
  214. .DefaultIcon {
  215. position: absolute;
  216. top: 0;
  217. right: 0;
  218. width: 109rpx;
  219. height: 40rpx;
  220. background: linear-gradient(131deg, #FFA72C 0%, #FF450F 100%);
  221. border-radius: 0px 10rpx 0px 10rpx;
  222. text-align: center;
  223. line-height: 40rpx;
  224. color: #FFFFFF;
  225. font-size: 22rpx;
  226. }
  227. </style>