<template>
	<view class="content position-relative flex-line">
		<image class="share" src="../../static/image/shareBg.jpg" mode="widthFix"></image>
		<view class="title">
			<text>
				邀好友赚佣金
			</text>
			<text class="bg">
				邀好友赚佣金
			</text>
		</view>
		<view class="money position-relative">
			<view class="showText position-relative">
				<view class="border">
					<view class="text">
						邀请的好友每下一单
					</view>
					<view class="text">
						都可分得下单一定佣金
					</view>
					<view class="moneybox">
						<text class="moneytext">
							50-100
						</text>
						<text class="tip">
							元
						</text>
					</view>
				</view>
			</view>
			<view class="borderBox">
				<view class="borderBox1">
					<view class="borderBox2">
						<view class="bottomBox ">
							<!-- #ifdef MP -->
							
							<button open-type="share" class="bottom flex-center">
								<image class="img margin-r-20" src="/static/image/shareTip.png" mode="scaleToFill">
								</image>
								<text>
									立即分享
								</text>
							</button>
							<!-- #endif -->
							
							<!-- #ifdef APP -->
							<view class="bottom flex-center" @click="shareDomApp">
								<image class="img margin-r-20" src="/static/image/shareTip.png" mode="scaleToFill">
								</image>
								<text>
									立即分享
								</text>
							</view>
							<!-- #endif -->
							<!-- #ifdef H5 -->
							<view class="bottom flex-center" @click="shareDomH5">
								<image class="img margin-r-20" src="/static/image/shareTip.png" mode="scaleToFill">
								</image>
								<text>
									立即分享
								</text>
							</view>
							<!-- #endif -->
						</view>
					</view>
				</view>
			</view>
			<view class="moneyBg"></view>
		</view>
		<view class="footer position-relative">
			<view class="bacolor">
				<view class="flex">
					<view class="bs">

					</view>
					<view class="bs">
						<view class="ll flex">
							<view class="ls flex-center">
								<view class="ii">
								</view>
								<view class="ii">
								</view>
								<view class="ii">
								</view>
							</view>
							<view class="ls">
								如何赚钱
							</view>
							<view class="ls flex-center">
								<view class="ii">
								</view>
								<view class="ii">
								</view>
								<view class="ii">
								</view>
							</view>
						</view>
					</view>
					<view class="bs">

					</view>
				</view>
				<view class="bottomColor">
					<view class="flex">
						<view class="item">
							<view class="ls">

							</view>
						</view>
						<view class="item">
							<view class="ls">

							</view>
						</view>
					</view>
					<view class="bottom flex-between-center">
						<view class="item">
							<view class="imgBox flex-center">
								<image class="img" src="/static/image/shareUser.png" mode="widthFix"></image>
							</view>
						</view>
						<view class="next">
							<image class="tip" src="/static/image/shareNext.png" mode="scaleToFill"></image>
						</view>
						<view class="item">
							<view class="imgBox flex-center">
								<image class="img" src="/static/image/shareGwc.png" mode="widthFix"></image>
							</view>
						</view>
						<view class="next">
							<image class="tip" src="/static/image/shareNext.png" mode="scaleToFill"></image>
						</view>
						<view class="item">
							<view class="imgBox flex-center">
								<image class="img" src="/static/image/sharehyxd.png" mode="widthFix"></image>
							</view>

						</view>
					</view>
					<view class="bottom flex-between-center" style="align-items: flex-start;">
						<view class="item">
							邀请好友
						</view>
						<view class="next"></view>
						<view class="item">
							好友下单
						</view>
						<view class="next"></view>
						<view class="item">
							<view>
								获得佣金
							</view>
							<view>
								50-100元
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {
		data() {
			return {

			};
		},
		computed: {
			...mapState('user', ['userInfo']),
			...mapState(['baseURL', 'urlFile']),
		},
		// #ifdef MP
		onShareAppMessage: function(res) {
			console.log('点击分享');
			let path = '/pages/index/index?' + 'spread=' + this.userInfo.uid;
			let data = {
				path: path,
				title: this.userInfo.nickname + '邀请您进入绿津',
			};
			return data;
		},
		// #endif
		onLoad(options) {

		},
		methods: {
			//#ifdef APP
			shareDomApp() {
				uni.share({
					provider: 'weixin',
					type: 0,
					title:  this.userInfo.nickname + '邀请您进入绿津',
					summary: '新一代智能电动车，手机开关锁、智能防盗、卫星定位，时刻掌握爱车位置。品牌大厂生产，质量好，款式多，售后优，所有车辆支持0元购新车！',
					imageUrl:  '/pages/index/index?spread=' + this.userInfo.uid,
					href: this.baseURL + this.urlFile + '/pages/public/register?spread=' + this.userInfo.uid
				})
			},
			//#endif
			//#ifdef H5
			shareDomH5() {
				uni.share({
					provider: 'weixin',
					type: 0,
					title:  this.userInfo.nickname + '邀请您进入绿津',
					summary: '新一代智能电动车，手机开关锁、智能防盗、卫星定位，时刻掌握爱车位置。品牌大厂生产，质量好，款式多，售后优，所有车辆支持0元购新车！',
					imageUrl:  '/pages/index/index?spread=' + this.userInfo.uid,
					href: this.baseURL + this.urlFile + '/pages/public/register?spread=' + this.userInfo.uid
				})
			},
			//#endif
		}
	};
