<template>
	<uni-popup ref="popupRef" type="bottom">

		<view class="open-box">
			<view class="open-tab">
				<view :class="['open-tab-item' , 'active-tab-item']">开多</view>
				<view class="open-tab-item">开空</view>
			</view>
			<view class="open-content">
				<view class="open-type pad-top">
					<view class="open-type-item">
						<text :class="['open-type-text' , 'active-open-type']">市价</text>
						<text class="open-type-text">计划</text>
					</view>
					<text class="type-text">逐仓模式</text>
				</view>
				<view class="lever-box pad-top">
					<text class="lever-title">杠杆</text>
					<view class="lever-item">
						<text :class="['lever-text' , 'active-lever']">5X</text>
						<text class="lever-text">10X</text>
						<text class="lever-text">20X</text>
					</view>
				</view>
				<view class="inp-box pad-top">
					<text class="inp-box-title">预估成交价:</text>
					<view class="inp-content">
						<text class="inp-nums">28510.8</text>
						<text class="inp-nums-tag">USDT</text>
					</view>
				</view>
				<view class="inp-box input-box pad-top">
					<text class="input-box-title">保证金</text>
					<view class="input-content">
						<input class="input-text" type="text">
						<text class="input-tag">USDT</text>
					</view>
				</view>

				<view class="set pad-top">
					<view class="set-title">
						<text class="set-title-text">设置止盈止损</text>
						<u-icon name="arrow-down-fill" size="10" color="#cfcfcf"></u-icon>
					</view>
					<view class="set-nums">
						可用: 224.80 USDT
					</view>
				</view>

				<template v-if="setStatus">
					<view class="setting">
						<view class="setting-title">
							<view class="setting-text">
								<text>止盈</text>
								<view class="setting-icon"></view>
							</view>
							<view class="switch-unit">
								<view class="switch-icon iconfont ">&#xeb0d;</view>
								<text class="switch-text">按价格设置</text>
							</view>
						</view>
					</view>
				</template>

				<view class="submit-box">
					<view class="submit-btn">
						买入/做多
					</view>
				</view>
			</view>
		</view>
	</uni-popup>
</template>

<script>
	export default {
		data() {
			return {
				setStatus: true
			};
		},

		mounted() {
			// this.$refs.popupRef.open()
		},
		methods: {
			open() {
				this.$nextTick(() => {
					this.$refs.popupRef.open();
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	$contentPaddingTop: 30rpx;

	.open-box {
		width: 100%;
		background-color: #fff;

		.open-tab {
			width: 100%;
			height: 86rpx;
			background-color: #F7F7F7;
			display: flex;
			align-items: center;
		}

		.open-tab-item {
			flex-shrink: 0;
			flex: 1;
			text-align: center;
			line-height: 86rpx;

			font-size: 30rpx;
			font-family: PingFang SC, PingFang SC-Bold;
			font-weight: 600;
			color: #808080;
		}

		.active-tab-item {
			color: #20b482;
			position: relative;

			&::before {
				content: '';
				position: absolute;
				left: 0;
				bottom: 0;
				width: 100%;
				height: 2rpx;
				background-color: #20b482;
			}
		}

		.open-content {
			padding: 0 $pages-padding;

			.pad-top {
				margin-top: $contentPaddingTop;
			}

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

				.open-type-item {
					width: 460rpx;
					height: 74rpx;
					display: flex;
					align-items: stretch;
					border: 1px solid #05c175;
					border-radius: 4px;

					.open-type-text {
						flex: 1;
						text-align: center;
						line-height: 74rpx;
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #05c175;
					}

					.active-open-type {
						background: #05c175;
						color: #fff;
					}
				}

				.type-text {

					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 600;
					color: #808080;
					line-height: 40rpx;
				}
			}

			.lever-box {
				display: flex;
				align-items: center;

				.lever-title {

					font-size: 26rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					text-align: left;
					color: #808080;
					line-height: 38rpx;
				}

				.lever-item {
					text-align: center;
					display: flex;
					align-items: center;

					.lever-text {
						margin-left: 21rpx;
						width: 105rpx;
						height: 74rpx;
						line-height: 74rpx;
						background: #ffffff;
						border: 1rpx solid #cccccc;
						border-radius: 4rpx;
						font-size: 26rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #808080;
					}

					.active-lever {
						background: #05c175;
						border-color: #05c175;
						font-size: 26rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #ffffff;
					}
				}
			}

			.inp-box {
				width: 100%;
				height: 80rpx;
				background: #efefef;
				border: 1px solid #e6e6e6;
				border-radius: 8rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 0 30rpx;

				.inp-box-title {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					color: #808080;
					line-height: 40rpx;
				}

				.inp-content {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					color: #1a1a1a;
					line-height: 40rpx;

					.inp-nums-tag {
						padding-left: 20rpx;
						font-size: 28rpx;
						color: #808080;
					}
				}

			}

			.input-box {
				width: 100%;

				.input-box-title {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					color: #808080;
					line-height: 40rpx;
					flex-shrink: 0;
				}

				.input-content {
					flex: 1;
					height: 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;

					.input-text {
						height: 100%;
						flex: 1;
						padding: 0 3px;
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #1a1a1a;
						text-align: right;
					}

					.input-tag {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #808080;
						line-height: 40rpx;
					}
				}

			}

			.set {
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 26rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				line-height: 38rpx;

				.set-title {
					display: flex;
					justify-content: space-between;
					align-items: center;
					color: #1a1a1a;
					padding-right: 5px;
				}

				.set-nums {
					color: #808080;
				}
			}

			.submit-box {
				width: 100%;
				padding: 53rpx 0 4rpx;

				.submit-btn {
					width: 100%;
					height: 80rpx;
					background: #05c175;
					border-radius: 8rpx;
					text-align: center;
					line-height: 80rpx;

					font-size: 30rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					color: #ffffff;
				}
			}

			.setting {
				width: 100%;

				.setting-title {

					display: flex;
					justify-content: space-between;
					align-items: center;
					.setting-text {
						display: flex;
						justify-content: space-between;
						align-items: center;
						font-size: 24rpx;
						color: #a3a1a1;
						color: #666;
						.setting-icon{
							width: 20rpx;
							height: 20rpx;
							background-color: #ccc;
						}
					}

					.switch-unit {
						display: flex;
						justify-content: space-between;
						align-items: center;
						color: #20B482;
						font-size: 24rpx;
						.switch-text{
							padding-left: 3px;
						}
					}
				}

			}

			// <view class="setting">
			// 	<view class="setting-title">
			// 		<view class="setting-text">
			// 			<text >止盈</text>
			// 			<view class="setting-icon"></view>
			// 		</view>
			// 		<view class="switch-unit">
			// 			<text class="switch-icon iconfont">&#xeb0d;</text>
			// 			<text class="switch-text">按价格设置</text>
			// 		</view>
			// 	</view>
			// </view>

		}

	}
</style>