cailist.vue 5.5 KB

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