</script>

<style lang="scss">
	page {
		height: 0;
		min-height: 100%;
	}

	.content {
		min-height: 100%;
		background-color: #d90f3e;

		.share {
			width: 750rpx;
			position: absolute;
			top: 0;
			left: 0;
		}
	}

	.title {
		line-height: 1;
		padding-bottom: 5vh;
		font-weight: bold;
		color: #FFFFFF;
		font-size: 90rpx;
		text-align: center;
		text-shadow: -4rpx 4rpx #D15B40;
		position: relative;
		z-index: 1;

		.bg {
			position: absolute;
			top: 8rpx;
			left: -8rpx;
			width: 100%;
			color: #934E3D;
			z-index: -1;
		}
	}

	.money {
		z-index: 1;
		width: 580rpx;
		margin: 0 auto;

		.borderBox {
			position: relative;
			height: 300rpx;
			width: 100%;
			overflow: hidden;
			border-bottom-right-radius: 20rpx;
			border-bottom-left-radius: 20rpx;
			box-shadow: 0 6rpx #B70000;
			margin-top: -200rpx;
			z-index: 2;

			.borderBox1 {
				width: 2000rpx;
				margin-left: -710rpx;
				height: 2000rpx;
				margin-top: -1625rpx;
				border: 300rpx solid #FB1727;
				border-radius: 2000rpx;
			}

			.borderBox2 {
				width: 100%;
				height: 100%;
				border-radius: 2000rpx;
				border: 5px solid #ffc98d;
				box-shadow: 0px 30px 60px #FAB07E;

				.bottomBox {
					font-size: 48rpx;
					font-weight: bold;
					position: absolute;
					bottom: 60rpx;
					left: 0;
					width: 100%;
					line-height: 1;
					.bottom {
						width: 460rpx;
						height: 106rpx;
						border-radius: 99rpx;
						margin: 0 auto;
						box-shadow: 0px 0px 20rpx 0px rgba(131, 45, 52, 0.75);
						background-image: linear-gradient(0deg, #EEA768 25%, #FCDAB9 63%, #FFC490 100%);
					color: #95653A !important;
						.img {
							width: 50rpx;
							height: 50rpx;
						}
					}
				}
			}
		}

		.showText {
			background-color: #FFF1E1;
			border-radius: 20rpx;
			height: 480rpx;
			width: 520rpx;
			margin: 0 auto;
			padding: 10rpx;
			z-index: 1;
			line-height: 1.5;

			.moneybox {
				margin-top: 30rpx;
				background-image: linear-gradient(to bottom, #FAB07E 0%, #FB1727 100%);
				background-clip: text;
				color: rgba(0, 0, 0, 0);

				.moneytext {
					font-size: 95rpx;
				}

				.tip {
					font-size: 50rpx;
				}
			}

			.border {
				width: 100%;
				height: 100%;
				border: 2px solid rgba(148, 131, 134, 0.3);
				border-radius: 20rpx;
				color: #B67363;
				font-size: $font-sm;
				text-align: center;
				font-weight: bold;
				padding: 20rpx;
			}
		}

		.moneyBg {
			background: linear-gradient(to right, #FAB18A 0%, #ff793f 35rpx, #ff793f 551rpx, #FAB18A 100%);
			height: 340rpx;
			width: 100%;
			border-radius: 20rpx;
			margin-top: -440rpx;
		}


	}

	.footer {
		padding-top: 10vh;

		.bacolor {
			width: 710rpx;
			height: 320rpx;
			background: linear-gradient(0deg, #FE4352 56%, #FD784B 100%);
			border-radius: 20rpx;
			overflow: hidden;

			.flex {
				.bs {
					width: 150rpx;
					height: 70rpx;
				}

				.bs:nth-child(1) {
					background-color: #d90f3e;
					border-bottom-right-radius: 50rpx;
				}

				.bs:nth-child(2) {
					flex-shrink: 0;
					width: 420rpx;
					overflow: hidden;

					.ll {
						padding: 0 20rpx;
						width: 436rpx;
						height: 100%;
						margin-left: -8rpx;
						border-top-left-radius: 60rpx;
						border-top-right-radius: 60rpx;
						background-color: rgba(0, 0, 0, 0);
						box-shadow: 0 -36rpx 0 #d90f3e;

						.ls {
							.ii {
								margin: 0 5rpx;
							}
						}

						.ls:nth-child(1) {
							.ii {
								transform: rotate(45deg);
								height: 16rpx;
								width: 16rpx;
							}

							.ii:nth-child(1) {
								background-color: rgba(253, 217, 182, 1);
							}

							.ii:nth-child(2) {
								background-color: rgba(253, 217, 182, 0.8);
							}

							.ii:nth-child(3) {
								background-color: rgba(253, 217, 182, 0.5);
							}
						}

						.ls:nth-child(3) {
							.ii {
								transform: rotate(45deg);
								height: 16rpx;
								width: 16rpx;
							}

							.ii:nth-child(3) {
								background-color: rgba(253, 217, 182, 1);
							}

							.ii:nth-child(2) {
								background-color: rgba(253, 217, 182, 0.8);
							}

							.ii:nth-child(1) {
								background-color: rgba(253, 217, 182, 0.5);
							}
						}

						.ls {
							text-align: center;
							flex-grow: 1;
							color: #FFD6CB;
							font-size: 36rpx;
							font-weight: bold;
						}
					}
				}

				.bs:nth-child(3) {
					background-color: #d90f3e;
					border-bottom-left-radius: 50rpx;
				}
			}
		}

		.bottomColor {
			height: 270rpx;
			width: 100%;

			&>.flex {
				.item {
					height: 40rpx;
					width: 40rpx;
					overflow: hidden;

					&>.ls {
						height: 40rpx;
						width: 40rpx;
						box-shadow: 0 -20rpx 0 #d90f3e;
					}

					&:nth-child(1) {
						.ls {
							border-top-left-radius: 20rpx;
						}
					}

					&:nth-child(2) {
						.ls {
							border-top-right-radius: 20rpx;
						}
					}
				}
			}
		}

		.bottom {
			justify-content: space-around;

			.next {
				width: 34rpx;

				.tip {
					width: 34rpx;
					height: 38rpx;
				}
			}

			.item {
				width: 150rpx;

				.imgBox {
					width: 80rpx;
					height: 80rpx;
					background-color: #FFC98D;
					border-radius: 99rpx;
					margin: 0 auto;
					margin-bottom: 20rpx;

					.img {
						width: 50rpx;
					}
				}
			}
		}

		.flex-between-center {
			text-align: center;
			justify-content: space-around;
			color: #FFC98D;
			font-size: 22rpx;
			padding: 0 30rpx;
		}
	}
</style>
