cailist.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <view class="box">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'我的车库'" :cj="3"></homenav>
  4. <view class="carlistBox" style="display: none;">
  5. <view class="line" v-for="(item,index) in carList" @click="itemClick(item)">
  6. <view class="lineCont">
  7. <view>
  8. <image :src="item.brandLogo" v-if="item.brandLogo" mode="widthFix" class="brandLogo"></image>
  9. <img src="../../../static/timg/nocar.png" alt="" class="brandLogo" v-else>
  10. </view>
  11. <view style="padding-left: 29rpx;">
  12. <view class="carName">
  13. <span>{{item.plateNumber}}</span>
  14. <view class="plateNumber" v-if="item.milage">{{item.milage}}km</view>
  15. <view class="nextCare" v-if="item.nextReturnDate||item.nextCareMilage">
  16. <image class="carByIcon" src="../../../static/timg/car2.png" mode=""></image>
  17. <span class="nextCareTitle">下次保养</span>
  18. <span class="nextCaretxt" v-if="item.nextReturnDate">{{item.nextReturnDate}}天后</span>
  19. <span class="nextCaretxt" v-if="item.nextReturnDate&&item.nextCareMilage">或</span>
  20. <span class="nextCaretxt" v-if="item.nextCareMilage&&item.nextCareMilage>-1">{{item.nextCareMilage}}km</span>
  21. </view>
  22. </view>
  23. <!-- <view class="carMS">{{item.carModel?item.carModel:''}}</view> -->
  24. <view class="carMS">{{item.brand?item.brand:''}} {{item.series?item.series:''}}</view>
  25. </view>
  26. </view>
  27. <view class="lineBottom">
  28. <!-- <view class="lineDel" @click.stop="editCar(item.id)">编辑</view> -->
  29. <view class="lineDel" v-if="openMCar.showType==1" @click.stop="maintain(item)">保养信息</view>
  30. <!-- <view class="Default" v-show="item.isDefault!=1" @click.stop="defaultCar(item)">设为默认</view>
  31. <view class="DefaultYES" v-show="item.isDefault==1">已设为默认</view> -->
  32. </view>
  33. <view class="DefaultIcon" v-show="item.isDefault==1">默认</view>
  34. </view>
  35. </view>
  36. <view class="carlistBox">
  37. <view class="line" v-for="(item,index) in carList" @click="itemClick(item)">
  38. <view class="lineTop">
  39. <view class="lineplateNumber">{{item.plateNumber}}</view>
  40. <view class="lineSx1"></view>
  41. <view class="linekk">
  42. <view class="linekkrow" v-if="item.nextCareMilage" style="color: #333333;">{{item.nextCareMilage}}km</view>
  43. <view class="linekkrow" v-else>-</view>
  44. <view class="linekkrow">建议下次</view>
  45. <view class="linekkrow" >保养里程</view>
  46. </view>
  47. <view class="lineSx"></view>
  48. <view class="linekk">
  49. <view class="linekkrow" v-if="item.nextCareDate" style="color: #333333;">{{item.nextCareDate.slice(0,10)}}</view>
  50. <view class="linekkrow" v-else>-</view>
  51. <view class="linekkrow">建议下次</view>
  52. <view class="linekkrow" >保养日期</view>
  53. </view>
  54. </view>
  55. <view class="lineBottom">
  56. <view class="lineDel" @click.stop="editCar(item.id)">编辑</view>
  57. <view class="lineDel" @click.stop="maintain(item)">保养信息</view>
  58. </view>
  59. <view class="DefaultIcon2" v-show="item.isDefault==1">默认</view>
  60. </view>
  61. </view>
  62. <view v-if="carList==''&&loding" class="nodataBox">
  63. <image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png" mode="widthFix" class="nodataImg"></image>
  64. <view class="noTxt">暂无数据</view>
  65. </view>
  66. <view class="bottomView">
  67. <view class="saveCar" :style="{background:'#'+themeColor}" @click="addBtn">
  68. <view>添加爱车</view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import homenav from "@/components/homenav/nav.vue"
  75. export default {
  76. components: {
  77. homenav
  78. },
  79. data() {
  80. return {
  81. carList: '',
  82. loding: false,
  83. type: '',
  84. carId: '',
  85. fromMe: false,
  86. themeColor:'',
  87. iStatusBarHeight:'',
  88. openMCar:'',
  89. }
  90. },
  91. onLoad(opt) {
  92. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  93. this.$common.isUserId()
  94. this.type = opt.type;
  95. // console.log(this.type)
  96. this.fromMe = opt.fromMe
  97. this.themeColor = uni.getStorageSync("themeColor");
  98. this.openMCar=uni.getStorageSync("openMCar");
  99. },
  100. onShow() {
  101. this.getqueryMyBMemberCar();
  102. this.carId = uni.getStorageSync("maintainCarData").id
  103. },
  104. methods: {
  105. maintain(item){
  106. uni.navigateTo({
  107. url:'../../index/handbook?mileage='+item.milage+'&liyangId='+item.nLevelID
  108. })
  109. },
  110. getqueryMyBMemberCar() {
  111. uni.showLoading({
  112. title: '加载中'
  113. })
  114. this.loding = false;
  115. this.$http('opencarOwnerHome/queryCarInfoList', {
  116. }, 'GET').then(res => {
  117. uni.hideLoading();
  118. this.carList = res.data;
  119. this.loding = true;
  120. })
  121. },
  122. addBtn() {
  123. uni.navigateTo({
  124. url: 'addCar'
  125. })
  126. },
  127. editCar(id) {
  128. uni.navigateTo({
  129. url: 'addCar?id=' + id + '&isEditCar=true'
  130. })
  131. },
  132. itemClick(item){
  133. if(this.type!=3){
  134. this.$store.commit('mutationscarInfo', item)
  135. uni.navigateBack({
  136. delta: 1
  137. })
  138. }
  139. },
  140. },
  141. // 下拉刷新
  142. onPullDownRefresh() {
  143. // this.page = 1
  144. this.getqueryMyBMemberCar()
  145. setTimeout(function() {
  146. uni.stopPullDownRefresh();
  147. }, 1000);
  148. },
  149. }
  150. </script>
  151. <style scoped>
  152. .lineTop{
  153. display: flex;justify-content: space-between;
  154. color: #3C3C3C;
  155. font-size: 30rpx;
  156. }
  157. .linekk{
  158. text-align: center;
  159. color: #999999;
  160. font-size: 22rpx;
  161. line-height: 36rpx;
  162. width: 32%;
  163. }
  164. .lineSx1{
  165. width: 2rpx;height: 60rpx;
  166. background: #DDDDDD;margin-top: 24rpx;
  167. }
  168. .lineSx{
  169. width: 2rpx;height: 80rpx;
  170. background: #DDDDDD;margin-top: 14rpx;
  171. }
  172. .lineplateNumber{
  173. font-weight: 600;
  174. display: flex;
  175. align-items: center;
  176. width: 32%;
  177. justify-content: center;
  178. }
  179. .carByIcon{
  180. width: 34rpx;height: 34rpx;
  181. }
  182. .nextCaretxt{
  183. color: #FF0000;
  184. }
  185. .nextCare{
  186. font-size: 20rpx;
  187. line-height: 36rpx;
  188. display: flex;
  189. padding-left: 6rpx;
  190. }
  191. .box {
  192. min-height: 100vh;
  193. background: #F4F5F7;
  194. padding-bottom: 120rpx;
  195. }
  196. .nodataImg {
  197. width: 400rpx;
  198. padding-top: 100rpx;
  199. }
  200. .noTxt {
  201. font-size: 36rpx;
  202. color: #999999;
  203. padding-top: 50rpx;
  204. }
  205. .nodataBox {
  206. text-align: center;
  207. }
  208. .bottomView {
  209. background-color: #FFFFFF;
  210. width: 100%;
  211. height: 120rpx;
  212. position: fixed;
  213. bottom: 0rpx;
  214. padding-bottom: constant(safe-area-inset-bottom);
  215. padding-bottom: env(safe-area-inset-bottom);
  216. }
  217. .saveCar {
  218. background: #D53533;
  219. margin: 23rpx 30rpx;
  220. height: 74rpx;
  221. border-radius: 37rpx;
  222. color: #FFFFFF;
  223. font-size: 30rpx;
  224. font-weight: bold;
  225. align-items: center;
  226. display: flex;
  227. justify-content: center;
  228. }
  229. .carlistBox {
  230. padding-bottom: 120rpx;
  231. }
  232. .carlistBox {
  233. padding: 24rpx;
  234. padding-bottom: 120rpx;
  235. }
  236. .brandLogo {
  237. width: 63rpx;
  238. height: 63rpx;
  239. }
  240. .line {
  241. background: #FFFFFF;
  242. padding: 20rpx 20rpx;
  243. border-radius: 10rpx;
  244. margin-bottom: 20rpx;
  245. position: relative;
  246. }
  247. .lineCont {
  248. display: flex;
  249. }
  250. .carName {
  251. color: #3C3C3C;
  252. font-size: 30rpx;
  253. display: flex;
  254. }
  255. .plateNumber {
  256. border-radius: 4px;
  257. border: 1px solid #F19D01;
  258. height: 32rpx;
  259. line-height: 32rpx;
  260. padding: 0 10rpx;
  261. color: #F19D01;
  262. font-size: 22rpx;
  263. margin-left: 20rpx;
  264. margin-top: 5rpx;
  265. }
  266. .carMS {
  267. color: #666666;
  268. font-size: 26rpx;
  269. padding-top: 5px;
  270. }
  271. .lineBottom {
  272. display: flex;
  273. justify-content: flex-end;
  274. padding-top: 30rpx;
  275. }
  276. .lineDel {
  277. /* width: 94rpx; */
  278. height: 50rpx;
  279. border-radius: 25rpx;
  280. border: 1px solid #DDDDDD;
  281. text-align: center;
  282. line-height: 50rpx;
  283. font-size: 26rpx;
  284. color: #3C3C3C;
  285. margin-left: 29rpx;
  286. padding: 0 20rpx;
  287. }
  288. .Default {
  289. width: 148rpx;
  290. height: 50rpx;
  291. border-radius: 25rpx;
  292. border: 1px solid #FF4F00;
  293. line-height: 50rpx;
  294. text-align: center;
  295. color: #FF4F00;
  296. font-size: 26rpx;
  297. }
  298. .DefaultYES {
  299. width: 148rpx;
  300. height: 50rpx;
  301. border-radius: 25rpx;
  302. border: 1px solid #DDDDDD;
  303. line-height: 50rpx;
  304. text-align: center;
  305. color: #999999;
  306. font-size: 26rpx;
  307. }
  308. .DefaultIcon {
  309. position: absolute;
  310. top: 0;
  311. right: 0;
  312. width: 109rpx;
  313. height: 40rpx;
  314. background: linear-gradient(131deg, #FFA72C 0%, #FF450F 100%);
  315. border-radius: 0px 10rpx 0px 10rpx;
  316. text-align: center;
  317. line-height: 40rpx;
  318. color: #FFFFFF;
  319. font-size: 22rpx;
  320. }
  321. .DefaultIcon2{
  322. position: absolute;
  323. top: 0;
  324. left: 0;
  325. width: 109rpx;
  326. height: 40rpx;
  327. background: linear-gradient(131deg, #FFA72C 0%, #FF450F 100%);
  328. border-radius: 10px 0rpx 10px 0rpx;
  329. text-align: center;
  330. line-height: 40rpx;
  331. color: #FFFFFF;
  332. font-size: 22rpx;
  333. }
  334. </style>