cailist.vue 5.7 KB

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