From 2c62224302e67151a26c73cdcb9b6421dc4dcc62 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 28 八月 2024 09:22:52 +0800
Subject: [PATCH] ll

---
 h5/pages/driver/taskDetail.vue     |   35 ++++++--
 h5/pages/staffLogin/login.vue      |    7 +
 h5/api/driver.js                   |   24 ++++++
 h5/pages/driver/index.vue          |   59 ++++++--------
 h5/pages/staff/task/driver.vue     |    3 
 h5/pages/driver/reserved.vue       |   23 ++++-
 h5/pages/driver/reservedDetail.vue |   40 ++++++---
 h5/pages/driver/login.vue          |    2 
 h5/pages/driver/queueUp.vue        |   10 ++
 h5/store/index.js                  |    2 
 10 files changed, 139 insertions(+), 66 deletions(-)

diff --git a/h5/api/driver.js b/h5/api/driver.js
index 5c9bd7f..99bc2ca 100644
--- a/h5/api/driver.js
+++ b/h5/api/driver.js
@@ -49,6 +49,14 @@
     data
   })
 }
+// 鐗╂祦杞﹂绾︿慨鏀�
+export const driverCarApplyEdit = (data) => {
+  return http({
+    url: 'visitsAdmin/cloudService/web/driverPlatform/applyEdit',
+    method: 'post',
+    data
+  })
+}
 // 鐗╂祦杞︽挙閿�
 export const driverCarRevoke= (data) => {
   return http({
@@ -72,4 +80,20 @@
     method: 'get',
     data
   })
+}
+// 鏈堝彴 鎺掗槦鎯呭喌
+export const driverLineUpDetail = (data) => {
+  return http({
+    url: 'visitsAdmin/cloudService/web/driverPlatform/lineUpDetail',
+    method: 'post',
+    data
+  })
+}
+// 鏈堝彴 浠诲姟璇︽儏
+export const driverTaskJobDetail = (data) => {
+  return http({
+    url: 'visitsAdmin/cloudService/web/driverPlatform/jobDetail',
+    method: 'post',
+    data
+  })
 }
\ No newline at end of file
diff --git a/h5/pages/driver/index.vue b/h5/pages/driver/index.vue
index 2df909e..43cd875 100644
--- a/h5/pages/driver/index.vue
+++ b/h5/pages/driver/index.vue
@@ -13,53 +13,37 @@
 		<!--  -->
 		<view class="task_list">
 			<swiper circular class="task_swiper">
-				<swiper-item>
+				<swiper-item v-for="item in taskList" :key="item.id">
 					<view class="item">
 						<view class="head">
-							<view class="name">杩愯緭鍗�222</view>
+							<view class="name">杩愯緭鍗晎{ item.contractNum }}</view>
 							<view class="status">
-								<view class="text">璇风‘璁や换鍔�</view>
-								<view class="time">棰勮绛夊緟锛�12灏忔椂</view>
+								<view class="text" v-if="item.status == 0">璇风‘璁や换鍔�</view>
+								<view class="text" v-if="item.status == 1">璇蜂簬{{item.arriveDate.slice(5,11)}}鐜板満绛惧埌</view>
+								<view class="text" v-if="item.status == 2">鍓嶆柟鎺掗槦锛歿{item.lineUpNum}}杈�</view>
+								<view class="text" v-if="item.status == 3">璇峰叆鍥繘鍏ョ瓑寰呭尯</view>
+								<view class="text" v-if="item.status == 4">璇峰叆鍥仠闈�1鍙锋湀鍙颁綔涓�</view>
+								<view class="text" v-if="item.status == 5">1鍙锋湀鍙颁綔涓氫腑</view>
+								<view class="text" v-if="item.status == 6">浣滀笟宸插畬鎴�</view>
+								<view class="time" v-if="item.waitTime">{{ item.waitTime }}</view>
 							</view>
 						</view>
 						<view class="content">
 							<view class="info">
 								<view class="plate">
 									<image src="@/static/driver/wuliu_ic_car@2x.png" class="icon" mode=""></image>
