<template>
	<view class="page">
		<view class="content">
			<view class="">
				<u-subsection mode="subsection" :list="list2" :current="current" @change="change"
					keyName="label"></u-subsection>
				<view class="yong" v-if="current==0" style="margin-top: 20rpx;">
					<u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange">
						<view class="u-flex">
							<u-checkbox :customStyle="{marginBottom: '8px'}">
							</u-checkbox>
							<view class="" style="flex: 1;">
								<view class="">
									订单编号：287910109281003
								</view>
								<view class="u-flex u-row-between"
									style="margin-top: 20rpx; border-top:2rpx solid #F6F6F6;padding-top: -18rpx;box-sizing: border-box;">
									<view class="left">
										<view class="top">
											<text class="left">
												陈昂
											</text>
											<text class="right">
												Java高级工程师
											</text>
										</view>
										<view class="concent">
											<text class="left">佣金内容</text>
											<text class="right">协助完成面试</text>
										</view>
										<view class="concent u-flex">
											<text class="left">佣金金额</text>
											<view class="money">
												<text style="font: 24rpx;">¥</text>
												<text style="font-size: 32rpx;">200.00</text>
											</view>
										</view>
									</view>
									<view class="right">
										<view class="top">
											<text class="left">
												职位负责人
											</text>
											<text class="right">
												林景宁
											</text>
										</view>
										<view class="concent">
											<text class="left">offer时间</text>
											<text class="right">2023.03.12 12:43</text>
										</view>
										<view class="concent">
											<text class="left">过保时间</text>
											<text class="right">2023.03.12 12:43</text>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="bottom u-flex u-row-between">
							<view class="left">
								<text>推荐时间：2023.03.23 12:30</text>
							</view>
							<view class="right">
								<text>回款时间:2023.03.12 12:3</text>
							</view>
						</view>
					</u-checkbox-group>
				</view>
				<view class="yong" v-if="current == 1" style="margin-top: 20rpx;">
					<u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange">
						<view class="u-flex">
						
							<view class="" style="flex: 1;">
								<view class="u-flex u-row-between">
									<view class="order">
										订单编号 287910109281003
									</view>
									<view class="deposit">
										未提现
									</view>
								</view>
								<view class="u-flex u-row-between dan" style="margin-top: 18rpx;" >
									<view class="u-flex">
										<u-checkbox  :name="item.name">
										</u-checkbox>
										<view class="lietou">猎头成单</view>
									</view>
									<view class="red">
										<text style="24rpx">¥</text>
										<text style="32rpx">200.00</text>
									</view>
								</view>
							</view>
						</view>
						<view class="u-flex u-row-between" style="margin-top:26rpx;">
							<text class="date">邀请日期 2023.03.12 12:4</text>
							<text class="date1">回款时间:2023.03.12 23:1</text>
						</view>
					</u-checkbox-group>
				</view>
			</view>
			<view style="height: 88vh;justify-content: center;" class="u-flex" v-if="list.length == 0 ">
				<u-empty text="暂无数据" mode="list"></u-empty>
			</view>
		</view>
		<u-datetime-picker :show="showtime" mode="year-month" @confirm="changetime"
			@cancel="showtime = false"></u-datetime-picker>
		<u-picker :show="show" :columns="columns" keyName="label" @cancel="show = false" @confirm="enter"></u-picker>
	</view>
</template>

