From 334a8bf58c849ecff1c6da65ca085630cf4bf63f Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 8 Mar 2022 19:10:50 +0800 Subject: [PATCH] fix bug --- .../release-publish/release-publish.component.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index 2c6dba1d..f79fdb26 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -1007,11 +1007,12 @@ export class SupplyManagementReleasePublishComponent implements OnInit { default: break; } - - if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { this.totalDistance = res.distance; this.totalTime = res.time; + this.getInsurersPrice(); // 计算保费金额 }); } } @@ -1077,6 +1078,14 @@ export class SupplyManagementReleasePublishComponent implements OnInit { default: break; } + // 计算里程,时间 + if (this.startInfo[0]?.detailedAddress && this.endInfo[0]?.detailedAddress) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + this.getInsurersPrice(); //计算保费金额 + }); + } } }); }