<template>
	<view class="contract-box">
		<view class="contract-title">
			<view class="contract-item" @click.stop="openDrawer">
				<view class="title-iocn">
					<text class="title-iocn-item"></text>
					<text class="title-iocn-item"></text>
					<text class="title-iocn-item"></text>
				</view>
				<!-- <image class="title-iocn" src="../../../static/logo.png" mode="aspectFit"></image> -->
				<text class="title-text">ETH/USDT</text>
			</view>
			<view class="contract-item">
				<text class="title-ratio">资金费率:-0.0100%</text>
				<image class="ratio-icon" src="../../../static/logo.png" mode="aspectFit"></image>
				<image class="ratio-icon" src="../../../static/logo.png" mode="aspectFit"></image>
			</view>
		</view>

		<view class="account-box">
			<view class="account-item">
				<view class="account-title">
					<text class="text">持仓保证金USDT]</text>
				</view>
				<text class="account-num">365.26</text>
			</view>
			<view class="account-item">
				<view class="account-title">
					<text class="text">可用保证金(USDT)</text>
				</view>
				<text class="account-num">365.26</text>
			</view>
			<view class="account-item">
				<view class="account-title">
					<text class="text">未实现亏盈(USDT] 三1</text>
				</view>
				<text class="account-num">-0.99</text>
			</view>
			<view class="account-item">
				<view class="account-title">
					<text class="text">净值(USDIL</text>
				</view>
				<text class="account-num">9869.77</text>
			</view>
			<view class="account-item">
				<view class="account-title">
					<text class="text">风险率必</text>
				</view>
				<text class="account-num">9869.77</text>
			</view>
			<view class="account-item">
				<view class="account-title">
					<text class="text">账户余额[USDTI</text>
				</view>
				<text class="account-num">9869.77</text>
			</view>
		</view>


		<gap height="8rpx" />



		<view class="data-box">
			<view class="data-left">
				<view class="left-title flex">
					<text>价格</text>
					<text>数量</text>
				</view>
				<view class="subhead-title flex">
					<text>(USDT)</text>
					<text>(张)</text>
				</view>

				<view class="nums-list">
					<view class="nums-item" v-for="item in 7">
						<text class="nums-item-bg"></text>
						<view class="item-num">
							<text>28516.8</text>
							<text>28516.8</text>
						</view>
					</view>
				</view>

				<view class="left-title index-num-title flex">
					<text>28515.6</text>
					<text>+0.09%</text>
				</view>
				<view class="subhead-title index-title flex">
					<text>指数28523.0</text>
					<text>标记285114</text>
				</view>

				<view class="nums-list" style="padding-top: 6.5rpx;">
					<view class="nums-item" v-for="item in 7">
						<text class="nums-item-bg"></text>
						<view class="item-num">
							<text>28516.8</text>
							<text>28516.8</text>
						</view>
					</view>
				</view>
			</view>
			<view class="data-right">
				<view class="right-select">
					<uni-data-select class="select-item" v-model="value" @change="change"></uni-data-select>
					<uni-data-select class="select-item" v-model="value" @change="change"></uni-data-select>
				</view>
				<view class="right-input input-item-p">
					市价
				</view>
				<view class="right-input">
					<input class="input-item" placeholder-class="input-item-p" placeholder="市价">
					<view class="right-input-icon">
						<text>张</text>
						<text class="icon-link">|</text>
						<image class="icon" src="../../../static/logo.png" mode=""></image>
					</view>
				</view>
				
				<view class="step-content">
					<step />
				</view>
				
				<view class="set-node">
					<view class="set-node-status"></view>
					<text class="set-node-text">设置止盈止损</text>
				</view>
				
				<view class="info-item">
					<text>成本</text>
					<view>0.00 USDT</view>
				</view>
				
				<view class="info-item">
					<text>可用</text>
					<view>
						<text>10000.00 USDT</text>
					</view>
				</view>
				<view class="info-item">
					<text>可做多</text>
					<view>
						<text>33719张</text>
					</view>
				</view>
				
			</view>
		</view>
		

	<drawer ref="drawerRef"/>
	</view>
</template>

<script>
	import drawer from "./../modules/drawer.vue"
	export default {
		components:{drawer},
		data() {
			return {
				value: undefined,
				range: [{
						value: 0,
						text: "篮球"
					},
					{
						value: 1,
						text: "足球"
					},
					{
						value: 2,
						text: "游泳"
					},
				],
			};
		},
		methods: {
			openDrawer(){
				this.$refs.drawerRef.open();
			},
			change(e) {
				console.log("e:", e);
			},
		},
	}
</script>
<style lang="scss" scoped>
	.contract-box {
		.contract-title {
			padding: 5rpx $pages-padding 0;
			min-height: 78rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.contract-item {
				display: flex;
				align-items: center;

				.title-iocn {
					width: 28rpx;
					height: 24rpx;
					display: flex;
					flex-direction: column;
					// align-items: center;
					justify-content: space-between;

					.title-iocn-item {
						width: 100%;
						height: 4rpx;
						border-radius: 2rpx;
						background: #111111;

						&:first-child {
							width: 50%;
						}
					}
				}

				.title-text {
					font-size: 37rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					text-align: left;
					color: #141213;
					line-height: 52px;
					letter-spacing: 0.74rpx;
					padding-left: 19rpx;
				}

				.title-ratio {
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					color: #808080;
					line-height: 33rpx;
				}

				.ratio-icon {
					width: 31rpx;
					height: 33rpx;
					margin-left: 22rpx;
				}

			}


		}

		.account-box {
			width: 100%;
			padding: 21rpx $pages-padding;
			display: flex;
			flex-wrap: wrap;
			background-color: #F6F6F6;
			margin-bottom: 25rpx;

			.account-item {

				display: flex;
				flex-direction: column;
				flex-shrink: 0;

				&:nth-child(3n) {
					width: 40%;
					text-align: right;
				}

				&:nth-child(3n - 1) {
					width: 30%;
					text-align: right;
				}

				&:nth-child(3n - 2) {
					width: 30%;
				}

				&:nth-child(n + 4) {
					margin-top: 20rpx;
				}

				.account-title {

					font-size: 22rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					color: #807e89;
					line-height: 30rpx;

					.text {
						border-bottom: 2rpx dashed #707070;
					}
				}

				.account-num {
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					color: #1a1a1a;
					line-height: 33rpx;
					margin-top: 11rpx;
				}
			}


		}

	}

	.data-box {
		width: 100%;
		padding: 25rpx $pages-padding 0;
		display: flex;
		justify-content: space-between;
		align-items: stretch;

		.data-left {
			width: 303rpx;

			.flex {
				display: flex;
				justify-content: space-between;
				align-items: center;
			}

			.left-title {
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #807e89;
				line-height: 33rpx;
			}

			.subhead-title {
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #807e89;
				line-height: 33rpx;
			}

			.index-num-title {

				font-size: 36rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #20b482;
				line-height: 50rpx;

				text+text {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					color: #20b482;
					line-height: 40rpx;
				}
			}

			.index-title {

				font-size: 20rpx;
				color: #808080;
				line-height: 1.2;

				text {
					border-bottom: 2rpx dashed #707070;
				}

				padding-bottom: 18rpx;
				border-bottom: 1px solid #f2f2f2;
			}

			.nums-list {
				width: 100%;
				padding: 10rpx 0 4rpx;
				border-bottom: 1rpx solid #f2f2f2;

				.nums-item {
					width: 100%;
					position: relative;
					height: 40rpx;
					margin-bottom: 4rpx;

					.nums-item-bg {
						position: absolute;
						top: 0;
						right: 0;
						z-index: 1;
						width: 50%;
						height: 100%;
						background-color: #FEEBED;
					}

					.item-num {
						width: 100%;
						height: 100%;
						position: absolute;
						top: 0;
						right: 0;
						z-index: 2;
						display: flex;
						justify-content: space-between;
						align-items: center;
						font-size: 22rpx;
						font-family: PingFang SC, PingFang SC-Bold;
						font-weight: 700;
						color: #ea5162;
						line-height: 33rpx;

						text+text {

							font-weight: 700;
							color: #1a1a1a;
							line-height: 33rpx;
						}
					}
				}
			}

			// <view class="nums-list">
			// 	<view class="nums-item">
			// 		<text class="nums-item-bg"></text>
			// 		<text class="item-num">28516.8</text>
			// 		<text class="item-num">28516.8</text>
			// 	</view>
			// </view>

		}

		.data-right {
			width: 365rpx;

			// background-color: green;
			.right-select {
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.select-item {
					width: 178rpx !important;
					height: 48rpx;

					:v-deep .uni-select {

						width: 178rpx !important;
						height: 48rpx;

						.uni-select__input-box {
							width: 100%;
							height: 48rpx !important;
						}
					}
				}
			}

			.right-input {
				width: 100%;
				height: 80rpx;
				background: #efefef;
				border-radius: 10rpx;
				margin-top: 20rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 0 20rpx;
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #808080;
				line-height: 40rpx;

				.input-item {
					height: 100%;
				}

				.input-item-p {
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #808080;
				line-height: 40rpx; 
					opacity: 0.3;
				}

				.right-input-icon {
					flex-shrink: 0;
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					color: #808080;
					line-height: 40rpx;
					display: flex;
					align-items: center;

					.icon-link {
						margin: 0 15rpx;
					}

					.icon {
						width: 30rpx;
						height: 26rpx;
					}
				}
			}
			.step-content{
				padding: 24rpx 0 35rpx;
			}
			
			.set-node{
				width: 100%;
				display: flex;
				align-items: center;
				.set-node-status{
					width: 27rpx;
					height: 27rpx;
					background: #e6e6e8;
					border-radius: 2rpx;
				}
				.set-node-text{
		 
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					color: #808080;
					line-height: 34rpx;
					margin-left: 14rpx;
					
					border-bottom: 2rpx dashed #707070;
				}
			}
			
			// <view class="set-node">
			// 	<view class="set-node-status"></view>
			// 	<text class="set-node-text">设置止盈止损</text>
			// </view>
			
		}
	}
</style>