소스 검색

分钟向上取整

vaecebyZ 8 달 전
부모
커밋
20f7b6b492
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      my/order/trip/detail.vue

+ 2 - 2
my/order/trip/detail.vue

@@ -62,7 +62,7 @@
 			</template>
 
 			<view class="title" style="	margin-top: 28rpx;">
-				全程{{ (distance / 1000).toFixed(1) }}公里,{{ isNaN(minutes) ? 0 : minutes }}分钟
+				全程{{ (distance / 1000).toFixed(1) }}公里,{{ isNaN(minutes) ? 1 : minutes }}分钟
 			</view>
 		</view>
 
@@ -203,7 +203,7 @@ export default {
 				const startTime = new Date(this.info.goodsList[0].extend.startTime).getTime()
 				const time = driverEndTime - startTime
 				// 转换为分钟数
-				this.minutes = (time / 1000 / 60).toFixed(0)
+				this.minutes = Math.ceil((time / 1000 / 60))
 
 			})
 		},