Browse Source

修改 添加未上牌情况

liguorui 6 years ago
parent
commit
731e64dc59

+ 8 - 3
pages/cardetail/cardetail.js

@@ -128,12 +128,17 @@ Page(Object.assign({
     get(pathmap.cardetail,{id:this.data.id},function(json){
       if(json.statusCode==200){
         var detail = json.data;
-        var time = detail.first_plate_at.split('-');
+        if(detail.first_plate_at){
+          var time = detail.first_plate_at.split('-');
+          detail.first_plate_atn = time[0]+"/"+time[1]+"首次上牌";
+          detail.first_plate_atname = time[0]+"年"+parseInt(time[1])+"月";
+        }else{
+          detail.first_plate_atn = "未上牌";
+          detail.first_plate_atname = "未上牌";
+        }
         /*数据结构处理*/
         detail.imgs = detail.imgs&&detail.imgs.split(",");
         detail.imgslength = detail.imgs.length;
-        detail.first_plate_at = time[0]+"/"+time[1];
-        detail.first_plate_atname = time[0]+"年"+parseInt(time[1])+"月";
         detail.check_info.forEach(function(item){
           item.passn = 0;
           item.unpassn = 0;

+ 1 - 1
pages/cardetail/cardetail.wxml

@@ -107,7 +107,7 @@
 		<view class="cardetail_baseinfo_c">
 			<view class="cardetail_baseinfo_i">
 				<view class="cardetail_baseinfo_v">{{detail.distance_at}}</view>
-				<view class="cardetail_baseinfo_n">{{detail.first_plate_at}}首次上牌</view>
+				<view class="cardetail_baseinfo_n">{{detail.first_plate_atn}}</view>
 			</view>
 			<view class="cardetail_baseinfo_i">
 				<view class="cardetail_baseinfo_v">{{detail.mileage}}万公里</view>

+ 1 - 1
pages/index/goodcar.wxml

@@ -22,7 +22,7 @@
             <block wx:for="{{item.labels}}" wx:for-item="good" wx:key="{{index}}">
               <view class="goodcar_item_label">{{good}}</view>
             </block>
-            {{item.title}}
+            <view class="goodcar_item_t">{{item.title}}</view>
           </view>
         </swiper-item>
       </block>

+ 6 - 3
pages/index/index.wxss

@@ -102,15 +102,15 @@
 }
 .goodcar_item{
   height: 49rpx;
-  line-height: 49rpx;
+  line-height: 25rpx;
   font-size: 24rpx;
   vertical-align: middle;
   display: flex;
   align-items: center;
   font-family: PingFangSC-Light,NotoSansHans-Light;
+  display: flex;
 }
 .goodcar_item_label{
-  display: inline-block;
   padding: 0rpx 5rpx;
   line-height: 22rpx;
   height: 22rpx;
@@ -119,7 +119,10 @@
   color: rgba(56, 55, 53, 1);
   font-size: 16rpx;
   text-align: center;
-  margin-right: 10rpx;
+  margin-right: 14rpx;
+}
+.goodcar_item_t{
+  flex: 1;
 }
 .prevent_move{
   position: absolute;