<template>
	<view class="main">
		<view class="header-content">
			<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/mybanner.png" style="width:100%;height:260rpx;"></image>
		</view>
		<view class="pr" style="z-index:2">
			<view class="plr15">
				<view class="bdr4 pb20">
					<view class="m-dpflex m-justify-start m-align-center" style="height: 165rpx;">
						<image binderror="_binderror" mode="scaleToFill" :src="infodata.patient.avatar" style="width: 120rpx;height: 120rpx;border-radius: 50%;"></image>
						<text class="line1 f20 fb plr15 text-white">{{infodata.patient.name}}</text>
						<view class="pr tr m-flex">
							<navigator hoverClass="none" url="">
								<u-icon name="arrow-right" color="#fff" size="36"></u-icon>
							</navigator>
						</view>
					</view>
					<view class=" header-box" style="padding: 0 8rpx;background-color: #fff;border-radius: 16rpx;">
						<view class="cu-list menu">
							<view class="cu-item arrow" @click="">
								<view class="content">
									<text class="text-grey">证件照</text>
								</view>
								<view class="action">
									<text class="text-grey text-sm">未上传</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="fb f18 plr20" style="margin-bottom: 24rpx;">病例信息</view>
		<view class="margin-lr-sm">
			<view class="margin-top-sm" v-for="(item,index) in infodata.orders.cases" :key="index" style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
				<view class="flex justify-between align-center bg-white" style="padding: 28rpx;border-radius: 16rpx;">
					<view class="jinxing">
						<text style="display: inline-block;width: 12rpx;height: 12rpx;border-radius: 50%;background-color:#EEAA3F;margin-right: 8rpx;"></text>
						<text v-if="item.order_status==3">进行中</text>
						<text v-else-if="item.order_status==1">未支付</text>
						<text v-else-if="item.order_status==2">待接单</text>
						<text v-else-if="item.order_status==4">已完成</text>
						<text v-else>已取消</text>
					</view>
					<text class="phonezi" v-if="item.product_type==1">电话咨询</text>
					<text class="phonezi" v-else-if="item.product_type==2">图文咨询</text>
					<text class="phonezi" v-else-if="item.product_type==3">门诊预约</text>
					<text class="phonezi" v-else-if="item.product_type==4">疫苗接种预约</text>
					<text class="phonezi" v-else-if="item.product_type==5">儿保预约</text>
					<text class="phonezi" v-else-if="item.product_type==6">服务包</text>
				</view>
				<view class="" style="background: #FBFBFB;padding: 28rpx; border-radius: 16rpx;">
					<view class="nametaile flex align-center">
						<text>{{item.docter.name}}</text>
						<text class="text_style" v-for="(itm,idx) in item.docter.label" :key="index">{{itm}}</text>
					</view>
					<view class="textstyle margin-top-xs">
						科室：<text style="color: #333333;">{{item.docter.office.name}} {{item.docter.qualification.name}}</text>
					</view>
					<view class="textstyle margin-top-xs">
						编号：<text style="color: #333333;">{{item.order_sn}}</text>
					</view>
					<view class="textstyle margin-top-xs">
						咨询时间：<text style="color: #333333;">{{item.created_at}}</text>
					</view>
				</view>
			</view>
		</view>
		<view class="fb f18 plr20" style="margin-bottom: 24rpx;margin-top: 40rpx;">服务包</view>
		<view style="width: 100vw;height: auto;background-color: #f6f6f6;">
			<view style="width: 100%;height: 100%;">
				<view v-for="(item,index) in infodata.orders.service_packs" :key="index">
					<view class="card flex justify-center" v-for="itm,idx in item.order_pack" :key="idx">
						<view class="taocan" :data-id="item.id" @click="details">
							<view class="tc_left">
								<text>{{itm.pack_name}}</text>
							</view>
							<view class="tc_right">
								<view style="width: 100%;">
									<view class="text">{{itm.pack_intro}}</view>
									<!-- <view class="text">{{item.desc}}</view> -->
									<view class="text">
										<text style="text-align: left;">时长:{{itm.effective_days}}天</text>
										<text style="float: right;color: #FF4F61;font-weight: bold;">¥{{itm.pack_price/100}}</text>
									</view>
								</view>
								<view class="margin-top-xs">
									剩余时长：<u-count-down v-if="true" color="#EEAA3F" separator="zh" :timestamp="itm.end_time-miao"></u-count-down><text
									 v-else>已结束</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="cu-tabbar-height"></view>
		<view class="cu-tabbar-height"></view>
	</view>
</template>

