<template>
	<view class="content">
		<view id="poster" class="poster">
			<view class="top">
				<view class="top-cont">
					<image class="top-cont-img" src="https://cdn.douhuofalv.com/images/2023/04/24/a45643fc33ca42b7a430aee573a93da4.png" mode="widthFix"></image>
				</view>
				<image class="top-img" src="https://cdn.douhuofalv.com/images/2023/04/20/2ea5fc20ffc90e7feec7ba2650b81c99.png" mode="widthFix"></image>
			</view>
			<view class="confirm">
				<view class="confirm-white">
					<view class="confirm-top">订单号 {{seekData.order_no}}</view>
					<view class="confirm-list">
						<view class="confirm-item" v-for="(item, index) in seekData.params">
							<view class="confirm-item-label">{{item.title}}</view>
							<view class="confirm-item-text" v-if="item.key == 'address'">{{item.value_text.province_name}}{{item.value_text.city}}</view>
							<view class="confirm-item-text" v-else><text v-if="item.key == 'price'">￥</text> {{item.value_text}}</view>
						</view>
					</view>
					<view class="confirm-user">
						<view class="confirm-user-text"><image src="https://cdn.douhuofalv.com/images/2023/04/20/c359f2fa277e6658157c7108f37d0d44.png" mode="widthFix"></image> 业务联系人</view>
						<view class="confirm-user-name">{{parent.nickname}}</view>
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import { VueCanvasPoster } from 'vue-canvas-poster'
	import { yearOrderSee } from '@/apis/interfaces/synthesis'
	import html2canvas from 'html2canvas';
	export default {
		components: {
		    VueCanvasPoster
		},
		data() {
			return {
				seekData  : '', // 咨询详情数据
				parent    : '', // 联系人
				isImgLay  : false,
				posterImg: "", //生成的海报图片路径
			}
		},
		
		created() {
			// 获取综法咨询-咨询详情
			this.getBusiness();
		},
		
		methods: {
			// 综法咨询-咨询详情
			getBusiness(){
				yearOrderSee(this.$Route.query.servicesId).then(res => {
					this.seekData = res
					this.parent   = res.user.parent
				}).catch(err => {
					uni.showToast({
						title: err.message,
						icon : 'none'
					})
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background-image: linear-gradient(to bottom,#041f79, #111e4b);
		width: 100vw;
		height: 100%;
		overflow-y: scroll;
		position: absolute;
	}
	
	.poster {
		background-image: linear-gradient(to bottom,#041f79, #111e4b);
	}
	
	.top {
		position: relative;
		height: 320rpx;
		z-index: 4;
		.top-img {
			position: absolute;
			right: 0;
			top: 0;
			width: 35%;
		}
		.top-cont {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			padding: 80rpx 30rpx 0;
			box-sizing: border-box;
			text-align: center;
			.top-cont-name {
				font-weight: 600;
				font-size: 74rpx;
				background-image: linear-gradient(to right,#f1c694, #fffbf6 70%);
				background-image: -webkit-linear-gradient(to right,#f1c694, #fffbf6 70%);
				-webkit-background-clip:text; 
				-webkit-text-fill-color:transparent;
				margin-bottom: 10rpx;
			}
			.top-cont-img {
				width: 90%;
				margin-bottom: 15rpx;
			}
		}
	}
	
	.backImg {
		width: 100%;
		position: absolute;
		left: 0;
		top: 0;
	}
	
	.confirm {
		padding: 0 30rpx 100rpx;
		box-sizing: border-box;
		position: relative;
		top: 0;
		left: 0;
		z-index: 9;
		width: 100%;
		.confirm-white {
			border-radius: 15rpx;
			background-color: #ffffff;
			position: relative;
			&::after {
				content: '';
				position: absolute;
				width: calc(100% - 80rpx);
				height: 60rpx;
				background-color: rgba(255, 255, 255, .3);
				bottom: -30rpx;
				left: 40rpx;
				border-radius: 0 0 15rpx 15rpx;
			}
			&::before {
				content: '';
				position: absolute;
				width: calc(100% - 160rpx);
				height: 120rpx;
				background-color: rgba(255, 255, 255, .1);
				bottom: -60rpx;
				left: 80rpx;
				border-radius: 0 0 15rpx 15rpx;
			}
			.confirm-top {
				background-color: #f7faff;
				border-radius: 15rpx 15rpx 0 0;
				line-height: 110rpx;
				padding: 0 30rpx;
				box-sizing: border-box;
				font-weight: 600;
				font-size: 34rpx;
			}
			.confirm-list {
				padding: 10rpx 30rpx;
				box-sizing: border-box;
				.confirm-item {
					line-height: 40rpx;
					padding: 20rpx 0;
					.confirm-item-label {
						padding-bottom: 20rpx;
					}
					.confirm-item-text {
						color: #666666;
						background-color: #f6f6f6;
						padding: 25rpx;
						box-sizing: border-box;
						border-radius: 10rpx;
						text-align: justify;
						line-height: 44rpx;
					}
				}
			}
			.confirm-user {
				border-top: 2rpx solid #eeeeee;
				line-height: 110rpx;
				display: flex;
				padding: 0 30rpx;
				box-sizing: border-box;
				font-weight: 600;
				font-size: 34rpx;
				color: #041f79;
				.confirm-user-text {
					flex: 1;
					display: flex;
					image {
						width: 32rpx;
						margin: 40rpx 15rpx 0 0;
					}
				}
			}
		}
		
	}
</style>