<template>
	<view class="content">
		<view class="cont">
			<view class="bg">
				<image src="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/huyi/imagesNew/3305ca20c3f646c6b465918efb07f849.png"></image>
			</view>
			<view class="top-box"   >
				<view class="status_bar" :style="{height: statusBarHeight}"></view>
				<view class="top-title">
					<image @click="goBack()" src="https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/huyi/images/icon_back_w.png"></image>
					<view class="title"  >用药报告</view>
				</view>
				
			</view>
			<view class="cont-box" v-if="report!=null">
				<view class="status_bar" :style="{height: statusBarHeight}"></view>
				<view class="user">
					<image :src="report.avatar==null?'https://cqtyt-2025.oss-cn-beijing.aliyuncs.com/huyi/imagesNew/22cb9518a55040dea74d8f730551a7a2.jpg':report.avatar"></image>
					<view class="user-box">
						<view class="username">{{report.doctorName}}</view>
					</view>
					 
				</view>
				<view class="items">
					<view class="result-box">
						<view class="name">用药咨询报告</view>
						<view class="time">报告时间 {{report.createTime}}</view>
					</view>
					<view class="item-box" v-if="report!=null&&report.reportSummary!=null&&report.reportSummary!=''" >
						<view class="item">
							<view class="title-box">
								<view class="title-line"></view>
								<view class="title">咨询总结</view>
							</view>
							<view class="descs" >{{report.reportSummary}}</view>
							
						</view>
						<view   class="line"></view>
					</view>
					<view class="item-box"  v-if="report!=null&&report.reportAdvice!=null&&report.reportAdvice!=''">
						<view class="item">
							<view class="title-box">
								<view class="title-line"></view>
								<view class="title">生活建议</view>
							</view>
							<view class="descs" >{{report.reportAdvice}}</view>
						</view>
					</view>
				</view>
				<!-- <view class="sign">
					医生签名
					<image :src="report.doctorSignUrl"></image>
				</view>
				<view class="tips">
					注：本次会诊，仅为针对患者当前身体情况的咨询问诊建议，不作为长期参考依据。
				</view> -->
			</view>
		</view>
		<view class="btn-box" v-if="report.status==1">
			<view class="btn" @click="doPing()">咨询评价</view>
		</view>
	</view> 
</template>
 
<script  >
	import {getDrugReportById} from '@/api/drugReport'
	export default {
		data() {
			return {
				statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
				reportId:null,
				report:null,
			}
		},
		onLoad(options) {
			this.reportId=options.reportId;
		},
		onShow() {
			this.getDrugReportById();
		},
		methods: {
			goBack(){
				uni.navigateBack()
			},
			doPing(){
				uni.navigateTo({
					url: "./drugReportPing?reportId="+this.reportId
				})
			}, 
			getDrugReportById(){
				var that=this;
				var data={reportId:this.reportId}
				getDrugReportById(data).then(
					res => {
						if(res.code==200){
							this.report=res.data;
						}
					},
					err => {
					}
				);
				
			},
		}
	}
</script>
 
<style scoped lang="scss">
	page{
		background-color: #FDF7F0;
		height: 100%;
	}
	.content{
		.cont{
			position: relative;
			width: 100%;
			display: flex;
			flex-direction: column;
			.bg{
				width: 100%;
				height:650rpx;
				// background-color: #2BC7B9;
				// background: linear-gradient(#2BC7B9, #88e2da);
				position: fixed;
				image{
					width: 100%;
					height:100%;
				}
				z-index: 1;
			}
			.top-box{
				width: 100%;
				position: fixed;
				top: 0;
				left: 0;
				z-index: 1001;
				.top-title{
					height: 88upx;
					// line-height: 88upx;
					display: flex;
					align-items: center;
					justify-content: center;
					position: relative;
					image{
						position: absolute;
						left:15rpx;
						width:44rpx;
						height:44rpx;
					}
					.title{
						font-size: 32upx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #ffffff;
					}
				}
				 
			}
			.cont-box{
				z-index: 1000;
				margin-top: 88rpx;
				.user{
					width: 100%;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					padding: 30rpx;
					image{
						border-radius: 50%;
						border: 2rpx solid #ffffff;
						width:120rpx;
						height:120rpx;
					}
					.user-box{
						padding: 30rpx;
						display: flex;
						align-items: center;
						justify-content: center;
						.sex{
							font-size: 28supx;
							font-family: PingFang SC;
							color: #ffffff;
						}
						.username{
							margin-left: 15rpx;
							font-size: 28supx;
							font-family: PingFang SC;
							color: #ffffff;
						}
						
					}
				}
				.items{
					width: 100%;
					display: flex;
					flex-direction: column;
					align-items: flex-start;
					justify-content: flex-start;
					padding: 20rpx;
					.result-box{
						width: 100%;
						display: flex;
						flex-direction: column;
						align-items:center;
						justify-content: center;
						padding: 30rpx;
						background-color: #fff;
						border-radius: 15rpx;
						margin-bottom: 15rpx;
						.time{
							margin-top: 15rpx;
							font-family: PingFang SC;
							font-size: 24rpx;
							color: #9B9B9B;
						}
						.title{
							margin-top: 15rpx;
							font-family: PingFang SC;
							font-size: 28rpx;
							color: #626468;
							
						}
						.name{
							font-family: PingFang SC;
							font-weight: bold;
							font-size: 38rpx;
							color: #DF6440;
						}
						.descs{
							font-family: PingFang SC;
							font-size: 28rpx;
							color: #2A2B2E;
							padding: 30rpx;
							margin-top: 30rpx;
							background-color: #F5F6F6;
							border-radius: 10rpx;
						}
					}
					.item-box{
						width: 100%;
						.item{
							width: 100%;
							padding: 30rpx;
							background-color: #fff;
							border-radius:30rpx;
							.title-box{
								display: flex;
								align-items:center;
								justify-content: flex-start;
								.title{
									margin-left: 10rpx;
									font-size: 32supx;
									font-family: PingFang SC;
									color: #2A2B2E;
									font-weight: bold;
								}
								.title-line{
									width: 8rpx;
									height: 28rpx;
									background: #078C9D;
									border-radius: 2px 2px 2px 2px;
									opacity: 1;
								}
								
							}
							.descs{
								white-space: pre-line; 
								margin-top: 10rpx;
								font-size: 28supx;
								font-family: PingFang SC;
								color: #2A2B2E;
							}
							
						}
						.line{
							margin: 0rpx 30rpx;
							border-bottom: #b5b5b5 3rpx dashed;
						}
						
					}
				
					
					
				}
				.sign{
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: center;
					margin: 15rpx 0rpx;
					color: #9B9B9B;
					font-size: 24rpx;
					image{
						margin-left: 20rpx;
						width: 240rpx;
						height: 100rpx;
					}
				}
				.tips{
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: center;
					margin: 15rpx 0rpx;
					color: #9B9B9B;
					font-size: 24rpx;
				}
			}
		}
		
	}
	.btn-box{
		height: 140upx;
		z-index: 9999;
		width: 100%;
		padding: 0rpx 30upx;
		position: fixed;
		bottom: 0;
		left: 0;
		box-sizing: border-box;
		background-color: #ffffff;
		display: flex;
		align-items: center;
		justify-content: center;
		.btn{
			width: 100%;
			height: 88upx;
			line-height: 88upx;
			text-align: center;
			font-size: 34upx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
			background: #078C9D;
			border-radius: 10upx;
		}
	}
</style>