-									<text>鐨朅D</text>
+									<text>{{ item.carCodeFront }}</text>
 								</view>
 								<view class="plate">
 									<image src="@/static/driver/wuliu_ic_huowu@2x.png" class="icon" mode=""></image>
-									<text>3000涓�</text>
+									<text>{{ item.totalNum }}涓囨敮</text>
 								</view>
 							</view>
 							<view class="sub">
-								<view class="time">02-01 08:11:11</view>
-								<view class="sub_btn" @click="handleTask()">纭浠诲姟</view>
-							</view>
-						</view>
-					</view>
-				</swiper-item>
-				<swiper-item>
-					<view class="item">
-						<view class="head">
-							<view class="name">杩愯緭鍗�222</view>
-							<view class="status"><view class="text">璇蜂笌鐜板満绛惧埌</view></view>
-						</view>
-						<view class="content">
-							<view class="info">
-								<view class="plate">
-									<image src="@/static/driver/wuliu_ic_car@2x.png" class="icon" mode=""></image>
-									<text>鐨朅D</text>
-								</view>
-								<view class="plate">
-									<image src="@/static/driver/wuliu_ic_huowu@2x.png" class="icon" mode=""></image>
-									<text>3000涓�</text>
-								</view>
-							</view>
-							<view class="sub">
-								<view class="time">02-01 08:11:11</view>
-								<view class="sub_btn" @click="handleTask(1)">绔嬪嵆绛惧埌</view>
+								<view class="time" v-if="item.arriveDate">{{ item.arriveDate.slice(5) }}</view>
+								<view v-if="item.status == 0" class="sub_btn" @click="handleTask(item)">纭浠诲姟</view>
+								<view v-if="item.status == 1" class="sub_btn" @click="handleSign(item)">绔嬪嵆绛惧埌</view>
+								<view v-if="item.status == 2" class="sub_btn" @click="handleQueup(item)">鏌ョ湅鎺掗槦</view>
 							</view>
 						</view>
 					</view>
@@ -112,13 +96,21 @@
 export default {
 	data() {
 		return {
-			driverInfo: uni.getStorageSync('driverInfo')
+			taskList: [],
+			driverInfo: uni.getStorageSync('driverInfo'),
+			
 		};
 	},
 	created() {
 		this.initData();
 	},
 	methods: {
+		handleSign(item) {
+			uni.navigateTo({
+				url: '/pages/driver/taskDetail?id=' + item.id
+			});
+		},
+		handleQueup(item) {},
 		initData() {
 			driverHomeData().then(res => {
 				if (res.code == 200) {
@@ -126,6 +118,7 @@
 						bookingTips: res.data.bookingTips,
 						reservationMap: res.data.reservationMap
 					});
+					this.taskList = res.data.platformJobList || []
 				}
 			});
 		},
