From 17efddc6a667670dca682bf36b51a43e99615e6d Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 16 十月 2024 15:59:38 +0800
Subject: [PATCH] 代码初始化
---
h5/pages/driver/reserved.vue | 46 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/h5/pages/driver/reserved.vue b/h5/pages/driver/reserved.vue
index 813062c..90f4ccd 100644
--- a/h5/pages/driver/reserved.vue
+++ b/h5/pages/driver/reserved.vue
@@ -7,8 +7,8 @@
<text>*</text>
<text>鍏ュ洯鍘熷洜</text>
</view>
- <view class="value" @click="showReason = true">
- <text class="mr6" :style="{ color: param.inReason ? '#000000' : '#999999' }">{{ param.inReason ? param.inReason : '璇烽�夋嫨' }}</text>
+ <view class="value" @click="reasonClick">
+ <text class="mr6" :class="{gray: param.id}" :style="{ color: param.inReason ? '#000000' : '#999999' }">{{ param.inReason ? param.inReason : '璇烽�夋嫨' }}</text>
<u-icon name="arrow-right" color="#CCCCCC" size="16"></u-icon>
</view>
</view>
@@ -105,7 +105,8 @@
</view>
<!-- -->
- <u-picker :show="showReason" keyName="reason" :columns="reasonList" @confirm="reasonConfirm"></u-picker>
+ <u-picker :show="showReason" keyName="reason" closeOnClickOverlay @close="showReason = false"
+ @cancel="showReason = false" :columns="reasonList" @confirm="reasonConfirm"></u-picker>
<u-datetime-picker
:show="showDatetime"
closeOnClickOverlay
@@ -121,7 +122,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,10 +143,19 @@
inputType: ''
};
},
- created() {
+ onLoad(option) {
+ if(option && option.id){
+ this.getDetail(option.id, option.type)
+ }
this.initData()
},
methods: {
+ reasonClick() {
+ if(this.param.id){
+ return
+ }
+ this.showReason = true
+ },
onSubmit() {
const param = { ...this.param }
if (!param.arriveDate) return this.showToast('璇烽�夋嫨鍒板満鏃堕棿')
@@ -158,9 +168,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 +218,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 +269,6 @@
}
})
},
- closeInput() {
- this.$refs.keyboard.close();
- }
}
};
</script>
@@ -283,6 +304,9 @@
display: flex;
align-items: center;
justify-content: flex-end;
+ .gray{
+ color: #999999 !important;
+ }
.btns {
display: flex;
align-items: center;
--
Gitblit v1.9.3