<template>
	<view class="center">
		<view>
			<view class="labels">司机信息</view>
			<button type="default">身份证正面</button>
			<view style="width: 100px;margin: 0 auto;" v-if="idup != ''">
				<image v-bind:src="idup" style="width: 100px;height: 100px;"></image>
			</view>
			<button type="default">身份证反面</button>
			<view style="width: 100px;margin: 0 auto;" v-if="idlow != ''">
				<image v-bind:src="idlow" style="width: 100px;height: 100px;"></image>
			</view>
			<view class="c-row b-b">
				<text class="tit">姓名</text>
				<view class="con-list">
					{{drivers.driverName}}
				</view>
			</view>
			<view class="c-row b-b">
				<text class="tit">身份证号</text>
				<view class="con-list">
					{{drivers.numberCard}}
				</view>
			</view>
			<view class="c-row b-b">
				<text class="tit">手机号</text>
				<view class="con-list">
					{{drivers.driverPhone}}
				</view>
			</view>
			<view class="c-row b-b">
				<text class="tit">常驻城市</text>
				<view class="con-list">
					{{drivers.residentCityProvincial}}
				</view>
			</view>


		</view>
		<view class="margin-top">
			<view class="labels">货车信息</view>
			<view v-for="(item , index) in  drivers.driverCarInfoList" :Key="index">


				<view class="labels"> 车辆 -{{index+1}}</view>
				<view class="c-row b-b">
					<text class="tit">车牌号</text>
					<view class="con-list">
						{{item.carNumber}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">车型</text>
					<view class="con-list">
						{{item.carModel}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">不含车头车长（米）</text>
					<view class="con-list">
						{{item.carLength}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">载重（吨）</text>
					<view class="con-list">
						{{item.carLoad}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">出厂年份</text>
					<view class="con-list">
						{{item.yearManufacture}}
					</view>
				</view>
			</view>

		</view>
		<view class="margin-top">
			<view class="labels">账户信息</view>
			<view v-for="(items , index) in  drivers.driverPayeeInfoList" :Key="index">


				<view class="labels"> 账户 - {{index+1}}</view>
				<view class="c-row b-b">
					<text class="tit">账户类型</text>
					<view class="con-list">
						{{items.accountType}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">银行卡照片（可选）</text>
					<view class="con-list">
						真的没做呐
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">银行卡号</text>
					<view class="con-list">
						{{items.bankCard}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">开户行</text>
					<view class="con-list">
						{{items.bankDeposit}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">开户支行</text>
					<view class="con-list">
						{{items.bankDepositBranch}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">收款人姓名</text>
					<view class="con-list">
						{{items.payeeName}}
					</view>
				</view>
				<view class="c-row b-b">
					<text class="tit">收款人身份证号</text>
					<view class="con-list">
						{{items.payeeNumberCard}}
					</view>
				</view>
			</view>
		</view>
		<view class="margin-top">
			<view class="labels">上传附件</view>

			<button type="default">行驶证</button>
			<view style="width: 100px;margin: 0 auto;" v-if="travels != ''">
				<image v-bind:src="travels" style="width: 100px;height: 100px;"></image>
			</view>
			<button type="default">驾驶证</button>
			<view style="width: 100px;margin: 0 auto;" v-if="drives != ''">
				<image v-bind:src="drives" style="width: 100px;height: 100px;"></image>
			</view>
			<button type="default">道路运营证</button>
			<view style="width: 100px;margin: 0 auto;" v-if="practices != ''">
				<image v-bind:src="practices" style="width: 100px;height: 100px;"></image>
			</view>
			<button type="default">从业资格证</button>
			<view style="width: 100px;margin: 0 auto;" v-if="operates != ''">
				<image v-bind:src="operates" style="width: 100px;height: 100px;"></image>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				drivers: {},
				id: [],
				address: [],
				travels: "",
				drives: "",
				practices: "",
				operates: "",
				idup: "",
				idlow: "",
			}
		},
		onLoad(option) {
			this.getList(option.id)
		},
		methods: {
			getList(ids) {

				this.$api.doRequest('get', '/driverViewInfo/getDriver', {
						id: ids
					}, 'application/json;charset=UTF-8').then(res => {
						console.log("成功连接")
						this.procurementPlanInfos = res.data.data
						this.drivers = res.data.data
						if (this.drivers.cardAddressUrl != "") {
							this.id = this.drivers.cardAddressUrl.split(","),
								this.idup = this.id[0]
							this.idlow = this.id[1]
						}
						if (this.drivers.addressUrl != "") {
							this.address = this.drivers.addressUrl.split(","),
								this.travels = this.address[0]
							this.drives = this.address[1]
							this.practices = this.address[2]
							this.operates = this.address[3]
						}
					})
					.catch(res => {
						uni.showToast({
							title: res.errmsg,
							icon: 'none',
							duration: 2000
						})
					});
			},

		}
	}
</script>

<style>
	.center {
		padding: 10px 20px;
	}

	.labels {
		font-size: 16px;
		font-weight: 400;
	}

	.c-row {
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
		padding: 20rpx 30rpx;
		position: relative;
	}

	.con-list {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		-webkit-flex-direction: column;
		flex-direction: column;
		color: #303133;
		line-height: 40rpx;
		text-align: right;
		padding-right: 20rpx;
		font-size: 14px;
	}
</style>