<script>
	export default {
		onLoad(options) {
			this.id = options.id
		},
		onShow() {
			this.miao = parseInt(new Date().getTime() / 1000)
		},
		mounted() {
			this.getarchivesInfo()
		},
		data() {
			return {
				id: "",
				infodata: "",
				miao:""
			}
		},
		methods: {
			getarchivesInfo: async function() {
				let res = await this.$request.post("/api/v1/patient/patientDetail", {
					patient_id: this.id
				})
				console.log(res)
				if (res.status == 0) {
					this.infodata = res.data
				}
			}
		}
	};
</script>

<style scoped lang="scss">
	@import url("../index/mine.css");

	.main {}

	.text_style {
		font-weight: 400;
		margin-left: 15rpx;
		background-color: #E5F5FF;
		color: #0B73B9;
		width: 100rpx;
		height: 28rpx;
		font-size: 20rpx;
		border-radius: 10rpx;
		text-align: center;
		align-items: center;
	}

	.nametaile {
		font-size: 30rpx;
		font-weight: 500;
		color: #333333;
	}

	.textstyle {
		font-size: 26rpx;
		color: #666666;
		font-weight: 400;
	}

	.phonezi {
		width: 160rpx;
		height: 54rpx;
		background: #F6F6F6;
		border-radius: 27rpx;
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #666666;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.jinxing {
		height: 30rpx;
		font-size: 30rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #EEAA3F;
		display: flex;
		align-items: center;
	}

	.header-content {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		z-index: -1;
		overflow: hidden;
		box-sizing: border-box;
	}

	.header-box {
		box-shadow: 0px 8rpx 34rpx -6rpx rgba(248, 151, 164, 0.13);
	}

	.header-img {
		width: 36rpx;
		height: 36rpx;
	}

	.tip {
		position: absolute;
		top: 0;
		right: 20%;
		bottom: 0;
		background-color: red;
		width: 12rpx;
		height: 12rpx;
		border-radius: 50%;
	}

	.msg {
		top: -3rpx;
		right: -9rpx;
	}

	swiper {
		height: 320rpx;
	}

	.swiper-wrapper {
		padding: 0 10rpx;
		box-sizing: border-box;
	}

	.swiper-item {
		width: 100%;
		height: 300rpx;
		box-shadow: 0 26rpx 40rpx 0 rgba(255, 255, 255, 0.31);
		background: url("http://file.supermm.me/miniProgram/images/personal/bg_doc.png") no-repeat bottom center;
	}

	.dots {
		position: absolute;
		left: 0;
		right: 0;
		bottom: -40rpx;
		display: flex;
		justify-content: center;
	}

	.dots .dot {
		margin: 0 8rpx;
		width: 14rpx;
		height: 14rpx;
		background: #E4E4E4;
		border-radius: 8rpx;
		transition: all .6s;
	}

	.dots .dot.active {
		width: 24rpx;
		background: rgb(153, 153, 153);
	}

	.game-wrap {
		position: relative;
		width: 100%;
		height: 100%;
		overflow: hidden;
		box-sizing: border-box;
	}

	.game-item {
		height: 100%;
		background: url("https://file.supermm.me/h5/wechat-h5/integral/personeBg001.jpg") no-repeat;
		background-size: 100% 100%;
		background-position: center center;
		border-radius: 100rpx;
	}

	.card {
		width: 100%;
		height: auto;
		margin-top: 20rpx;

		// background-image: url(../../static/服务包.png);
		.taocan {
			width: 710rpx;
			height: 230rpx;
			position: relative;
			display: flex;
			border-radius: 10rpx;
			background: radial-gradient(circle at right top, transparent 15rpx, #ffffff 0) top left / 152rpx 51% no-repeat,
				radial-gradient(circle at right bottom, transparent 15rpx, #ffffff 0) bottom left /152rpx 51% no-repeat,
				radial-gradient(circle at left top, transparent 15rpx, #ffffff 0) top right /560rpx 51% no-repeat,
				radial-gradient(circle at left bottom, transparent 15rpx, #ffffff 0) bottom right /560rpx 51% no-repeat;
			filter: drop-shadow(0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.04));
		}
	}

	.tc_left {
		display: flex;

		justify-content: center;
		align-items: center;
		width: 152rpx;

		text {
			font-size: 30rpx;
			font-weight: bold;
		}
	}

	.tc_right {
		display: flex;
		flex-direction: column;
		justify-content: center;
		width: 550rpx;
		padding: 0 20rpx;
		font-size: 26rpx;

		.text {
			padding: 10rpx 0rpx;
			width: 100%;
		}
	}
</style>
