Pārlūkot izejas kodu

公里数据 时间 和取消原因优化

vaecebyZ 8 mēneši atpakaļ
vecāks
revīzija
edffc4ea51
1 mainītis faili ar 35 papildinājumiem un 26 dzēšanām
  1. 35 26
      my/order/trip/detail.vue

+ 35 - 26
my/order/trip/detail.vue

@@ -62,7 +62,7 @@
 			</template>
 
 			<view class="title" style="	margin-top: 28rpx;">
-				全程{{ (distance / 1000).toFixed(1) }}公里,{{ isNaN(minutes) ? 1 : minutes }}分钟
+				全程{{ (distance / 1000).toFixed(1) }}公里,{{ isNaN(minutes) ? 0 : minutes }}分钟
 			</view>
 		</view>
 
@@ -81,6 +81,15 @@
 				</view>
 			</view>
 
+			<view v-if="info.goodsList[0].goodsState == 'CLOSE'" class="item">
+				<view class="label">
+					取消原因
+				</view>
+				<view class="value">
+					{{ info.goodsList[0].extend.cancelReason }}
+				</view>
+			</view>
+
 			<view class="item" v-if="info.goodsList[0].goodsState == 'USED'">
 				<view class="label">
 					付款方式
@@ -171,36 +180,36 @@ export default {
 			payDetails(orderNo).then(res => {
 				this.pageLoading = false
 				this.info = res.content
-
+				this.distance = this.info.goodsList[0].extend.distance
 				// 计算开始和结束的距离
-				const destinationLongitude = this.info.goodsList[0].extend.destinationLongitude
-				const destinationLatitude = this.info.goodsList[0].extend.destinationLatitude
-				const originLongitude = this.info.goodsList[0].extend.originLongitude
-				const originLatitude = this.info.goodsList[0].extend.originLatitude
-
-				qqmapsdk.calculateDistance({
-					mode: 'driving',
-					from: {
-						latitude: originLatitude,
-						longitude: originLongitude
-					},
-					to: [{
-						latitude: destinationLatitude,
-						longitude: destinationLongitude
-					}],
-					success: (res) => {
-						console.log(res)
-						if (res.message === 'Success') {
-							this.distance = res.result.elements[0].distance.toFixed(2)
-						}
-					}
-				})
+				// const destinationLongitude = this.info.goodsList[0].extend.destinationLongitude
+				// const destinationLatitude = this.info.goodsList[0].extend.destinationLatitude
+				// const originLongitude = this.info.goodsList[0].extend.originLongitude
+				// const originLatitude = this.info.goodsList[0].extend.originLatitude
+
+				// qqmapsdk.calculateDistance({
+				// 	mode: 'driving',
+				// 	from: {
+				// 		latitude: originLatitude,
+				// 		longitude: originLongitude
+				// 	},
+				// 	to: [{
+				// 		latitude: destinationLatitude,
+				// 		longitude: destinationLongitude
+				// 	}],
+				// 	success: (res) => {
+				// 		console.log(res)
+				// 		if (res.message === 'Success') {
+				// 			this.distance = res.result.elements[0].distance.toFixed(2)
+				// 		}
+				// 	}
+				// })
 				// 计算订单开始到结束的耗时
 				// driverEndTime
-				// startTime
+				// driverArrivedTime
 
 				const driverEndTime = new Date(this.info.goodsList[0].extend.driverEndTime).getTime()
-				const startTime = new Date(this.info.goodsList[0].extend.startTime).getTime()
+				const startTime = new Date(this.info.goodsList[0].extend.driverArrivedTime).getTime()
 				const time = driverEndTime - startTime
 				// 转换为分钟数
 				this.minutes = Math.ceil((time / 1000 / 60))