<template>
	<view class="content">
		<block v-if="detail">
			<image class="top" :src="detail.img" mode="widthFix"></image>
			<view class="box">
				<view class="title">{{detail.title}}</view>
				<view class="client">客户:<span>{{detail.client}}</span></view>
				<view class="intro">{{detail.intro}}</view>
				<view class="title t2">效果</view>
				<view class="intro">{{detail.effect}}</view>
			</view>
		</block>
	</view>
</template>

<script>
	import { data } from '../plan/data.js'
	export default {
		data(){
			return {
				detail:null
			}
		},
		created() {
			uni.setNavigationBarTitle({
				title:'案例'
			})
		},
		onLoad(option) {
			if(option.id&&option.key){
				this.getDetails(option.id,option.key);
			}
		},
		methods:{
			getDetails(id,key){
				let temp = data[key];
				if(temp.length){ 
					this.detail = temp.find(t=>t.id == id).details || null;
				}
			}
		}
	}
</script>

<style scoped lang="less">
	.content{
		.top{
			width: 100%;
		}
		
		.box{
			width: 100%;
			padding: 0 30rpx 30rpx;
			box-sizing: border-box;
			
			.title{
				font-family: PingFang-SC, PingFang-SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #111111;
				line-height: 45rpx;
				margin-top: 36rpx;
				&.t2{
					margin-top: 48rpx;
				}
			}
			
			.client{
				font-family: PingFangSC, PingFang SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #333333;
				line-height: 45rpx;
				margin-top: 21rpx;
				span{
					font-size: 30rpx;
					line-height: 42rpx;
					color: #134F99;
				}
			}
			
			.intro{
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #666666;
				line-height: 48rpx;
				letter-spacing: 2rpx;
				margin-top: 21rpx;
			}
			
			.effect{
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #666666;
				line-height: 40rpx;
				margin-top: 6rpx;
			}
		}
	}
</style>