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/index.vue |  220 +++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 148 insertions(+), 72 deletions(-)

diff --git a/h5/pages/driver/index.vue b/h5/pages/driver/index.vue
index b4bb426..82c5cc7 100644
--- a/h5/pages/driver/index.vue
+++ b/h5/pages/driver/index.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="main_app">
 		<view class="title_wrap">
-			<view class="name">鏌愭煇鏌愶紝娆㈣繋鐧诲綍锝�</view>
+			<view class="name">{{ driverInfo.realname }}锛屾杩庣櫥褰曪綖</view>
 			<view class="btn" @click="loginOut">閫�鍑虹櫥褰�</view>
 		</view>
 		<!--  -->
@@ -11,43 +11,57 @@
 			<image class="banner" src="../../static/driver/wuliuche_banner@2x.png" mode="widthFix"></image>
 		</view>
 		<!--  -->
-		<view class="task_list">
-			<view class="item">
-				<view class="head">
-					<view class="name">杩愯緭鍗�222</view>
-					<view class="status">
-						<view class="text">璇风‘璁や换鍔�</view>
-						<view class="time">棰勮绛夊緟锛�12灏忔椂</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 v-if="taskList && taskList.length > 0" class="task_list">
+			<swiper circular class="task_swiper">
+				<swiper-item v-for="item in taskList" :key="item.id" @click="taskClick(item)">
+					<view class="item">
+						<view class="head">
+							<view class="name">杩愯緭鍗晎{ item.billCode }}</view>
+							<view class="status">
+								<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">璇峰叆鍥仠闈爗{item.platformName}}浣滀笟</view>
+								<view class="text" v-if="item.status == 5">{{item.platformName}}浣滀笟涓�</view>
+								<view class="text" v-if="item.status == 6">浣滀笟宸插畬鎴�</view>
+								<view class="time" v-if="item.waitTime && item.status == 2">{{ item.waitTime }}</view>
+								<view class="time" v-if="item.finishTimeStr && item.status == 5">{{ item.finishTimeStr }}</view>
+							</view>
 						</view>
-						<view class="plate">
-							<image src="@/static/driver/wuliu_ic_huowu@2x.png" class="icon" mode=""></image>
-							<text>3000涓�</text>
+						<view class="content">
+							<view class="info">
+								<view class="plate">
+									<image src="@/static/driver/wuliu_ic_car@2x.png" class="icon" mode=""></image>
+									<text>{{ item.carCodeFront }}</text>
+								</view>
+								<view class="plate">
+									<image src="@/static/driver/wuliu_ic_huowu@2x.png" class="icon" mode=""></image>
+									<text>{{ item.totalNum }}涓囨敮</text>
+								</view>
+							</view>
+							<view class="sub">
+								<view class="time" v-if="item.arriveDate && item.type == 4">{{ item.arriveDate.slice(5) }}</view>
+								<view class="time" v-if="item.type != 4 && item.platformWmsJob && item.platformWmsJob.ioCreatedate">{{ item.platformWmsJob.ioCreatedate.slice(5, 19) }}</view>
+								<view v-if="item.status == 0" class="sub_btn">纭浠诲姟</view>
+								<view v-if="item.status == 1" class="sub_btn">绔嬪嵆绛惧埌</view>
+								<view v-if="item.status == 2" class="sub_btn" @click.stop="handleQueue(item)">鏌ョ湅鎺掗槦</view>
+							</view>
 						</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>
 		</view>
 		<!--  -->
 		<view class="title_wrap"><view class="name">涓氬姟鍔炵悊</view></view>
 		<view class="container1">
 			<view class="left">
-				<view class="img_wrap img1" @click="$jump('/pages/driver/reserved')">
+				<view class="img_wrap img1" @click="$jump('/pages/driver/notice')">
 					<image src="@/static/driver/wuliu_ic_ruyuanyuyue@2x.png" class="img"></image>
 					<view class="h1">鍏ュ洯椤荤煡</view>
 					<view class="h2">RESERVATION</view>
 				</view>
-				<view class="img_wrap img2" @click="$jump('/pages/driver/reservedGuide')">
+				<view class="img_wrap img2" @click="$jump('/pages/driver/reservedGuide?str=bookingTips')">
 					<image src="@/static/driver/wuliu_ic_zhinan@2x.png" class="img"></image>
 					<view class="h1">棰勭害鎸囧崡</view>
 					<view class="h2">APPOINTMENT GUIDE</view>
@@ -64,7 +78,7 @@
 					<view class="h1">鏈堝彴鎺掗槦鎯呭喌</view>
 					<view class="h2">HIDDEN DANGER</view>
 				</view>
-				<view class="img_wrap img2">
+				<view class="img_wrap img2" @click="$jump('/pages/driver/reservedGuide?str=reservationMap')">
 					<image src="@/static/driver/wuliu_ic_daolan@2x.png" class="img"></image>
 					<view class="h1">鍥尯瀵艰鍥�</view>
 					<view class="h2">GUIDE MAP</view>
