停车订单详情页面停车时长的逻辑改为计费时长逻辑
This commit is contained in:
parent
9b58416ed4
commit
9bd2f0c1ea
@ -44,8 +44,11 @@
|
||||
</view>
|
||||
|
||||
<view class="info-item">
|
||||
<text class="info-label">停车时长</text>
|
||||
<text>{{ calculateParkingDuration() }}</text>
|
||||
<!-- <text class="info-label">停车时长</text>
|
||||
<text>{{ calculateParkingDuration() }}</text> -->
|
||||
|
||||
<text class="info-label">计费时长</text>
|
||||
<text>{{ getTime(orderDetail.billing_time) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-item">
|
||||
@ -118,6 +121,19 @@ export default {
|
||||
},
|
||||
|
||||
// 计算停车时长
|
||||
getTime(time) {
|
||||
if (!time) {
|
||||
return '0分钟';
|
||||
}
|
||||
const hourVal = Math.floor(time/60);
|
||||
const minuteVal = time%60;
|
||||
if (hourVal === 0) {
|
||||
return `${minuteVal}分钟`;
|
||||
}
|
||||
return `${hourVal}小时${minuteVal}分钟`
|
||||
},
|
||||
|
||||
|
||||
calculateParkingDuration() {
|
||||
if (!this.orderDetail || !this.orderDetail.record_info) {
|
||||
return '0分钟';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user