<template>
	<view class="content">
		<!-- 推荐 -->
		<view class="recommend">
			<view class="item">
				<image class="loanBack" src="@/static/imgs/loanBack.png" mode="widthFix"></image>
				<image class="loanIcon" src="@/static/imgs/loanIcon.png" mode="widthFix"></image>
				<view class="loanTips">
					优选推荐
				</view>
				<block v-for="(item, index) in baleData" :key="index">
					<view class="title">
						<view class="title-left">
							{{item.title}}
						</view>
						<view class="title-right">
							<view class="title-price">
								<text>￥</text>{{item.price}}
							</view>
						</view>
					</view>
					<view class="exhibition">
						<view class="label" v-for="(items, itemsIndex) in item.items" :key="itemsIndex">
							<view class="label-title">
								<view class="label-name">
									{{items.business}}
								</view>
								<view class="label-tips">
									<text>{{items.title}}</text>
								</view>
							</view>
							<view class="label-text">
								<view class="nowrap label-show">
									{{items.type}}
								</view>
								<view class="label-price">
									￥{{items.price}}
								</view>
							</view>
						</view>
					</view>
				</block>
			</view>
		</view>
		
	</view>
</template>


<script>
	import { baleSee } from '@/apis/interfaces/user'
	
	export default {
		data() {
			return {
				baleData: [], // 服务包列表
			}
		},
		
		onShow() {
			// 获取服务包
			this.baleInfo()
		},
		
		methods: {
			// 服务包
			baleInfo(){
				baleSee(this.$Route.query.id).then(res => {
					this.baleData = res
				}).catch(err => {
					uni.showToast({
						title: err.message,
						icon : 'none'
					})
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background-color: #f6f6f6;
		height: 100vh;
		// height: calc(100vh - 44px);
		overflow-y: scroll;
		padding: $padding;
		box-sizing: border-box;
	}
	
	.item {
		background-color: #ffffff;
		padding: $padding;
		box-sizing: border-box;
		border-radius: $radius;
		margin-bottom: $margin;
		box-shadow: 0 0 10rpx rgba(0, 0, 0, .05);
		.title {
			display: flex;
			line-height: 48rpx;
			font-size: $title-size + 2;
			font-weight: 600;
			margin: $margin 0 $margin - 15;
			.title-left {
				flex: 1;
				text {
					font-size: $title-size-m;
					padding: 0 10rpx;
				}
			}
			.title-right {
				display: flex;
				color: #111111;
				text {
					font-size: $title-size-sm;
				}
				.title-price {
					font-size: $title-size + 4;
				}
			}
		}
		.exhibition {
			background: #FFF5F9;
			padding: $padding;
			box-sizing: border-box;
			border-radius: $radius;
			.label {
				margin-bottom: $margin + 25;
				&:last-child {
					margin-bottom: 0;
				}
				.label-title {
					display: flex;
					margin-bottom: $margin - 10;
					.label-name {
						line-height: 38rpx;
						color: #111111;
					}
					.label-tips {
						display: flex;
						text {
							display: flex;
							border: 2rpx solid $mian-color;
							color: $mian-color;
							font-size: $title-size-sm - 2;
							border-radius: $radius * 2;
							padding: 0 10rpx;
							margin-left: 10rpx;
							height: 38rpx;
							line-height: 38rpx;
						}
					}
				}
				.label-text {
					display: flex;
					font-size: $title-size-m;
					.label-show {
						color: #999999;
						flex: 1;
						margin-right: 20rpx;
					}
					.label-price {
						color: $mian-color;
					}
				}
			}
		}
	}
	
	
	// 推荐位
	.recommend {
		.item {
			padding-top: $padding * 3;
			position: relative;
			border: 4rpx solid $mian-color;
			box-shadow: 0 0 10rpx rgba(3, 55, 190, .05);
			.loanBack {
				width: 220rpx;
				position: absolute;
				left: -16rpx;
				top: 30rpx;
			}
			.loanTips {
				width: 180rpx;
				position: absolute;
				left: 0;
				top: 30rpx;
				height: 60rpx;
				line-height: 60rpx;
				text-align: center;
				color: #ffffff;
				z-index: 2;
				font-size: $title-size + 2;
			}
			.loanIcon {
				width: 74rpx;
				position: absolute;
				top: 30rpx;
				right: 30rpx;
			}
			.title-right {
				color: $mian-color !important;
			}
		}
	}
</style>