@@ -80,20 +94,68 @@
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-			};
+import { logoutPost, driverHomeData } from '@/api';
+export default {
+	data() {
+		return {
+			taskList: [],
+			driverInfo: uni.getStorageSync('driverInfo'),
+			
+		};
+	},
+	onShow() {
+		this.initData();
+	},
+	methods: {
+		initData() {
+			driverHomeData().then(res => {
+				if (res.code == 200) {
+					uni.setStorageSync('driverGuide', {
+						bookingTips: res.data.bookingTips,
+						reservationMap: res.data.reservationMap,
+						signDistance: res.data.signDistance
+					});
+					this.taskList = res.data.platformJobList || []
+				}
+			});
 		},
-		methods: {
-			handleTask(){
-				uni.navigateTo({
-					url: '/pages/driver/taskConfirm'
-				})
+		loginOut() {
+			this.$store.commit('empty');
+			logoutPost();
+			uni.redirectTo({
+				url: '/pages/driver/login'
+			});
+		},
+		taskClick(item) {
+			const status = item.status
+			console.log(item);
+			if(status == 0){
+				uni.navigateTo({url: '/pages/driver/taskConfirm?id=' + item.id});
 			}
-		}
+			// else if(status == 2){
+			// 	uni.navigateTo({url:'/pages/driver/queueUp?jobId=' + item.id})
+			// }
+			else{
+				uni.navigateTo({url: `/pages/driver/taskDetail?id=${item.id}&status=${item.status}`});
+			}
+		},
+		handleTask(item) {
+			uni.navigateTo({
+				url: '/pages/driver/taskConfirm?id=' + item.id
+			});
+		},
+		handleSign(item) {
+			uni.navigateTo({
+				url: `/pages/driver/taskDetail?id=${item.id}&status=${item.status}`
+			});
+		},
+		handleQueue(item) {
+			uni.navigateTo({
+				url:'/pages/driver/queueUp?jobId=' + item.id	
+			})
+		},
 	}
+};
 </script>
 
 <style lang="scss">
@@ -103,7 +165,7 @@
 	align-items: center;
 	margin-bottom: 24rpx;
 	.name {
-		font-weight: 500;
+		font-weight: 600;
 		font-size: 34rpx;
 		color: #222222;
 	}
@@ -111,9 +173,9 @@
 		width: 144rpx;
 		height: 56rpx;
 		border-radius: 36rpx;
-		border: 1rpx solid #279baa;
+		border: 1rpx solid $uni-color-primary;
 		font-size: 26rpx;
-		color: #279baa;
+		color: $uni-color-primary;
 		display: flex;
 		justify-content: center;
 		align-items: center;
@@ -128,23 +190,23 @@
 	position: relative;
 	width: 688rpx;
 	height: 270rpx;
-	margin-bottom: 40rpx;
+	margin-bottom: 28rpx;
 	.h1 {
 		font-weight: bold;
 		line-height: 66rpx;
 		font-size: 44rpx;
 		margin-bottom: 14rpx;
 	}
-	.h2{
-		font-weight: 500;
+	.h2 {
+		font-weight: 600;
 		font-size: 28rpx;
 		width: 192rpx;
-		color: #279BAA;
+		color: $uni-color-primary;
 		height: 48rpx;
 		line-height: 48rpx;
 		text-align: center;
-		background: #FFFFFF;
-		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(39,155,170,0.31);
+		background: #ffffff;
+		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(39, 155, 170, 0.31);
 		border-radius: 24rpx;
 	}
 	.banner {
@@ -170,7 +232,7 @@
 		border-radius: 8rpx;
 		overflow: hidden;
 		.h1 {
-			font-weight: 500;
+			font-weight: 600;
 			font-size: 32rpx;
 			color: #222222;
 			line-height: 48rpx;
@@ -201,63 +263,77 @@
 		margin-bottom: 16rpx;
 	}
 }
-.task_list{
-	margin-bottom: 48rpx;
-	.item{
-		background: #FFFFFF;
-		box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(39,155,170,0.18);
+.task_list {
+	margin-bottom: 0rpx;
+	.task_swiper {
+		padding: 12rpx 10rpx;
+		height: 340rpx;
+		width: 730rpx;
+		margin-left: -20rpx;
+		box-sizing: border-box;
+	}
+	.item {
+		background: #ffffff;
+		box-shadow: 0rpx 6rpx 24rpx 0rpx rgba(39, 155, 170, 0.32);
 		border-radius: 16rpx;
-		.head{
+		height: 280rpx;
+		width: 98%;
+		margin-left: 1%;
+		.head {
 			display: flex;
 			justify-content: space-between;
 			align-items: center;
-			background: linear-gradient( 270deg, #FEFEFF 0%, #E1F7FE 100%);
-			padding: 20rpx 30rpx;
-			.name{
+			background: linear-gradient(270deg, #fefeff 0%, #e1f7fe 100%);
+			padding: 0rpx 30rpx;
+			height: 92rpx;
+			.name {
 				font-weight: 600;
 				font-size: 36rpx;
 				color: #222222;
 			}
-			.status{
-				color: #279BAA;
-				font-weight: 500;
-				.time{
+			.status {
+				color: $uni-color-primary;
+				font-weight: 600;
+				text-align: right;
+				.time {
 					font-size: 24rpx;
 					font-weight: 360;
 				}
 			}
 		}
-		.content{
-			.info{
+		.content {
+			height: 180rpx;
+			.info {
 				display: flex;
 				padding: 24rpx 30rpx;
-				.plate{
+				.plate {
 					flex: 1;
 					display: flex;
 					align-items: center;
-					.icon{
+					.icon {
 						width: 26rpx;
 						height: 26rpx;
 						margin-right: 10rpx;
 					}
 				}
 			}
-			.sub{
+			.sub {
 				display: flex;
 				justify-content: space-between;
 				align-items: center;
-				padding: 0 30rpx 24rpx;
-				.time{
+				height: 68rpx;
+				padding: 0 30rpx 0;
+				.time {
 					font-size: 26rpx;
 					color: #999999;
 				}
-				.sub_btn{
+				.sub_btn {
 					height: 68rpx;
 					line-height: 68rpx;
 					padding: 0 34rpx;
-					color: #FFFFFF;
-					background: #279BAA;
-					box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(39,155,170,0.4);
+					color: #ffffff;
+					background: $uni-color-primary;
+					box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(39, 155, 170, 0.4);
 					border-radius: 40rpx;
 				}
 			}

--
Gitblit v1.9.3