<template>
	<view class="content" id="share-content" :rise-fall="stocksColor">
		<view :class="['share-top' , $setColor(shareVal.profits)]">
			<text class="share-currency">{{ shareVal.symbol }}</text>
			<text class="share-ratio color">{{ $getChange(shareVal , 1) }}%</text>
			<!-- <text class="share-ratio color">{{ shareVal.fact_profits }}%</text> -->
		</view>

		<view :class="['share-footer' , $setColor(shareVal.profits)]">
			<view class="footer-code">
				<slot name="qrcode"></slot>
			</view>
			<view class="footer-content">
				<view class="footer-name ">
					<text class="name-text">我在币王</text>
					<view class="name-box bdColor">
						<text class="color">{{ $setColor(shareVal.profits , true) ? '开多盈利了' : '开多亏损了' }}</text>
						<text class="color iconfont">&#xe622;</text>
					</view>
				</view>
				<view class="footer-price">
					<text>平仓价格</text>
					<text class="price">{{ shareVal.origin_price }}</text>
				</view>

				<view class="footer-price">
					<text>开仓均价</text>
					<text class="price">{{ shareVal.price }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	export default {
		props: {
			shareVal: {
				type: Object,
				default: () => {
					return {}
				}
			}
		},
		computed: {
			...mapGetters([
				"stocksColor",
			])
		},
		data() {
			return {

			};
		},
		mounted() {

		}
	}
</script>

<style lang="scss" scoped>
	.content {
		flex-shrink: 0;
		width: 100%;
		height: 100%;
		background: url("@/static/share/img_04.png") no-repeat center center;
		background-size: 100% 100%;
		position: relative;

		.share-top {
			position: absolute;
			top: 300rpx;
			left: 150rpx;
			padding: 20rpx 0 0 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			font-family: Bahnschrift, Bahnschrift-Bold;
			font-weight: 700;

			.share-currency {
				font-size: 48rpx;
				color: #030102;
			}

			.share-ratio {
				font-size: 68rpx;
				color: #ef3c59;
			}
		}

		.share-footer {
			position: absolute;
			left: 50%;
			bottom: 100rpx;
			width: 470rpx;
			height: 160rpx;
			transform: translateX(-50%);
			display: flex;
			padding: 10rpx 0 0 10rpx;

			.footer-code {
				width: 140rpx;
				height: 140rpx;
				padding: 5rpx;
			}

			.footer-content {
				display: flex;
				flex-direction: column;

				.footer-name {
					display: flex;
					align-items: center;

					.name-text {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #030303;
					}

					.name-box {
						margin-left: 26rpx;
						font-size: 22rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #ef3c59;

						min-width: 139rpx;
						padding: 0 10rpx;
						height: 40rpx;
						border: 1rpx solid #ef3c59;
						border-radius: 8rpx;
						display: flex;
						align-items: center;

						.iconfont {
							font-size: 18rpx;
							transform: rotate(90deg);
						}
					}
				}

				.footer-price {

					font-size: 15rpx;
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: 400;
					color: #A5A3A4;
					padding-top: 10rpx;

					.price {
						color: #242424;
						padding-left: 5px;
					}

				}


			}

			// .<view class="footer-code">
			// 	<slot name="qrcode"></slot>
			// </view>{}
			// <view class="footer-content">
			// 	<view class="footer-name">
			// 		<text class="name-text">我在币王</text>
			// 		<view class="name-box">
			// 			<text>开多亏损了</text>
			// 			<text class="iconfont">&#xe622;</text>
			// 		</view>
			// 	</view>
			// 	<view class="">
			// 		<text>平仓价格</text>
			// 		<text>28387.1</text>
			// 	</view>

			// 	<view class="">
			// 		<text>开仓均价</text>
			// 		<text>28387.1</text>
			// 	</view>
			// </view>




		}
	}
</style>