diff --git a/src/views/secondHandCar/carSource.vue b/src/views/secondHandCar/carSource.vue index 6286a8ef..b2e99857 100644 --- a/src/views/secondHandCar/carSource.vue +++ b/src/views/secondHandCar/carSource.vue @@ -212,7 +212,9 @@ export default { this.form.emissionStandard=res.data.emissionStandard?.code this.auditRemark=res.data?.auditRemark this.status=res.data?.status?.code - this.areaName=res.data?.areaName + const municipalities = ['北京市', '天津市', '上海市', '重庆市']; + const isMunicipality = municipalities.some(city => res.data.areaName.includes(city)); + this.areaName= isMunicipality ? res.data.areaName?.substring(0, 3) : res.data.areaName; this.supplierName=res.data?.supplierName this.supplierCode=res.data?.supplierCode if(res.data?.otherPhoto){ diff --git a/src/views/secondHandCar/forSale.vue b/src/views/secondHandCar/forSale.vue index b2ba705f..711c6902 100644 --- a/src/views/secondHandCar/forSale.vue +++ b/src/views/secondHandCar/forSale.vue @@ -130,11 +130,13 @@ export default { queryType:this.queryType , }) this.detailInfo=res?.data + const municipalities = ['北京市', '天津市', '上海市', '重庆市']; + const isMunicipality = municipalities.some(city => res.data.areaName.includes(city)); + this.detailInfo.areaName= isMunicipality ? res.data.areaName?.substring(0, 3) : res.data.areaName; if(res.data.otherPhoto){ this.imgSrcList=res.data.otherPhoto.split(',') || [] } this.imgSrcList.unshift(res?.data?.vehicleAnglePhoto) - // console.log("this.imgSrcList",this.imgSrcList) } }, destroyed() {