From d7bd4442f618ac3e7c8cfaf49e8cb4d4d4bf2d8b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 11 九月 2024 17:27:49 +0800
Subject: [PATCH] 最新版本
---
h5/pages/driver/reserved.vue | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/h5/pages/driver/reserved.vue b/h5/pages/driver/reserved.vue
index 813062c..0683f0f 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)
}
})
},
@@ -196,12 +211,14 @@
this.$forceUpdate();
this.closeInput();
},
+ closeInput() {
+ this.$refs.keyboard.close();
+ },
copy(){
if(this.param.carCodeFront){
this.$set(this.param, 'carCodeBack', this.param.carCodeFront)
this.showToast('澶嶅埗鎴愬姛');
}
-
},
handleUpload() {
let token = uni.getStorageSync('token') || ''
@@ -245,9 +262,6 @@
}
})
},
- closeInput() {
- this.$refs.keyboard.close();
- }
}
};
</script>
--
Gitblit v1.9.3