Browse Source

司机端首页模块、登录逻辑

sunkuosheng 2 years ago
parent
commit
097ffc7a89

+ 18 - 0
api/company/transport.js

@@ -55,3 +55,21 @@ export function editTransport(data) {
 		'data': data
 	})
 }
+
+
+// 司机端获取关联企业列表
+export function driverCompany() {
+	return request({
+		'url': '/app/driver/driverCompany',
+		'method': 'get',
+	})
+}
+
+// 司机端企业在运行任务列表
+export function passList(data) {
+	return request({
+		'url': '/app/transportApply/passList',
+		'method': 'get',
+		'data': data
+	})
+}

+ 1 - 0
manifest.json

@@ -128,6 +128,7 @@
             "proxy" : {
                 "/prod-api" : {
                     "target" : "http://139.215.216.44:9008/prod-api", //线上
+					// "target" : "http://172.16.19.121:28080",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {

+ 6 - 0
pages.json

@@ -234,6 +234,12 @@
 				"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		}
+		,{
+			"path": "pages/driverEditInfo/index",
+			"style": {
+				"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		}
 		
 	],
 	// "tabBar": {

+ 384 - 0
pages/driverEditInfo/index.vue

@@ -0,0 +1,384 @@
+<template>
+	<view class="container">
+		<uni-navbar title="完善信息"></uni-navbar>
+		<view class="box">
+			<u--form :model="form" ref="uForm" :rules="rules" labelWidth="0"
+				class="formStyle addHeight commonBj commonMt">
+				<u-form-item prop="driverName">
+					<view class="redCircle"></view>
+					<text class="itemText">姓&emsp;&emsp;名</text>
+					<u-input class="inputStyle" v-model="form.driverName" placeholder="请输入司机姓名" />
+				</u-form-item>
+				<u-form-item prop="decryptCardNum">
+					<view class="redCircle"></view>
+					<text class="itemText">身份证号</text>
+					<u-input class="inputStyle" v-model="form.decryptCardNum" placeholder="请输入身份证号" />
+				</u-form-item>
+				<u-form-item prop="phone">
+					<view class="redCircle"></view>
+					<text class="itemText">联系电话</text>
+					<u-input class="inputStyle" v-model="form.phone" placeholder="请输入联系电话" />
+				</u-form-item>
+				<u-form-item prop="driverType" @click="clickType">
+					<view class="redCircleNo"></view>
+					<text class="itemText">驾照类型</text>
+					<u-input disabled disabledColor="rgba(0,0,0,0)" class="inputStyle" v-model="form.driverType"
+						suffixIcon="arrow-right" suffixIconStyle="color: #495B93" placeholder="请选择驾照类型" />
+				</u-form-item>
+				<u-form-item>
+					<view class="uploadBox">
+						<view class="textBox">
+							<view class="redCircleNo"></view>
+							<text class="itemText">驾驶证件(<text class="redText">确保证件清晰完整 </text>)</text>
+						</view>
+						<xfx-image-upload uploadTitle="上传驾驶证主页" uploadType="0" :max="1" :chooseNum="1"
+							v-model="fileList1" @uploadSuccess="UploadSuccessTruckCertificate"
+							@imgDelete="delTruckCertificate" mediaType="image">
+						</xfx-image-upload>
+						<xfx-image-upload uploadTitle="上传驾驶证副页" uploadType="0" :max="1" :chooseNum="1"
+							v-model="fileList2" @uploadSuccess="UploadSuccessTruckCertificate2"
+							@imgDelete="delTruckCertificate2" mediaType="image">
+						</xfx-image-upload>
+					</view>
+				</u-form-item>
+
+			</u--form>
+			<!-- <buttonNew  @click="submit" class="add-button commonMb" text="确认新增"></buttonNew> -->
+			<u-button @click="submit" shape="circle" color="linear-gradient(to top, #F59A02, #FFD334 )"
+				class="add-button buttonLang commonMb">确 认</u-button>
+		</view>
+
+		<selectNew :isShow="isShowType" :valueData="form.typeValue" :oldList="driverTypeData"
+			@changSelect="changSelectType"></selectNew>
+	</view>
+</template>
+
+<script>
+	import {
+		getDriverType,
+		getTeuckList,
+		driverInfo,
+		driverUpadate,
+	} from '../../api/company/user.js'
+	export default {
+		data() {
+			return {
+				isShow: false,
+				isShowType: false,
+				form: {
+					// id: this.$store.state.user.userId,
+					id: null,
+					truckId: null,
+					carValue: null,
+					driverName: null,
+					decryptCardNum: null,
+					phone: null,
+					driverType: null,
+					// companyId: '1023271044427829248',
+					companyId:null,
+					typeValue: null,
+				},
+				rules: {
+					truckId: [{
+						required: true,
+						message: '请选择车辆',
+						trigger: ['change']
+					}, ],
+					driverName: [{
+						required: true,
+						message: '请输入司机姓名',
+						trigger: ['blur', 'change']
+					}, ],
+					decryptCardNum: [{
+						required: true,
+						message: '请输入身份证号',
+						trigger: ['blur', 'change']
+					}, ],
+					phone: [{
+						required: true,
+						message: '请输入联系电话',
+						trigger: ['blur', 'change']
+					}, ],
+					driverType: [{
+						required: true,
+						message: '请选择驾照类型',
+						trigger: ['change']
+					}, ],
+				},
+				fileList1: [],
+				fileList2: [],
+				fileListData1: [],
+				fileListData2: [],
+				teuckList: [],
+				driverTypeData: []
+			}
+		},
+		onLoad(option) {
+			this.form.id = option.id;
+			this.getDriverType();
+			this.driverInfo();
+		},
+		methods: {
+			driverInfo() {
+				driverInfo(this.form.id).then(res => {
+					this.form = res.data;
+					if(this.form.imgList)
+					{
+						if(this.form.imgList[0]){
+							this.fileListData1.push(this.form.imgList[0])
+							this.fileList1.push(this.form.imgList[0].url)
+						}
+						if(this.form.imgList[1]){
+							this.fileListData2.push(this.form.imgList[1])
+							this.fileList2.push(this.form.imgList[1].url)
+						}
+					}
+					console.log(this.fileList1,'his.fileList1');
+				})
+			},
+			// 删除图片
+			delTruckCertificate(del, tempFilePaths) {
+				this.fileList1 = [];
+				this.fileListData1 = [];
+			},
+			delTruckCertificate2(del, tempFilePaths) {
+				this.fileList2 = [];
+				this.fileListData2 = [];
+			},
+			UploadSuccessTruckCertificate(res) {
+				/****************
+				因为上传接口返回的结构不一致,所以以下代码需要根据实际的接口返回结构开发,在此只是展示如果给数组里添加的过程,仅供参考
+				  ***************/
+				var _res = JSON.parse(res.data);
+				console.log(_res);
+				if (_res.code == 200) {
+					this.fileListData1.push(_res.data);
+					this.fileList1.push(_res.data.url)
+				}
+			},
+			UploadSuccessTruckCertificate2(res) {
+				/****************
+				因为上传接口返回的结构不一致,所以以下代码需要根据实际的接口返回结构开发,在此只是展示如果给数组里添加的过程,仅供参考
+				  ***************/
+				var _res = JSON.parse(res.data);
+				console.log(_res);
+				if (_res.code == 200) {
+					this.fileListData2.push(_res.data);
+					this.fileList2.push(_res.data.url)
+				}
+			},
+			getDriverType() {
+				getDriverType().then(res => {
+					this.driverTypeData = res.data.map(item => {
+						return {
+							name: item.dictLabel,
+							value: item.dictValue
+						}
+					})
+				})
+			},
+		   clickCar() {
+				this.isShow = true
+			},
+			changSelect(data) {
+				this.isShow = false
+				if (data && data.value) {
+					this.form.truckId = data.value;
+					this.form.carValue = data.name;
+				}
+			},
+			clickType() {
+				this.isShowType = true
+			},
+			changSelectType(data) {
+
+				this.isShowType = false
+				if (data && data.value) {
+					this.form.driverType = data.name;
+					this.form.typeValue = data.value;
+				}
+			},
+			// 删除图片
+			deletePic(event) {
+
+				this[`fileList${event.name}`].splice(event.index, 1)
+			},
+			// 新增图片
+			async afterRead(event) {
+				// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				console.log(event, 'event');
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url)
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+				}
+			},
+			uploadFilePromise(url) {
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
+						filePath: url,
+						name: 'file',
+						formData: {
+							user: 'test'
+						},
+						success: (res) => {
+							setTimeout(() => {
+								resolve(res.data.data)
+							}, 1000)
+						}
+					});
+				})
+			},
+			driverUpadate(){
+				let imgList=[];
+				if(this.fileListData1.length>0)
+				{
+					imgList.push(this.fileListData1[0])
+				}
+				if(this.fileListData2.length>0)
+				{
+					imgList.push(this.fileListData2[0])
+				}
+				driverUpadate({...this.form,imgList:imgList,cardNum:this.form.decryptCardNum}).then(res=>{
+					this.$tab.navigateBack()
+				})
+			},
+			// 提交
+			submit() {
+				this.$refs.uForm.validate().then(res => {
+					console.log(res,'111')
+					this.driverUpadate();
+				}).catch(errors => {
+				console.log(errors,'222')
+				})
+			}
+		},
+
+	}
+</script>
+
+
+<style lang="scss" scoped>
+	.formStyle {
+		padding: 41rpx 39rpx;
+	}
+
+	.uploadImg {
+		width: 599rpx !important;
+		height: 270rpx !important;
+		background: rgba(255, 255, 255, 0.1);
+		border: 2rpx solid #495B93;
+		border-radius: 15rpx;
+		margin-top: 30rpx;
+
+		/deep/ .u-upload__wrap__preview {
+			overflow: visible;
+		}
+
+		/deep/ .u-upload__deletable {
+			width: 30rpx;
+			height: 30rpx;
+			// background-color: #FC5536;
+			background-image: url(../../static/images/user/redClose.png);
+			background-color: rgba(0, 0, 0, 0);
+			background-size: 100% 100%;
+			border-radius: 50%;
+			position: absolute;
+			top: -20rpx;
+			right: -20rpx;
+
+			.u-upload__deletable__icon {
+				position: absolute;
+				top: 50%;
+				transform: translateY(-50%);
+			}
+		}
+
+		/deep/ .u-icon__icon {
+			font-size: 0 !important;
+		}
+	}
+
+	// 上传组件样式
+	.uploadBox {
+		width: 100%;
+
+		.u-upload__wrap__preview__image {
+			width: 598rpx !important;
+			height: 250rpx !important;
+			border-radius: 13rpx;
+		}
+
+		/deep/.xfx-image-upload-list {
+			display: block;
+			margin-top: 30rpx;
+			border: 2rpx solid #495B93;
+			border-radius: 15rpx;
+			height: 250rpx;
+
+			.xfx-image-upload-Item {
+				width: 100%;
+				height: 100%;
+				margin-right: 0;
+				margin-bottom: 0;
+				background-color: rgba(255, 255, 255, 0.1);
+			}
+
+			.xfx-image-upload-Item-add {
+				padding-top: 84rpx;
+			}
+		}
+	}
+
+
+	.textBox {
+		display: flex;
+		align-items: center;
+	}
+
+	.plus-icon {
+		width: 599rpx;
+		height: 270rpx;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.mt {
+		margin-top: 31rpx;
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #495B93;
+	}
+
+	.imgAdd {
+		width: 51rpx;
+		height: 51rpx;
+		background-image: url(../../static/images/user/add.png);
+		background-size: 100% 100%;
+	}
+
+	.add-button {
+		margin-top: 27rpx;
+	}
+
+	/deep/ uni-image {
+		border-radius: 15rpx;
+	}
+</style>

+ 387 - 2
pages/driverFinishTransport/index.vue

@@ -1,8 +1,393 @@
 <template>
+	<view class="container">
+		<uni-navbar title="完成运输" path="/pages/diverHome/index"></uni-navbar>
+		<view class="box">
+			<!-- <u-button class="commonMt custom-style" shape="circle" @click="addLine"
+				color="linear-gradient(to top, #F59A02, #FFD334)">
+				<view class="button-class">
+					<image style="width: 29rpx;height: 29rpx;" src="../../static/images/transport/plus.png"
+						mode="widthFix">
+					</image>
+					<text style="margin-left: 19rpx;">新增运输</text>
+				</view>
+			</u-button> -->
+			<!-- <view class="box2"> -->
+				<view class="commonMb">
+					<view @tap="goToDetial(item)" class="small-box commonBj" v-for="(item,index) in list"
+						:key="item.id">
+						<view class="small-box-top">
+							<view class="small-box-top-left">
+								<image style="width: 35rpx;height: 35rpx;margin-left: 11rpx;"
+									:src="item.auditState===0? '../../static/images/transport/state1.png': item.auditState===-1? '../../static/images/transport/state2.png':'../../static/images/transport/state3.png'"
+									mode="widthFix">
+								</image>
+								<text>{{ item.transportName }}</text>
+							</view>
+							<view :class="changeStateClass(item.auditState)" class="small-box-top-right">
+								<text>{{item.auditState===0? '待审核':item.auditState===-1?'驳 回':'通 过'}}</text>
+							</view>
+						</view>
+						<view class="small-box-middle">
+							<view class="small-box-middle-startAndEnd" style="margin-bottom: -6rpx;">
+								<view>
+									<view class="circle-green circle-style">
+										起
+									</view>
+								</view>
+
+								<!-- <text class="deepGreen bold">起点:</text> -->
+								<text class="green" style="width: 70%;">{{item.startName}}</text>
+							</view>
+							<view class="small-box-middle-line">
+								<view class="small-box-middle-line-left">
+								</view>
+								<!-- <view class="small-box-middle-line-right commonLine">
+								</view> -->
+							</view>
+							<view class="small-box-middle-startAndEnd" style="margin-top: -6rpx;">
+								<view class="circle-red circle-style">
+									终
+								</view>
+								<!-- <text class="deepRed bold">终点:</text> -->
+								<text class="red" style="width: 70%;">{{item.endName}}</text>
+							</view>
+						</view>
+						<view class="small-box-date">
+							<image style="width: 24rpx;height: 24rpx;margin-left: 10rpx;"
+								src="../../static/images/transport/rili.png" mode="widthFix">
+							</image>
+							<text class="ml19 font-size-style">
+								日期:{{changeDate(item.startDate)}} — {{changeDate(item.endDate)}}
+							</text>
+						</view>
+						<view class="small-box-bottom mt23">
+							<view class="small-box-bottom-left">
+								<image style="width: 25rpx;height: 25rpx;margin-left: 10rpx;"
+									src="../../static/images/transport/time.png" mode="widthFix"></image>
+								<text class="ml19 font-size-style">
+									时间:{{changeTime(item.startTime)}} — {{changeTime(item.endTime)}}
+								</text>
+							</view>
+							<view class="small-box-bottom-left">
+								<image style="width: 25rpx;height: 25rpx;" src="../../static/images/transport/lb_01.png"
+									mode="">
+								</image>
+								<text class="mr15 ml19 font-size-style">计划使用车辆数:{{item.expectCar}} 辆</text>
+							</view>
+						</view>
+					</view>
+				</view>
+			<!-- </view> -->
+		</view>
+	</view>
 </template>
 
 <script>
+	import {
+		getTransport
+	} from "../../api/company/transport.js"
+	export default {
+		data() {
+			return {
+				list: [
+					// {
+					// 	id: '1',
+					// 	name: '蓝天建筑 0819023',
+					// 	state: '0',
+					// 	start: '宽城区光机路新星宇·之悦工地现场',
+					// 	end: '米沙子渣土处理垃圾站',
+					// 	startDate: '20220829',
+					// 	endDate: '20220901',
+					// 	startTime: '15:00',
+					// 	endTime: '18:00',
+					// 	count: '3'
+					// },
+					// {
+					// 	id: '2',
+					// 	name: '蓝天建筑 0819023',
+					// 	state: '1',
+					// 	start: '汽开区32街区',
+					// 	end: '上城碧水华庭',
+					// 	startDate: '20220829',
+					// 	endDate: '20220901',
+					// 	startTime: '09:00',
+					// 	endTime: '12:00',
+					// 	count: '10'
+					// },
+					// {
+					// 	id: '3',
+					// 	name: '蓝天建筑 0819023',
+					// 	state: '2',
+					// 	start: '北湖区中海尚学府',
+					// 	end: '朝阳区欧亚卖场',
+					// 	startDate: '20220701',
+					// 	endDate: '20220702',
+					// 	startTime: '12:00',
+					// 	endTime: '19:00',
+					// 	count: '5'
+					// },
+					// {
+					// 	id: '4',
+					// 	name: '蓝天建筑 0819023',
+					// 	state: '2',
+					// 	start: '北湖区中海尚学府',
+					// 	end: '朝阳区欧亚卖场',
+					// 	startDate: '20220701',
+					// 	endDate: '20220702',
+					// 	startTime: '12:00',
+					// 	endTime: '19:00',
+					// 	count: '5'
+					// },
+					// {
+					// 	id: '5',
+					// 	name: '蓝天建筑 0819023',
+					// 	state: '2',
+					// 	start: '北湖区中海尚学府',
+					// 	end: '朝阳区欧亚卖场',
+					// 	startDate: '20220701',
+					// 	endDate: '20220702',
+					// 	startTime: '12:00',
+					// 	endTime: '19:00',
+					// 	count: '5'
+					// }
+				],
+				queryParams: {
+					pageSize: 1000,
+					pageNum: 1
+				},
+				total: 0
+			}
+		},
+		methods: {
+			// 跳转 
+			// 通过和驳回跳转,待审核不跳
+			goToDetial(item) {
+				if (item.auditState === -1) {
+					this.$tab.navigateTo(`/pages/addTransport/index?id=${item.id}&state=${item.auditState}`)
+				}
+				if (item.auditState === 1) {
+					this.$tab.navigateTo(`/pages/transportInfo/index?id=${item.id}`)
+				}
+			},
+			addLine() {
+				this.$tab.navigateTo('/pages/addTransport/index')
+			},
+			changeStateClass(state) {
+				switch (state) {
+					case 0:
+						return 'state-class1'
+					case -1:
+						return 'state-class2'
+					case 1:
+						return 'state-class3'
+				}
+			},
+			changeDate(date) {
+				return date.substring(0, 4) + '年' + date.substring(5, 7) + '月' + date.substring(8, 10)
+			},
+			changeTime(time) {
+				return time.slice(0, 5)
+			},
+			// 获取运输列表
+			async getList() {
+				const res = await getTransport(this.queryParams)
+				console.log('运输列表', res);
+				this.total = res.total
+				this.list = res.rows
+				console.log(this.list);
+			}
+		},
+		onLoad() {
+			this.getList()
+		}
+	}
 </script>
 
-<style>
-</style>
+<style lang="scss" scoped>
+	.deepRed {
+		color: #E54504
+	}
+
+	.deepGreen {
+		color: #088243
+	}
+
+	.red {
+		color: #FF6424;
+	}
+
+	.green {
+		color: #45AC77;
+
+
+	}
+
+	.circle-style {
+		width: 40rpx;
+		height: 40rpx;
+		line-height: 40rpx;
+		text-align: center;
+		border-radius: 50%;
+		font-size: 20rpx;
+		font-weight: bold;
+		color: #FFFFFF;
+		// padding: 7px;
+	}
+
+	.circle-green {
+		background: #45AC77;
+	}
+
+	.circle-red {
+		background: #FF6424;
+	}
+
+	.bold {
+		font-weight: bold;
+	}
+
+	.custom-style {
+		font-size: 28rpx;
+		height: 66rpx;
+		line-height: 66rpx;
+		font-size: 28rpx;
+		font-weight: bold;
+		color: #FFFFFF;
+		margin-bottom: 25rpx;
+
+		.button-class {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+		}
+	}
+
+	.small-box {
+		margin-bottom: 31rpx;
+		padding: 22rpx;
+
+		.small-box-top {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			.small-box-top-left {
+				display: flex;
+				align-items: center;
+
+				uni-text {
+					font-size: 28rpx;
+					font-weight: bold;
+					color: #333333;
+					margin-left: 18rpx;
+				}
+
+			}
+
+			.small-box-top-right {
+				text-align: center;
+				width: 103rpx;
+				height: 45rpx;
+				border-radius: 15rpx;
+				font-size: 26rpx;
+				font-weight: bold;
+				color: #FFFFFF;
+				line-height: 45rpx;
+			}
+		}
+
+		.small-box-middle {
+			// width: 631rpx;
+			// height: 144rpx;
+			background: rgba(245, 246, 250, 0.5);
+			border: 1rpx solid rgba(235, 235, 235, 0.5);
+			border-radius: 20rpx;
+			margin-top: 20rpx;
+			padding: 20rpx 28rpx;
+			box-sizing: border-box;
+
+			.small-box-middle-startAndEnd {
+				display: flex;
+				align-items: center;
+				font-size: 24rpx;
+				font-weight: bold;
+
+				uni-text {
+					margin-left: 22rpx;
+				}
+			}
+
+			.small-box-middle-line {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+
+				.small-box-middle-line-left {
+					width: 2rpx;
+					height: 20rpx;
+					background: rgba(238, 238, 238, 0.5);
+					border-radius: 1rpx;
+					// margin-left: 20rpx;
+					// margin-top: 2rpx;
+					// margin-bottom: 2rpx;
+					margin: 10rpx 20rpx;
+				}
+
+				.small-box-middle-line-right {
+					width: 552rpx;
+					margin-left: 15rpx;
+				}
+			}
+		}
+
+		.small-box-date {
+			display: flex;
+			align-items: center;
+			margin-top: 24rpx;
+		}
+
+		.small-box-bottom {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			.small-box-bottom-left {
+				display: flex;
+				align-items: center;
+			}
+		}
+	}
+
+
+	.ml19 {
+		margin-left: 10rpx;
+	}
+
+	.mt23 {
+		margin-top: 23rpx;
+	}
+
+	.mr15 {
+		margin-right: 15rpx;
+	}
+
+	.font-size-style {
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #485B93;
+	}
+
+	.state-class1 {
+		background: linear-gradient(90deg, #F59A02 0%, #FFD334 100%);
+	}
+
+	.state-class2 {
+
+		background: linear-gradient(90deg, #FF2D04 0%, #FFA53E 100%);
+	}
+
+	.state-class3 {
+
+		background: linear-gradient(90deg, #3FC377 0%, #83D992 100%);
+	}
+</style>

+ 58 - 97
pages/driverHome/index.vue

@@ -82,78 +82,34 @@
 				</view>
 			</view>
 		</view>
-		<view v-if="tabbarName==='firm'" class="box" style="overflow: hidden;">
-			<!-- 按钮区域 -->
-			<view class="button-box commonMt">
-				<view :class="'car-box ' + (isCarInfo?'active':'')" @click="carbButtonClick">
-					<image style="width: 31rpx;height: 28rpx;" src="../../static/images/home/truck1_fill.png"
-						mode="widthFix"></image>
-					<text>企业车辆</text>
-				</view>
-				<view :class="'car-box ' + (isCarInfo?'':'active')" @click="personbButtonClick">
-					<image style="width: 33rpx;height: 28rpx;" src="../../static/images/home/duoren_1.png"
-						mode="widthFix"></image>
-					<text>企业人员</text>
-				</view>
-			</view>
-			<!-- 车辆信息 -->
-			<view class="box2 firmHeight" v-if="isCarInfo">
-				<view class="commonMb">
-					<view class="car-content" @tap="gotoCarInfo(item.id)" v-for="item in carList" :key="item.num">
-						<view class="car-info commonBj">
-							<view class="carInfo-top">
-								<view class="top-left">
-									<image style="width: 60rpx;height: 60rpx;" src="../../static/images/home/huoche.png"
-										mode="widthFix"></image>
-									<text>{{item.carNumber}}</text>
-								</view>
-								<view class="top-right  listText">
-									<image style="width: 22rpx;height: 22rpx;" src="../../static/images/car/lb_03.png"
-										mode="widthFix"></image>
-									<text>载重量:{{item.carCarry}}</text>
-								</view>
-							</view>
-							<view class="carinfo-bottom listText" style="margin-top: 20rpx;">
-								<image style="width: 22rpx;height: 22rpx;" src="../../static/images/car/lb_01.png"
-									mode="widthFix"></image>
-								<text>车&nbsp;&nbsp;&nbsp;&nbsp;型:{{item.carType}}</text>
-							</view>
-							<view class="carinfo-bottom mt27 listText">
-								<image style="width: 22rpx;height: 22rpx;" src="../../static/images/car/lb_02.png"
-									mode="widthFix"></image>
-								<text>车&nbsp;&nbsp;&nbsp;&nbsp;系:{{item.carSeries}}</text>
-							</view>
-						</view>
-					</view>
-
-				</view>
-			</view>
-			<!-- 人员信息 -->
-			<view class="box2 firmHeight" v-else>
+		<view v-if="tabbarName==='firm'" class="box">
 				<view class="commonMb">
-					<view class="car-content" @tap="gotoPersonInfo(item.id)" v-for="item in personList" :key="item.id">
-						<view class="car-info commonBj">
-							<view class="person-top">
+					<view class="car-content" @tap="gotoPersonInfo(item)" v-for="item in personList" :key="item.id">
+						<view class="car-info" :class="driverID===item.id? 'active':'not-active'" >
+							<!-- :class="driverID===item.id? 'active':'not-active'" -->
+							<view class="person-top" >
 								<image style="width: 60rpx;height: 60rpx;" src="../../static/images/user/user.png"
 									mode="widthFix"></image>
-								<text>{{ item.driverName }}</text>
+								<text>{{ item.companyName }}</text>
+								<view class="active-img"></view>
+								<!-- v-if="driverID===item.id" -->
+								<!-- <image  class="active-img" src="@/static/images/transport/active.png" mode="widthFix"></image> -->
 							</view>
 							<view class="person-bottom" style="margin-top: 20rpx;">
 								<view class="carinfo-bottom listText">
 									<image style="width: 22rpx;height: 22rpx;" src="../../static/images/car/lb_01.png"
 										mode="widthFix"></image>
-									<text>车牌号:{{item.carNumber ?item.carNumber :'未绑定车辆'}}</text>
+									<text>运输任务:{{item.transportNum}}</text>
 								</view>
 								<view class="carinfo-bottom listText">
 									<image style="width: 22rpx;height: 22rpx;" src="../../static/images/user/phone.png"
 										mode="widthFix"></image>
-									<text>电 话:{{item.phone}}</text>
+									<text>电&emsp;话:{{item.phoneNumber}}</text>
 								</view>
 							</view>
 						</view>
 					</view>
 				</view>
-			</view>
 		</view>
 		<view v-if="tabbarName==='my'" class="box homeHeight width100">
 			<view class="commonMt">
@@ -167,7 +123,7 @@
 					</view>
 				</view>
 				<view class="avstarInfo ">
-					<view class="info-box" @tap="goTo('/pages/editInfo/index')">
+					<view class="info-box" @tap="goTo('/pages/driverEditInfo/index?id='+driverID)">
 						<image style="width: 78rpx;" src="../../static/images/home/bianjiwenjian.png" mode="widthFix">
 						</image>
 						<text class="mt28">修改信息</text>
@@ -252,11 +208,8 @@
 <script>
 	import homeHint from "../../components/homeHint.vue"
 	import {
-		carList,
-	} from "@/api/company/car.js"
-	import {
-		getUserState
-	} from '@/api/company/user.js'
+		driverCompany
+	} from '@/api/company/transport.js'
 	import {
 		versionList
 	} from "@/api/company/my.js"
@@ -269,12 +222,7 @@
 				weburl: 'http://jl.122.gov.cn/',
 				// 版本更新开关
 				isUpdateShow: false,
-				// 车辆信息或者人员信息
-				isCarInfo: true,
-				// 车辆信息数据列表
-				carList: [
-				],
-				// 人员信息数据列表
+				// 企业数据列表数据列表
 				personList: [
 				],
 				safetyData: [{
@@ -326,10 +274,13 @@
 				companyName:this.$store.state.user.nickName,
 				userName:this.$store.state.user.userName,
 				show:false,
+				driverID:null,
 				
 			}
 		},
-		onLoad() {},
+		onLoad() {
+			this.driverCompany();
+		},
 		onShow() {
 			// this.show = true;
 		},
@@ -352,21 +303,17 @@
 			},
 			changeTabbarName(name){
 				this.tabbarName = name
-				if(name=='firm')
-				{
-					this.carListData();
-					this.getUserState();
-				}
+				// if(name=='firm')
+				// {
+				// 	this.driverCompany();
+				// }
 				
 			},
-			carListData(){
-				carList().then(res=>{
-					this.carList=res.rows
-				})
-			},
-			getUserState(){
-				getUserState().then(res=>{
-					this.personList=res.rows
+			
+			driverCompany(){
+				driverCompany().then(res=>{
+					this.personList=res.data;
+					this.driverID=res.data[0].id;
 				})
 			},
 			getKpi(url){
@@ -417,7 +364,7 @@
 			getTile() {
 				switch (this.tabbarName) {
 					case 'firm':
-						return '辉南渣土车运输-移动端';
+						return '企业选择';
 						break;
 					case 'my':
 						return '个人中心';
@@ -434,18 +381,9 @@
 			gotoCarInfo(id) {
 				this.$tab.navigateTo(`/pages/carInfo/index?id=${id}&isHomeInfo=true`)
 			},
-			gotoPersonInfo(id) {
-				this.$tab.navigateTo(`/pages/userInfo/index?id=${id}&isHomeInfo=true`)
-			},
-			confirm() {
-				console.log('我搜索了')
-			},
-			carbButtonClick() {
-				this.isCarInfo = true
+			gotoPersonInfo(item) {
+                this.driverID=item.id;
 			},
-			personbButtonClick() {
-				this.isCarInfo = false
-			}
 		}
 	}
 </script>
@@ -611,6 +549,7 @@
 	.person-top {
 		display: flex;
 		align-items: center;
+		position: relative;
 
 		uni-text {
 			font-size: 28rpx;
@@ -627,10 +566,10 @@
 		margin-bottom: 30rpx;
 	}
 
-	.active {
-		background: linear-gradient(0deg, #F59A02 0%, #FFD334 100%) !important;
-		box-shadow: 0px 2rpx 13rpx 0px rgba(27, 43, 95, 0.25) !important;
-	}
+	// .active {
+	// 	background: linear-gradient(0deg, #F59A02 0%, #FFD334 100%) !important;
+	// 	box-shadow: 0px 2rpx 13rpx 0px rgba(27, 43, 95, 0.25) !important;
+	// }
 
 	.button-box {
 		display: flex;
@@ -670,6 +609,10 @@
 		padding: 18rpx 30rpx;
 		box-sizing: border-box;
 		// margin-top: 24rpx;
+		// background: rgba(255,255,255,0.9);
+		border: 2rpx solid #77A8FF;
+		// box-shadow: 0px 0px 24rpx 6rpx rgba(109,160,251,0.6);
+		border-radius: 28rpx;
 
 		.carInfo-top {
 			display: flex;
@@ -1086,4 +1029,22 @@
 		overflow-y: auto;
 		height: calc(100vh - 44px - 22px - 70px - 22rpx - 140rpx - 19rpx - 27rpx - 40rpx - 180rpx - 20rpx - 52rpx - 26rpx - 50rpx + 112rpx);
 	}
+	
+	
+	.active-img {
+		width: 70rpx;
+		height: 70rpx;
+		// margin-right: 15rpx;
+		position: absolute;
+		right: 0;
+		background: url('@/static/images/transport/active.png') no-repeat;
+		background-size: 100% 100%;
+	}
+	.active {
+		background: rgba(255, 255, 255, 0.9);
+	}
+	.not-active {
+		background: rgba(245, 246, 250, 0.5);
+	}
+	
 </style>

+ 353 - 2
pages/driverStartTransport/index.vue

@@ -1,8 +1,359 @@
 <template>
+	<view class="container">
+		<uni-navbar title="启动运输" path="/pages/driverHome/index"></uni-navbar>
+		<view class="box" style="overflow: hidden;">
+			<u-button class="commonMt custom-style" shape="circle" @click="addLine"
+				color="linear-gradient(to top, #F59A02, #FFD334)">
+				<view class="button-class">
+					<!-- <image style="width: 29rpx;height: 29rpx;" src="../../static/images/transport/plus.png"
+						mode="widthFix">
+					</image> -->
+					<text style="margin-left: 19rpx;">启动运输</text>
+					<view style="width: 29px;height: 15px;border: solid 1px red"></view>
+				</view>
+			</u-button>
+			<view class="box2">
+				<view class="commonMb">
+					<view  class="small-box commonBj" v-for="(item,index) in list"
+						:key="item.id">
+						<view class="small-box-top">
+							<view class="small-box-top-left">
+								<image style="width: 51rpx;height: 51rpx;margin-left: 11rpx;"
+									src="../../static/images/driverHome/sj_06.png"
+									mode="widthFix">
+								</image>
+								<text>{{ item.transportName }}</text>
+							</view>
+						
+								<u-button @click="starTransport" class="miniButton" shape="circle" color="linear-gradient(to top, #F59A02, #FFD334 )">启 动</u-button>
+							
+							<!-- <view :class="changeStateClass(item.auditState)" class="small-box-top-right">
+								<text>{{item.auditState===0? '待审核':item.auditState===-1?'驳 回':'通 过'}}</text>
+							</view> -->
+						</view>
+						<view class="small-box-middle">
+							<view class="small-box-middle-startAndEnd" style="margin-bottom: -6rpx;">
+								<view>
+									<view class="circle-green circle-style">
+										起
+									</view>
+								</view>
+
+								<!-- <text class="deepGreen bold">起点:</text> -->
+								<text class="green" style="width: 70%;">{{item.startName}}</text>
+							</view>
+							<view class="small-box-middle-line">
+								<view class="small-box-middle-line-left">
+								</view>
+								<!-- <view class="small-box-middle-line-right commonLine">
+								</view> -->
+							</view>
+							<view class="small-box-middle-startAndEnd" style="margin-top: -6rpx;">
+								<view class="circle-red circle-style">
+									终
+								</view>
+								<!-- <text class="deepRed bold">终点:</text> -->
+								<text class="red" style="width: 70%;">{{item.endName}}</text>
+							</view>
+						</view>
+						<view class="small-box-date">
+							<image style="width: 24rpx;height: 24rpx;margin-left: 10rpx;"
+								src="../../static/images/transport/rili.png" mode="widthFix">
+							</image>
+							<text class="ml19 font-size-style">
+								日期:{{changeDate(item.startDate)}} — {{changeDate(item.endDate)}}
+							</text>
+						</view>
+						<view class="small-box-bottom mt23">
+							<view class="small-box-bottom-left">
+								<image style="width: 25rpx;height: 25rpx;margin-left: 10rpx;"
+									src="../../static/images/transport/time.png" mode="widthFix"></image>
+								<text class="ml19 font-size-style">
+									时间:{{changeTime(item.startTime)}} — {{changeTime(item.endTime)}}
+								</text>
+							</view>
+							<!-- <view class="small-box-bottom-left">
+								<image style="width: 25rpx;height: 25rpx;" src="../../static/images/transport/lb_01.png"
+									mode="">
+								</image>
+								<text class="mr15 ml19 font-size-style">计划使用车辆数:{{item.expectCar}} 辆</text>
+							</view> -->
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
+	import {
+	driverCompany,passList
+	} from "../../api/company/transport.js"
+	export default {
+		data() {
+			return {
+				list: [],
+				queryParams: {
+					// pageSize: 1000,
+					// pageNum: 1
+					// userId:this.$store.state.user.userId,
+					companyId:'',
+					driverId:'',
+				},
+				companyList:[],
+				total: 0
+			}
+		},
+		methods: {
+			starTransport(){
+				
+			},
+			// 跳转 
+			// 通过和驳回跳转,待审核不跳
+			goToDetial(item) {
+				if (item.auditState === -1) {
+					this.$tab.navigateTo(`/pages/addTransport/index?id=${item.id}&state=${item.auditState}`)
+				}
+				if (item.auditState === 1) {
+					this.$tab.navigateTo(`/pages/transportInfo/index?id=${item.id}`)
+				}
+			},
+			addLine() {
+				this.$tab.navigateTo('/pages/addTransport/index')
+			},
+			changeStateClass(state) {
+				switch (state) {
+					case 0:
+						return 'state-class1'
+					case -1:
+						return 'state-class2'
+					case 1:
+						return 'state-class3'
+				}
+			},
+			changeDate(date) {
+				return date.substring(0, 4) + '年' + date.substring(5, 7) + '月' + date.substring(8, 10)
+			},
+			changeTime(time) {
+				return time.slice(0, 5)
+			},
+			// 获取运输列表
+			async getList() {
+			 await passList(this.queryParams).then(res=>{
+				 // console.log(res,'111');
+				 this.list=res.rows;
+			 })
+				
+			},
+			async driverCompany(){
+				 await driverCompany().then(res=>{
+					 this.queryParams.companyId=res.data[0].companyId;
+					 this.queryParams.driverId=res.data[0].id;
+					 this.companyList=res.data;
+					 this.getList();
+				 })
+			},
+		},
+		onLoad() {
+			this.driverCompany()
+		}
+	}
 </script>
 
-<style>
-</style>
+<style lang="scss" scoped>
+	.deepRed {
+		color: #E54504
+	}
+
+	.deepGreen {
+		color: #088243
+	}
+
+	.red {
+		color: #FF6424;
+	}
+
+	.green {
+		color: #45AC77;
+
+
+	}
+
+	.circle-style {
+		width: 40rpx;
+		height: 40rpx;
+		line-height: 40rpx;
+		text-align: center;
+		border-radius: 50%;
+		font-size: 20rpx;
+		font-weight: bold;
+		color: #FFFFFF;
+		// padding: 7px;
+	}
+
+	.circle-green {
+		background: #45AC77;
+	}
+
+	.circle-red {
+		background: #FF6424;
+	}
+
+	.bold {
+		font-weight: bold;
+	}
+
+	.custom-style {
+		font-size: 28rpx;
+		height: 66rpx;
+		line-height: 66rpx;
+		font-size: 28rpx;
+		font-weight: bold;
+		color: #FFFFFF;
+		margin-bottom: 25rpx;
+
+		.button-class {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+		}
+	}
+
+	.small-box {
+		margin-bottom: 31rpx;
+		padding: 22rpx;
+
+		.small-box-top {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			.small-box-top-left {
+				display: flex;
+				align-items: center;
+
+				uni-text {
+					font-size: 28rpx;
+					font-weight: bold;
+					color: #333333;
+					margin-left: 18rpx;
+				}
+
+			}
+
+			.small-box-top-right {
+				text-align: center;
+				width: 103rpx;
+				height: 45rpx;
+				border-radius: 15rpx;
+				font-size: 26rpx;
+				font-weight: bold;
+				color: #FFFFFF;
+				line-height: 45rpx;
+			}
+		}
+
+		.small-box-middle {
+			// width: 631rpx;
+			// height: 144rpx;
+			background: rgba(245, 246, 250, 0.5);
+			border: 1rpx solid rgba(235, 235, 235, 0.5);
+			border-radius: 20rpx;
+			margin-top: 20rpx;
+			padding: 20rpx 28rpx;
+			box-sizing: border-box;
+
+			.small-box-middle-startAndEnd {
+				display: flex;
+				align-items: center;
+				font-size: 24rpx;
+				font-weight: bold;
+
+				uni-text {
+					margin-left: 22rpx;
+				}
+			}
+
+			.small-box-middle-line {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+
+				.small-box-middle-line-left {
+					width: 2rpx;
+					height: 20rpx;
+					background: rgba(238, 238, 238, 0.5);
+					border-radius: 1rpx;
+					// margin-left: 20rpx;
+					// margin-top: 2rpx;
+					// margin-bottom: 2rpx;
+					margin: 10rpx 20rpx;
+				}
+
+				.small-box-middle-line-right {
+					width: 552rpx;
+					margin-left: 15rpx;
+				}
+			}
+		}
+
+		.small-box-date {
+			display: flex;
+			align-items: center;
+			margin-top: 24rpx;
+		}
+
+		.small-box-bottom {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			.small-box-bottom-left {
+				display: flex;
+				align-items: center;
+			}
+		}
+	}
+
+
+	.ml19 {
+		margin-left: 10rpx;
+	}
+
+	.mt23 {
+		margin-top: 23rpx;
+	}
+
+	.mr15 {
+		margin-right: 15rpx;
+	}
+
+	.font-size-style {
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #485B93;
+	}
+
+	.state-class1 {
+		background: linear-gradient(90deg, #F59A02 0%, #FFD334 100%);
+	}
+
+	.state-class2 {
+
+		background: linear-gradient(90deg, #FF2D04 0%, #FFA53E 100%);
+	}
+
+	.state-class3 {
+
+		background: linear-gradient(90deg, #3FC377 0%, #83D992 100%);
+	}
+	.miniButton{
+		width: 112rpx;
+		height: 45rpx;
+		font-size: 26rpx;
+		font-weight: bold;
+		color: #FFFFFF;
+		margin-right: 0;
+	}
+</style>

File diff suppressed because it is too large
+ 7 - 4
pages/login/index.vue


+ 8 - 0
store/modules/user.js

@@ -39,9 +39,15 @@ const user = {
 		rolesName:storage.get(constant.rolesName),
 		//司机姓名
 		nickName:storage.get(constant.nickName),
+		//司机ID
+		userId:storage.get(constant.userId),
 	},
 
 	mutations: {
+        SET_USERID: (state, userId) => {
+			state.userId = userId
+			storage.set(constant.userId, userId)
+		},		
 		SET_NICKNAME: (state, nickName) => {
 			state.nickName = nickName
 			storage.set(constant.nickName, nickName)
@@ -133,7 +139,9 @@ const user = {
 					}else if(res.data.user=='mt_driver'){
 						name='司机'
 					}
+					
 					commit('SET_ROLESNAME', name)
+					commit('SET_USERID', res.data.userId)
 					commit('SET_COMPANYID', res.data.companyId)
 					commit('SET_COMPANYNAME', res.data.companyName)
 					commit('SET_COMPANYABBREVIATION', res.data.companyAbbreviation)

+ 2 - 1
utils/constant.js

@@ -9,7 +9,8 @@ const constant = {
 	userName: 'vuex_userName',
 	roles: 'vuex_roles',
 	rolesName: 'vuex_rolesName',
-	nickName:'vuex_nickName'
+	nickName:'vuex_nickName',
+	userId:'vuex_userId'
 }
 
 export default constant