<script>
	import {
		commission_list
	} from "@/units/inquire.js"
	export default {
		data() {
			return {
				show: false,
				showtime: false,
				current: 0,
				date: "",
				list: [],
				list2: [{
					label: '订单佣金',
					// 其他属性值
					source_type: "order"
				}, {
					label: '邀请佣金',
					source_type: "invite"
				}],
				source_type: "order",
				label: "订单佣金",
				columns: [
					[{
						label: '订单佣金',
						// 其他属性值
						source_type: "order"
						// ...
					}, {
						label: '邀请佣金',
						source_type: "invite"
					}]
				],
				list4: [{
						name: "佣金明细"
					},
					{
						name: "提现记录"
					}
				]
			}
		},
		onLoad(options) {
			this.source_type = options.source_type
			if (this.source_type == "order") {
				this.label = "订单佣金"
			} else {
				this.label = "邀请佣金"
			}
			this.commission_list()
		},
		computed: {
			bgImage() {
				return `url(${require('@/static/images/juxing.png')}) 100% 100%`
			}
		},
		methods: {
			return1() {
				uni.navigateBack()
			},
			change(e) {
				this.current = e
			},
			enter(e) {
				this.label = e.value[0].label
				this.source_type = e.value[0].source_type
				this.show = false
			},
			async changetime(e) {
				const timeFormat = uni.$u.timeFormat;
				let timeValue = await timeFormat(e.value, 'yyyy-mm');
				this.date = timeValue;
				this.page = 1
				this.total = 0
				this.list = []
				this.commission_list()
				this.showtime = false
			},
			commission_list() {
				commission_list({
					source_type: this.source_type,
					job_name: "",
					is_confirm: "",
					begin_time: "",
					end_time: "",
					time_type: "",
					status: ""
				}).then(res => {
					console.log(res);
					this.list = res.data.data
					console.log(this.list.length);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.date{
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #888888;
	}
	.date1{
		font-size: 24rpx;
		font-family: SFPro-Regular, SFPro;
		font-weight: 400;
		color: #222222;
	}
	.red{
		font-family: JDZhengHT-Regular, JDZhengHT;
		font-weight: 400;
		color: #F2413A;
	}
	.lietou{
		font-size: 32rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #222222;
	}
	.dan{
		margin-top:20rpx ;
		border-top:2rpx solid #F6F6F6 ;
		padding-top: 18rpx;
	}
	.deposit{
		border-radius: 6rpx;
		background-color: rgba(12, 102, 194, 0.1);
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #0C66C2;
		padding: 4rpx;
	}
	.order{
		font-size: 24rpx;
		font-family: SFPro-Regular, SFPro;
		font-weight: 400;
		color: #666666;
	}
	.yong {
		background: #FFFFFF;
		border-radius: 16rpx;
		padding: 20rpx 20rpx 26rpx;
		box-sizing: border-box;

		.top {
			.left {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #555555;
			}

			.right {
				font-family: SFPro-Regular, SFPro;
				font-weight: 400;
				color: #F2413A;
			}
		}

		.leftf {
			font-size: 26rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #555555;
			margin-top: 20rpx;
		}

		.leftff {
			font-size: 26rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #555555;
		}
	}

	.list1 {
		background: #FFFFFF;
		border-radius: 16rpx;

		.data {
			font-size: 24rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #888888;
		}

		.data1 {
			font-size: 24rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #222222;
		}

		.title {
			font-size: 32rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #222222;
		}

		.font {
			font-size: 24rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #fff;
			opacity: 1;
		}

		.back {
			background: #0C66C2;
			border-radius: 6rpx;
			padding: 4rpx 8rpx;
			opacity: 0.5;
		}

		.money {
			font-size: 24rpx;
			font-family: SFPro-Regular, SFPro;
			font-weight: 400;
			color: #F2413A;
			margin-left: 12rpx;
		}
	}
















	.page {
		height: 100vh;

		.content {
			padding: 0 24rpx;
			background: #F3F3F3;
			min-height: 78vh;
			padding-top: 20rpx;


			.list {
				background: #FFFFFF;
				border-radius: 16rpx;
				padding: 20rpx;
				box-sizing: border-box;
			}
		}
	}

	.bottom {
		border-top: 2rpx solid #F6F6F6;
		margin-top: 18rpx;
		padding-top: 18rpx;
		box-sizing: border-box;

		.left {
			font-size: 24rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #555555;
		}

		.right {
			font-size: 24rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
		}
	}

	.right {
		.concent {
			.left {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #222222;
			}

			.money {
				font-size: 24rpx;
				font-family: SFPro-Regular, SFPro;
				font-weight: 400;
				color: #F2413A;
				margin-left: 12rpx;
			}

			.right {
				margin-left: 12rpx;
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #555555;
			}
		}

		.top {
			.left {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #555555;
			}

			.right {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #555555;
			}
		}
	}

	.left {
		.concent {
			.left {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #222222;
			}

			.money {
				font-size: 24rpx;
				font-family: SFPro-Regular, SFPro;
				font-weight: 400;
				color: #F2413A;
				margin-left: 12rpx;
			}

			.right {
				margin-left: 12rpx;
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #555555;
			}
		}

		.top {
			.left {
				height: 44rpx;
				font-size: 32rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #222222;
			}

			.right {
				margin-left: 12rpx;
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #141414;
			}
		}
	}

	.search {
		height: 68rpx;
		background: #F3F3F3;
		border-radius: 38rpx;
		padding: 14rpx 28rpx;
		box-sizing: border-box;
	}

	.index-header {
		padding: 0 32rpx;
		height: 50rpx;

		.index-search {
			width: 200rpx;
			height: 64rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			padding: 0 28rpx;

			.text1 {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
				margin-left: 16rpx;
			}
		}
	}

	::v-deep .u-navbar__content__left {
		padding: 0 !important;
	}

	// ::v-deep .u-subsection__item{
	// 	border-radius: 38rpx;
	// }
	// ::v-deep .u-subsection--subsection{
	// 	border-radius: 76rpx;
	// }
</style>