diff --git a/h5/pages/driver/login.vue b/h5/pages/driver/login.vue
index 4dede46..1372f80 100644
--- a/h5/pages/driver/login.vue
+++ b/h5/pages/driver/login.vue
@@ -37,7 +37,7 @@
   data() {
     return {
       form: {
-				username: '13996529050',
+				username: '13333333333',
 				password: '1'
       },
       isShowProtocol: false,
diff --git a/h5/pages/driver/queueUp.vue b/h5/pages/driver/queueUp.vue
index 3b836b1..2b13d91 100644
--- a/h5/pages/driver/queueUp.vue
+++ b/h5/pages/driver/queueUp.vue
@@ -35,13 +35,23 @@
 </template>
 
 <script>
+	import { driverLineUpDetail } from '@/api'
 export default {
   data() {
     return {
 
     }
   },
+	onLoad() {
+		this.getData()
+	},
   methods: {
+		getData() {
+			driverLineUpDetail({
+				  mobile: uni.getStorageSync('driverInfo').mobile,
+				  queryType: 0
+			})
+		},
     handleCheck() {
       uni.navigateTo({
         url: "/pages/driver/queueUpRecord"
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)
 				}
 			})
 		},
diff --git a/h5/pages/driver/reservedDetail.vue b/h5/pages/driver/reservedDetail.vue
index 2303e6f..bf1c851 100644
--- a/h5/pages/driver/reservedDetail.vue
+++ b/h5/pages/driver/reservedDetail.vue
@@ -134,21 +134,32 @@
 	},
   methods: {
 		handleCancel(){
+			const { info } = this
 			uni.showModal({
 				title: '鎻愮ず',
-				content: '杩欐槸涓�涓ā鎬佸脊绐�',
+				content: '鎮ㄧ‘璁よ鎾ゅ洖褰撳墠鐢宠鍚楋紵',
 				success: function (res) {
 					if (res.confirm) {
-						console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+						driverCarRevoke({
+							id: info.id, info: ''
+						})
 					} else if (res.cancel) {
 						console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
 					}
 				}
 			});
-			// driverCarRevoke
 		},
-		handleEdit(){},
-		handleAga(){},
+		handleEdit(){
+			uni.navigateTo({
+				url: '/pages/driver/reserved?id=' + this.info.id
+			})
+		},
+		handleAga(){
+			const { info } = this
+			uni.navigateTo({
+				url: `/pages/driver/reserved?id=${info.id}&type=reject`
+			})
+		},
 		getDetail(id) {
 			driverApplyDetail({id}).then(res => {
 				this.info = res.data
@@ -200,7 +211,15 @@
       .item {
         display: flex;
         margin-bottom: 48rpx;
-
+				position: relative;
+				.separate {
+				  position: absolute;
+				  width: 4rpx;
+				  height: calc( 100% - 52rpx );
+				  background-color: #eeeeee;
+				  left: 40rpx;
+				  top: 90rpx;
+				}
         .avatar_wrap {
           width: 80rpx;
           height: 80rpx;
@@ -222,15 +241,6 @@
             bottom: 0;
           }
 
-          .separate {
-            position: absolute;
-            width: 4rpx;
-            height: 100%;
-            background-color: #eeeeee;
-            left: 50%;
-            transform: translate(-50%, 0);
-            bottom: -80rpx;
-          }
         }
 
         .content {
diff --git a/h5/pages/driver/taskDetail.vue b/h5/pages/driver/taskDetail.vue
index 9985e40..0365e8f 100644
--- a/h5/pages/driver/taskDetail.vue
+++ b/h5/pages/driver/taskDetail.vue
@@ -6,34 +6,40 @@
         src="../../static/driver/bg_renwu@2x.png"
         mode=""
       ></image>
-      <view class="name">浣滀笟宸插畬鎴�</view>
-      <view class="id_card">鐨朅D1212</view>
-      <view class="status">浣滀笟瀹屾垚</view>
+      <view class="name" v-if="param.status == 1">璇蜂笌{{ param.arriveDate.slice(0,11) }}鐜板満绛惧埌</view>
+      <view class="name" v-if="param.status == 2">鍓嶆柟鎺掗槦锛歿{param.lineUpNum}}杈�</view>
+      <view class="name" v-if="param.status == 5">鏈堝彴浣滀笟涓�</view>
+      <view class="name" v-if="param.status == 6">浣滀笟宸插畬鎴�</view>
+      <view class="id_card">{{ param.carCodeFront }}</view>
+      <view class="status" v-if="param.status == 1">绛夊緟绛惧埌</view>
+      <view class="status" v-if="param.status == 2">绛夊緟鍙彿</view>
+      <view class="status" v-if="param.status == 5">浣滀笟涓�</view>
+      <view class="status" v-if="param.status == 6">浣滀笟瀹屾垚</view>
     </view>
     <!--  -->
     <view class="main_content">
       <view class="line">
         <view class="label">鍙告満濮撳悕</view>
-        <view class="value">鍒樻煇</view>
+        <view class="value">{{param.lineUpNum}}</view>
       </view>
       <view class="line">
         <view class="label">鎵嬫満鍙�</view>
-        <view class="value">188</view>
+        <view class="value">{{param.lineUpNum}}</view>
       </view>
       <view class="line">
         <view class="label">杩愯緭鍗曞彿</view>
         <view class="value" @click="showDetail = true">
-          <text class="waybill_num">Y111</text>
+          <text class="waybill_num">{{param.lineUpNum}}</text>
           <text class="btn">杩愬崟璇︽儏</text>
         </view>
       </view>
       <view class="line">
         <view class="label">浣滀笟绫诲瀷</view>
-        <view class="value">鍏ュ洯瑁呰揣</view>
+        <view class="value">{{param.lineUpNum}}</view>
       </view>
       <view class="line">
         <view class="label">杞︾墝鐓�</view>
-        <view class="value">鍓嶏細鐨朅21</view>
+        <view class="value">{{param.lineUpNum}}</view>
       </view>
       <!--  -->
       <view class="line">
@@ -147,6 +153,7 @@
 </template>
 
 <script>
+	import { driverTaskJobDetail } from '@/api'
 export default {
   data() {
     return {
@@ -156,16 +163,26 @@
       showDetail: false,
     }
   },
+	onLoad(option) {
+		this.getLocation(option.id)
+	},
   methods: {
     handleSignIn() {
       const { param } = this
       this.param.status = param.status == '0' ? '1' : '0'
     },
-    getLocation() {
+    getLocation(jobId) {
       uni.getLocation({
         type: 'wgs84',
 				
         success: function (res) {
+					driverTaskJobDetail({
+						jobId,
+						lat: res.latitude,
+						lnt: res.longitude,
+					}).then(ress => {
+						this.param = { ...ress.data }
+					})
 					console.log(res);
           console.log('褰撳墠浣嶇疆鐨勭粡搴︼細' + res.longitude)
           console.log('褰撳墠浣嶇疆鐨勭含搴︼細' + res.latitude)
diff --git a/h5/pages/staff/task/driver.vue b/h5/pages/staff/task/driver.vue
index 6532036..20d2264 100644
--- a/h5/pages/staff/task/driver.vue
+++ b/h5/pages/staff/task/driver.vue
@@ -121,6 +121,7 @@
       <view class="appr_modal">
         <view class="title">{{ this.flag == '0' ? '鎷掔粷' : '鍚屾剰' }}</view>
         <textarea
+					v-model="checkInfo"
           :placeholder="this.flag == '0' ? '鎷掔粷璇存槑锛屽繀濉�' : '鍚屾剰璇存槑锛岄潪蹇呭~'"
           placeholder-class="placeholder9"
         />
@@ -176,7 +177,7 @@
 		},
 		handleAppy() {
 			const {flag,checkInfo, type,info } = this
-			if(flag == 0 && !checkInfo) return this.showToast('鎷掔粷璇存槑蹇呭~')
+			if(flag == 0 && checkInfo == '') return this.showToast('鎷掔粷璇存槑蹇呭~')
 			carUseBookAppr({
 				checkInfo,objId: info.id,objType: 6,status: flag == 0 ? 3 : 2
 			}).then(res => {
diff --git a/h5/pages/staffLogin/login.vue b/h5/pages/staffLogin/login.vue
index d4a0c8b..6ab5bd1 100644
--- a/h5/pages/staffLogin/login.vue
+++ b/h5/pages/staffLogin/login.vue
@@ -71,11 +71,12 @@
   data() {
     return {
       form: {
-        account: '',
-        password: '',
+        username: '13996529050',
+        password: '123456',
+				code: 1
       },
       isShowProtocol: false,
-      ProtocolFlag: false,
+      ProtocolFlag: true,
       captcha: {},
       htmlText: ''
     }
diff --git a/h5/store/index.js b/h5/store/index.js
index 0da49e4..37588ba 100644
--- a/h5/store/index.js
+++ b/h5/store/index.js
@@ -82,7 +82,9 @@
 		empty(state) {
 			state.token = ''
 			state.userInfo = {}
+			state.driverInfo = {}
 			uni.removeStorageSync('userInfo')
+			uni.removeStorageSync('driverInfo')
 			uni.removeStorageSync('token')
 		}
 	},

--
Gitblit v1.9.3