cailist.vue 5.6 KB

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