优化代码

dev
曾超新 5 years ago
parent 181b5df167
commit a426db02e6
  1. 6
      frontend/views/car/order-add.php

@ -360,7 +360,7 @@ use common\models\PriceT;
$.get('/car/bihu-carinfo?id=<?=$car_info->id?>',function(obj) { $.get('/car/bihu-carinfo?id=<?=$car_info->id?>',function(obj) {
console.log(obj); console.log(obj);
if(obj.code == 200) { if(obj.code == 200) {
if(obj.data.UserInfo) { if(obj.data && obj.data.UserInfo) {
if(obj.data.UserInfo.NextBusinessStartDate) { if(obj.data.UserInfo.NextBusinessStartDate) {
$('#insurer1_begin_date').val(obj.data.UserInfo.NextBusinessStartDate); $('#insurer1_begin_date').val(obj.data.UserInfo.NextBusinessStartDate);
} }
@ -374,7 +374,7 @@ use common\models\PriceT;
$('#seats').val(obj.data.UserInfo.SeatCount); $('#seats').val(obj.data.UserInfo.SeatCount);
} }
} }
if(obj.data.SaveQuote) { if(obj.data && obj.data.SaveQuote) {
if(obj.data.SaveQuote.BoLi) { if(obj.data.SaveQuote.BoLi) {
if(obj.data.SaveQuote.BoLi == '0') $('#types_6').val(''); if(obj.data.SaveQuote.BoLi == '0') $('#types_6').val('');
if(obj.data.SaveQuote.BoLi == '1') $('#types_6').val('国产'); if(obj.data.SaveQuote.BoLi == '1') $('#types_6').val('国产');
@ -465,7 +465,7 @@ use common\models\PriceT;
else $('#types_9').val('否'); else $('#types_9').val('否');
} }
} }
if(obj.data.VehicleItems && obj.data.VehicleItems[0]) { if(obj.data && obj.data.VehicleItems && obj.data.VehicleItems[0]) {
if(obj.data.VehicleItems[0].VehicleNo) { if(obj.data.VehicleItems[0].VehicleNo) {
$('#auto_mold_code').val(obj.data.VehicleItems[0].VehicleNo); $('#auto_mold_code').val(obj.data.VehicleItems[0].VehicleNo);
} }

Loading…
Cancel
Save