From df6433d6a5d11235a34362a8506196b337cccd48 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 28 八月 2024 15:32:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/pages/driver/reserved.vue |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/h5/pages/driver/reserved.vue b/h5/pages/driver/reserved.vue
index 813062c..3477489 100644
--- a/h5/pages/driver/reserved.vue
+++ b/h5/pages/driver/reserved.vue
@@ -121,7 +121,7 @@
 
 <script>
 import keyboardInput from '@/components/keyboard-input/keyboard-input.vue';
-import { uploadUrl, driverCarApply, driverReasonList } from '@/api';
+import { uploadUrl, driverCarApply,driverCarApplyEdit, driverReasonList, driverApplyDetail } from '@/api';
 import dayjs from 'dayjs'
 export default {
 	components: {
@@ -142,7 +142,10 @@
 			inputType: ''
 		};
 	},
-	created() {
+	onLoad(option) {
+		if(option && option.id){
+			this.getDetail(option.id, option.type)
+		}
 		this.initData()
 	},
 	methods: {
@@ -158,9 +161,21 @@
 			if (!param.carCodeBack) return this.showToast('璇疯緭鍏ヨ溅鍚庣墝鍙�')
 			if (!param.transportImgFull) return this.showToast('璇蜂笂浼犲噯杩愯瘉鐓х墖')
 			param.arriveDate = param.arriveDate + ':00'
-			driverCarApply({...param}).then(res => {
+			let fn = param.id ? driverCarApplyEdit : driverCarApply
+			fn({...param}).then(res => {
 				if(res && res.code === 200){
-					uni.navigateBack()
+					setTimeout(() => {
+						this.showToast('棰勭害鐢宠鎴愬姛')
+					})
+					this.$jump('/pages/driver/reservedRecord')
+				}
+			})
+		},
+		getDetail(id, type) {
+			driverApplyDetail({id}).then(res => {
+				this.param = { ...res.data, transportImgFull: res.data.prefixUrl + res.data.transportImg }
+				if(type && type == 'reject'){
+					this.$set(this.param, 'id', null)
 				}
 			})
 		},

--
Gitblit v1.9.3