<template>
	<view class="content">
		<view class="box">
			<view class="foreign" v-if="type == 1">
				<view class="foreign-item">
					<view class="foreign-font">
						外发合作公司
					</view>
					<picker @change="bindPickerCompany" :range="companylist" class="input">
						<text>{{ company }}</text>
					</picker>
				</view>
				<view class="foreign-item">
					<view class="foreign-font">
						到货时间
					</view>
					<view class="input">
						<view class="uni-list-cell">
							<picker mode="date" :value="date" @change="bindDateChange">
								<view class="uni-input">{{date}}</view>
							</picker>
						</view>
					</view>
				</view>
				<view class="foreign-item">
					<view class="foreign-font">
						外发费用
					</view>
					<input class="input" type="text" v-model="money" placeholder="请填写金额">
				</view>
				<view class="foreign-item">
					<view class="foreign-font">
						备注
					</view>
					<input class="input" type="text" v-model="bz" placeholder="请填写备注">
				</view>
			</view>
			<view class="title" @click="navTo('/pages/scrap/gxlist')">
				<view class="title-main">
					<text class="gray">工序:</text>(下料,20件,￥100)(下料,20件,￥100)(下料,20件,￥100)(下料,20件,￥100)
				</view>
				<view class="title-money">
					总计:<text class="red">￥500</text>
					<image class="jt" src="../../static/img/jt.png" mode=""></image>
				</view>
			</view>
			<view class="main " v-for="(item,index) in list">
				<view class="main-top">
					<image class="main-icon" src="../../static/icon/order.png" mode=""></image>
					<view class="main-font">
						{{item.name}}
					</view>
				</view>
				<view class="main-bottom flex">
					<view class="num">
						数量：
					</view>
					<view class="main-input">
						<input type="number" v-model="item.number" placeholder="请填写数量">
					</view>
				</view>
			</view>
			<view class="all flex">
				<view class="all-font">
					订单总金额：
				</view>
				<view class="all-num">
					￥1000
				</view>
			</view>
			<view class="btn">
				确认领取
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '规格1(黄色,37码）',
					number: '',
				}, {
					name: '规格2(黄色,37码）',
					number: '',
				}, {
					name: '规格3(黄色,37码）',
					number: '',
				}, {
					name: '规格4(黄色,37码）',
					number: '',
				}, {
					name: '规格5(黄色,37码）',
					number: '',
				}, {
					name: '规格6(黄色,37码）',
					number: '',
				}, {
					name: '规格7(黄色,37码）',
					number: '',
				}, {
					name: '规格8(黄色,37码）',
					number: '',
				}],
				type: 0,
				companylist: ['尚宇公司', '浙江六牛'],
				company: '请选择外发公司',
				date: '请选择日期',
				money: '',
				bz: ''
			};
		},
		onLoad(option) {
			if (option.type) {
				this.type = option.type
				uni.setNavigationBarTitle({
					title: '订单外发'
				});
			}
		},
		onShow() {},
		onReachBottom() {},
		onReady() {},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url
				})
			},
			bindPickerCompany: function(e) {
				this.company = this.companylist[e.target.value];
			},
			bindDateChange: function(e) {
				this.date = e.detail.value;
				console.log(e);
			},
		}
	};
</script>

<style lang="scss">
	page,
	.content {
		min-height: 100%;
		height: auto;
	}

	.box {
		background: #FFFFFF;
		margin-top: 20rpx;
		padding: 32rpx 0;
	}

	.foreign {
		margin: 20rpx auto 0;
		width: 702rpx;
		background: #FFFFFF;
		border: 2px solid #EAECED;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
		border-radius: 20rpx;

		.foreign-item {
			padding: 26rpx 18rpx 20rpx;
			border-bottom: 1px solid #f5f5f5;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.foreign-font {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #222222;
			}

			.input {
				text-align: right;
				padding: 0 20rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #999999;
			}
		}
	}

	.title {
		padding: 20rpx;
		margin: 20rpx auto 0;
		width: 700rpx;
		background: #FFFFFF;
		border: 2px solid #EAECED;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
		border-radius: 20rpx;

		.title-main {
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;

			.gray {
				color: #666666;
			}
		}

		.title-money {
			text-align: right;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #333333;

			.red {
				display: inline-block;
				margin: 0 20rpx;
				color: #FF4C4C;
			}

			.jt {
				width: 13rpx;
				height: 20rpx;
			}
		}
	}

	.main {
		margin: 20rpx auto 0;
		padding: 20rpx;
		width: 700rpx;
		background: #FFFFFF;
		border: 2px solid #EAECED;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
		border-radius: 20rpx;

		.main-top {
			display: flex;
			align-items: center;
			padding-bottom: 16rpx;
			border-bottom: 1px solid #EAECED;

			.main-icon {
				width: 32rpx;
				height: 37rpx;
			}

			.main-font {
				margin-left: 10rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}
		}

		.main-bottom {
			padding-top: 20rpx;

			.num {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #666666;
			}

			.main-input {
				text-align: right;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #999999;
			}
		}
	}

	.all {
		margin: 20rpx auto 0;
		padding: 20rpx;
		width: 700rpx;
		background: #FFFFFF;
		border: 2px solid #EAECED;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
		border-radius: 20rpx;

		.all-font {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #323333;
		}

		.all-num {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FF4C4C;
		}
	}

	.btn {
		text-align: center;
		margin: 100rpx auto 0;
		width: 622rpx;
		height: 85rpx;
		background: #069CFA;
		border-radius: 15rpx;
		line-height: 85rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
	}
</style>