From 149742b163174a831bdbce7a31c57c4fc7f8165b Mon Sep 17 00:00:00 2001 From: wangshiming Date: Fri, 18 Feb 2022 10:55:34 +0800 Subject: [PATCH] fix bug --- .../release-publish.component.html | 14 +++--- .../release-publish.component.ts | 45 +++++++++++++++---- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.html b/src/app/routes/supply-management/components/release-publish/release-publish.component.html index 70a8d08c..fe83ba11 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.html +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.html @@ -223,21 +223,21 @@
服务信息
-
+
-
+
- 购买货运险 + 购买货运险
- 推荐投保,填写货值自动估保费,司机接单后不可退保。详见《投保告知》 + 推荐投保,填写货值自动估保费,司机接单后不可退保。详见《投保告知》
-
+
@@ -246,12 +246,12 @@ [nzMin]="50000" [nzMax]="3000000" [nzStep]="0.01" - (ngModelChange)="i.setValue($event)" + (ngModelChange)="i.setValue($event);goodsValuesChange($event)" nzPlaceHolder="请输入50000-3000000之间数值" >
- +
{ - this.totalDistance = res.distance; - this.totalTime = res.time; + // 计算里程,时间 + if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { + this.totalDistance = res.distance; + this.totalTime = res.time; + }); + } + } + goodsValuesChange(value: any) { + console.log(value); + console.log(this.totalDistance); + + if(value >= 50000 && this.totalDistance > 0){ + const params = { + goodsValue: value, + insuranceType: this.sf55.value.insuranceType, + km: this.totalDistance + }; + this.service + .request(this.service.$api_getWholeInsuranceInfo, params) + .subscribe(res => { + if (res) { + this.sf5.setValue('/insurancePremium',res.insurancePremium); + }else{ + this.sf5.setValue('/insurancePremium',null); + } }); } }