Commit 9710854874f80246a0955afd74f103bfa0e5980d

Authored by lxf
1 parent 39ce2372

fix: 下单时,优化数字小数点回退问题

pages/order/add.vue
... ... @@ -468,9 +468,9 @@ export default {
468 468 // this.form.prepaidAmount = res.result.prepaidAmount || prepaidAmount;
469 469 // this.form.oilAmount = res.result.oilAmount || oilAmount;
470 470 if (this.autoComputedArrival) {
471   - this.form.deliveryAmount = res.result.deliveryAmount || deliveryAmount;
  471 + this.form.deliveryAmount = res.result.deliveryAmount || '0';
472 472 } else {
473   - this.form.balancePaymentAmount = res.result.balancePaymentAmount || balancePaymentAmount;
  473 + this.form.balancePaymentAmount = res.result.balancePaymentAmount || '0';
474 474 }
475 475 this.form.oilPayRebateRate = res.result.oilPayRebateRate || '';
476 476 this.form.driverSecurityServiceAmount = res.result.driverSecurityServiceAmount || '';
... ...
pages/order/change-fee.vue
... ... @@ -206,6 +206,7 @@ export default {
206 206 prepaidAmount: prePay.amount,
207 207 deliveryAmount: arrivalPay.amount,
208 208 balancePaymentAmount: finalPay.amount || 0,
  209 + securityServiceAmount: this.item.securityServiceAmount || '',
209 210 };
210 211 },
211 212 computedService() {
... ... @@ -227,11 +228,14 @@ export default {
227 228 };
228 229 uni.$u.api.freightOrder.getServiceAmount(params).then(res => {
229 230 if (res.success) {
230   - this.form.paidAmount = res.result.paidAmount || paidAmount;
231   - this.form.prepaidAmount = res.result.prepaidAmount || prepaidAmount;
232   - this.form.oilAmount = res.result.oilAmount || oilAmount;
233   - this.form.deliveryAmount = res.result.deliveryAmount || '0';
234   - this.form.balancePaymentAmount = res.result.balancePaymentAmount || '0';
  231 + // this.form.paidAmount = res.result.paidAmount || paidAmount;
  232 + // this.form.prepaidAmount = res.result.prepaidAmount || prepaidAmount;
  233 + // this.form.oilAmount = res.result.oilAmount || oilAmount;
  234 + if (this.autoComputedArrival) {
  235 + this.form.deliveryAmount = res.result.deliveryAmount || '0';
  236 + } else {
  237 + this.form.balancePaymentAmount = res.result.balancePaymentAmount || '0';
  238 + }
235 239 this.form.driverSecurityServiceAmount = res.result.driverSecurityServiceAmount || '0';
236 240 this.form.securityServiceAmount = res.result.securityServiceAmount || '0';
237 241 this.form.serviceAmount = res.result.serviceAmount || '0';
... ... @@ -240,10 +244,10 @@ export default {
240 244 },
241 245 submit() {
242 246 let params = [
243   - { ...this.oilAmount, afterAmount: this.form.oilAmount },
244   - { ...this.prePay, afterAmount: this.form.prepaidAmount },
245   - { ...this.arrivalPay, afterAmount: this.form.deliveryAmount },
246   - { ...this.final, afterAmount: this.form.balancePaymentAmount },
  247 + { ...this.oilAmount, afterAmount: this.form.oilAmount === '' ? '0' : this.form.oilAmount },
  248 + { ...this.prePay, afterAmount: this.form.prepaidAmount === '' ? '0' : this.form.prepaidAmount },
  249 + { ...this.arrivalPay, afterAmount: this.form.deliveryAmount === '' ? '0' : this.form.deliveryAmount },
  250 + { ...this.final, afterAmount: this.form.balancePaymentAmount === '' ? '0' : this.form.balancePaymentAmount },
247 251 ];
248 252 uni.$u.api.freightOrder.adjustAmount({ feeList: params, code: this.item.code, paidAmount: this.form.paidAmount, freightAdjustRemark: this.form.freightAdjustRemark }).then(res => {
249 253 if (res.success) {
... ...
pages/order/detail.vue
... ... @@ -222,7 +222,7 @@
222 222 </view>
223 223 <view class="card__item_content">
224 224 ¥{{ it.amount || 0 }}
225   - <span v-if="item.driverSecurityServiceAmount">
  225 + <span class="fee-service" v-if="item.driverSecurityServiceAmount">
226 226 <span v-if="autoComputedArrival && it.type === 'OUT_INVITE_ARRIVAL'" class="color-red">已扣安全服务费{{ item.driverSecurityServiceAmount }}</span>
227 227 <span v-if="!autoComputedArrival && it.type === 'OUT_INVITE_FINAL'" class="color-red">已扣安全服务费{{ item.driverSecurityServiceAmount }}</span>
228 228 </span>
... ... @@ -329,7 +329,7 @@ export default {
329 329 },
330 330 autoComputedArrival() {
331 331 // 自动计算货到
332   - return 'OUT_INVITE_ARRIVAL' === this.currentFreight ? this.currentFreight.autoComputeFeeType : false;
  332 + return 'OUT_INVITE_ARRIVAL' === this.currentFreight?.autoComputeFeeType;
333 333 },
334 334 },
335 335 onLoad(options) {
... ... @@ -500,6 +500,7 @@ export default {
500 500 color: #999999;
501 501 align-content: baseline;
502 502 &--warning {
  503 + height: 28rpx;
503 504 color: #f52723;
504 505 font-size: 20rpx;
505 506 margin-left: 20upx;
... ... @@ -509,6 +510,7 @@ export default {
509 510 border: 2rpx solid #f52723;
510 511 }
511 512 &--paying {
  513 + height: 28rpx;
512 514 color: #ff9339;
513 515 font-size: 20rpx;
514 516 margin-left: 20upx;
... ... @@ -518,6 +520,7 @@ export default {
518 520 border: 2rpx solid #ff9339;
519 521 }
520 522 &--success {
  523 + height: 28rpx;
521 524 color: #00b87a;
522 525 font-size: 20rpx;
523 526 margin-left: 20upx;
... ... @@ -558,6 +561,9 @@ export default {
558 561 text + text {
559 562 margin-left: 10rpx;
560 563 }
  564 + .fee-service {
  565 + font-size: 26rpx;
  566 + }
561 567 }
562 568 }
563 569 .card__item + .card__item {
... ...