From 1382a7990e9b13f60c6416ada5477673a934dd16 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 29 八月 2024 09:02:57 +0800
Subject: [PATCH] ll

---
 h5/pages/driver/taskDetail.vue |  144 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 101 insertions(+), 43 deletions(-)

diff --git a/h5/pages/driver/taskDetail.vue b/h5/pages/driver/taskDetail.vue
index 0365e8f..84f8f11 100644
--- a/h5/pages/driver/taskDetail.vue
+++ b/h5/pages/driver/taskDetail.vue
@@ -20,38 +20,58 @@
     <view class="main_content">
       <view class="line">
         <view class="label">鍙告満濮撳悕</view>
-        <view class="value">{{param.lineUpNum}}</view>
+        <view class="value">{{param.driverName}}</view>
       </view>
       <view class="line">
         <view class="label">鎵嬫満鍙�</view>
-        <view class="value">{{param.lineUpNum}}</view>
+        <view class="value">{{param.drivierPhone}}</view>
       </view>
-      <view class="line">
-        <view class="label">杩愯緭鍗曞彿</view>
-        <view class="value" @click="showDetail = true">
-          <text class="waybill_num">{{param.lineUpNum}}</text>
-          <text class="btn">杩愬崟璇︽儏</text>
-        </view>
-      </view>
-      <view class="line">
-        <view class="label">浣滀笟绫诲瀷</view>
-        <view class="value">{{param.lineUpNum}}</view>
-      </view>
+			<template v-if="param.type == 4">
+				<view class="line">
+				  <view class="label">杩愯緭鍗曞彿</view>
+				  <view class="value" @click="showDetail = true">
+				    <text class="waybill_num">{{param.code}}</text>
+				    <text class="btn">杩愬崟璇︽儏</text>
+				  </view>
+				</view>
+				<view class="line">
+				  <view class="label">浣滀笟绫诲瀷</view>
+				  <view class="value">甯傚叕鍙稿鍗忚溅鍗歌揣</view>
+				</view>
+			</template>
+			<template v-else>
+				<view class="line">
+				  <view class="label">鍚堝悓缂栧彿</view>
+				  <view class="value">{{param.contractNum}}</view>
+				</view>
+				<view class="line">
+				  <view class="label">鍏ュ簱绫诲瀷</view>
+				  <view class="value">{{param.inType == 0 ? '鏁存墭鐩�' : '浠剁儫'}}</view>
+				</view>
+				<view class="line">
+				  <view class="label">浣滀笟閲�</view>
+				  <view class="value">{{param.totalNum}}涓囨敮</view>
+				</view>
+			</template>
       <view class="line">
         <view class="label">杞︾墝鐓�</view>
-        <view class="value">{{param.lineUpNum}}</view>
+        <view class="value">鍓嶏細{{param.carCodeFront}} | 鍚庯細{{param.carCodeBack}}</view>
       </view>
       <!--  -->
-      <view class="line">
+      <view class="line" v-if="param.status == 1">
         <view class="label">璺濈鍥尯</view>
         <view class="value">
-          <view class="">0 鍏噷</view>
+          <view class="">{{param.getDistance}}鍏噷</view>
           <view class="btn" @click="getLocation">
 						<image class="icon mr6" src="../../static/driver/position.png"></image>
             閲嶆柊瀹氫綅
           </view>
         </view>
       </view>
+			<view class="line" v-if="param.status == 2">
+			  <view class="label">绛惧埌鏃堕棿</view>
+			  <view class="value">{{param.signDate}}</view>
+			</view>
       <view class="warnning">
         <u-icon name="info-circle" color="#ED4545" class="mr12"></u-icon>
         濡傛棤娉曡幏鍙栧畾浣嶏紝璇风敤寰俊鎵弿鍥尯澶у睆浜岀淮
@@ -68,25 +88,24 @@
 				<view class="label">浣滀笟瀹屾垚</view>
 				<view class="value">2022</view>
 			</view> -->
-      <view class="signIn_wrap" @click="handleSignIn">
+      <view v-if="param.status == 1" class="signIn_wrap" @click="handleSignIn">
         <image
           :src="
-            param.status == '0'
+            param.getDistance < signDistance
               ? require('@/static/driver/btn_qiandao@2x.png')
               : require('@/static/driver/btn_qiandao_fail@2x.png')
           "
           class="img"
           mode="widthFix"
         ></image>
-        <view class="handle">绛惧埌</view>
-        <view class="time">09:10</view>
+        <view class="handle">{{ param.getDistance > signDistance ? '鏃犳硶绛惧埌' : '绛惧埌' }}</view>
+        <view class="time">{{nowTime}}</view>
       </view>
     </view>
     <view class="space"></view>
     <!-- 绛夊緟鍙彿 -->
-    <view class="padding_wrap">
-      <view class="btn cancel">鍙栨秷绛惧埌</view>
-      <view class="btn check">鏌ョ湅鎺掗槦鎯呭喌</view>
+    <view v-if="param.status == 2" class="padding_wrap">
+      <view class="btn check" @click="handleQueue">鏌ョ湅鎺掗槦鎯呭喌</view>
     </view>
 
     <!-- modal -->
@@ -153,42 +172,79 @@
 </template>
 
 <script>
-	import { driverTaskJobDetail } from '@/api'
+	import { driverTaskJobDetail, driverSignInTask } from '@/api';
+	import dayjs from 'dayjs';
 export default {
   data() {
     return {
       param: {
         status: '0'
       },
+			jobId: '',
+			lat: '',
+			lnt: '',
+			nowTime: '',
+			signDistance: uni.getStorageSync('driverGuide').signDistance,
       showDetail: false,
     }
   },
 	onLoad(option) {
-		this.getLocation(option.id)
+		this.jobId = option.id
+		if(option.status && option.status == '1'){
+			this.getLocation()
+		}else{
+			this.getDetail()
+		}
+		
+		// this.getDetail({
+		// 	jobId: option.id,
+		// 	lat: 31.769137,
+		// 	lnt: 117.232241,
+		// })
+		setInterval(() => {
+			this.nowTime = dayjs().format('HH:mm:ss')
+		})
 	},
   methods: {
     handleSignIn() {
-      const { param } = this
-      this.param.status = param.status == '0' ? '1' : '0'
+			const { param, signDistance, lat, lnt, jobId } = this
+			if(param.getDistance > signDistance) return
+			driverSignInTask({
+				jobId, lat, lnt,signType: 0
+			}).then(res => {
+				this.showToast('绛惧埌鎴愬姛')
+				this.getDetail()
+			})
     },
-    getLocation(jobId) {
+		getDetail() {
+			const { jobId, lat, lnt } = this
+			driverTaskJobDetail({
+				jobId: this.jobId,
+				lat,
+				lnt
+			}).then(ress => {
+				this.param = { ...ress.data }
+			})
+		},
+    getLocation() {
+			const { jobId } = this
       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)
-        }
+        success: (res) => {
+					this.lat = res.latitude
+					this.lnt = res.longitude
+					this.getDetail()
+        },
+				fail:(err) => {
+					console.log('err', err);
+				}
       })
-    }
+    },
+		handleQueue() {
+			uni.navigateTo({
+				url:'/pages/driver/queueUp?jobId=' + this.jobId
+			})
+		},
   }
 }
 </script>
@@ -202,6 +258,7 @@
     padding: 16rpx 30rpx;
     position: relative;
     bottom: 32rpx;
+		z-index: 999;
     .line {
       padding: 24rpx 0 28rpx;
       border-bottom: 1rpx solid #e5e5e5;
@@ -308,6 +365,7 @@
   }
   .padding_wrap {
     position: fixed;
+		z-index: 999;
     padding: 0 30rpx 64rpx;
     bottom: 0;
     left: 0;
@@ -318,7 +376,7 @@
       height: 96rpx;
       line-height: 96rpx;
       text-align: center;
-      width: 336rpx;
+      width: 100%;
       font-size: 36rpx;
       color: #333333;
       background: #ffffff;

--
Gitblit v1.9.3