<template>
	<view style="width: 100%;height: 100%;background-color: #ececec;">
		<!-- 卡券 -->
		<view class="card">
			<view class="card_view">
				<!-- 放图片 标题 -->
				<view class="title">
					<image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/横占位图.png" class="img"></image>
				</view>
				<!-- 放描述 -->
				<view class="describe">
					<view style="font-size: 40rpx;font-weight: bold;">{{tcID}}</view>
					<view style="font-size: 28rpx;font-weight: bold;padding-top: 60rpx;">有效期</view>
					<view style="font-size: 26rpx;color: #999999;padding-top: 30rpx;">自购买服务起{{tcTime}}</view>
					<view style="font-size: 28rpx;font-weight: bold;padding-top: 50rpx;">服务包内容介绍</view>
					<view style="font-size: 26rpx;color: #999999;">
						<view style="padding: 27rpx 0 12rpx 0;">{{tcContent.content}}</view>
						<view style="padding: 12rpx 0;">{{tcContent.scope}}</view>
						<view style="padding: 12rpx 0;">{{tcContent.giving}}</view>
					</view>
					<view style="font-size: 28rpx;font-weight: bold;padding-top: 48rpx;">家属团队</view>
					<view class="list" v-for="item,index in tcTeam" :key='index'>
						<!-- 头像 -->
						<view class="portrait">
							<view style="padding-top: 20rpx;">
								<image class="img" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/头像.png"></image>
								<view class="bun" @click="follow">关注</view>
							</view>
						</view>
						<!-- 文字 -->
						<view class="text">
							<!-- 名字+标签 -->
							<view class="name">
								<view style="margin-right: 15rpx;">{{item.name}}</view>
								<view class="label">{{item.label1}}</view>
								<view class="label">{{item.label2}}</view>
							</view>
							<!-- 科室 -->
							<view class="department">
								<text>科室:</text>
								<text style="color: #333333;">{{item.department1}}</text>
								<text style="color: #333333;">{{item.department2}}</text>
							</view>
							<!-- 选项 -->
							<view class="option">
								<view>图文</view>
								<view>电话</view>
								<view>门诊</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 协议 -->
		<view style="height: 200rpx;width: 100%;display: flex;justify-content: flex-end;">
			<view style="height: 35rpx;width: auto;font-size: 24rpx;margin-right: 30rpx;display: flex;align-items: center;">
				<image @click="isqueren" :src="imgitem.name" mode="" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;"></image>
				<text style="color: #999999;">已阅读并同意</text>
				<text style="color: #0B73B9;">《超级宝妈宝》</text>
				<text style="color: #999999;">服务协议</text>
			</view>
		</view>
		<!-- 两个半圆 -->
		<view class="round" style="position:absolute;top: 25vh;right:0;"></view>
		<view class="round" style="position:absolute;top: 25vh;"></view>
		<!-- 底部按钮 -->
		<view class="footer">
			<view class="cu-bar bg-white tabbar border shop" style="width: 100%;">
				<button class="action" open-type="contact" style="width: 33%;">
					<view class="cuIcon-service text-green">
					</view>
					客服
				</button>
				<view class="submit" @click="next" style="background-color: #0B73B9; color: #FFFFFF;">下一步</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'productdetailspage',
		data() {
			return {
				//协议
				num: 1,
				imgitem: {
					istrue: false,
					name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
				},
				tcID: '套餐一', //ID
				tcTime: '一年', //套餐有效期
				tcContent: { //套餐内容
					content: '套餐一包含包含疫苗接种、门诊预约、儿保预约三项服务', //内容
					scope: '使用范围：家医团队可用，有效期内无限次、300元额度以内门诊预约与儿保预约无限制', //范围
					giving: '赠送XXXX保险：保险介绍' //赠送
				},
				tcTeam: [{
					id: '1',
					name: '熊大',
					label1: '熊',
					label2: '主角',
					department1: '外科',
					department2: '主任医师'
				}, {
					id: '1',
					name: '熊二',
					label1: '熊',
					label2: '主角',
					department1: '外科',
					department2: '主任医师'
				}, {
					id: '1',
					name: '光头强',
					label1: '人',
					label2: '主角',
					department1: '外科',
					department2: '主任医师'
				}, {
					id: '1',
					name: '李老板',
					label1: '人',
					label2: '配角',
					department1: '外科',
					department2: '主任医师'
				}, {
					id: '1',
					name: '吉吉国王',
					label1: '猴子',
					label2: '配角',
					department1: '外科',
					department2: '主任医师'
				}, {
					id: '1',
					name: '毛毛',
					label1: '猴子',
					label2: '配角',
					department1: '外科',
					department2: '主任医师'
				}, {
					id: '1',
					name: '蹦蹦',
					label1: '猴子',
					label2: '配角',
					department1: '外科',
					department2: '主任医师'
				}],
				packs: {
					id: '', //ID
					name: '', //名称
					intro: '', //简介
					desc: '', //详细介绍
					price: '', //价格(单位分)
					team_id: '', //医生团队ID
					phone_minutes: '', //电话分钟数
					chat_num: '', //图文咨询次数
					appoint_num: '', //门诊预约次数
					vaccine_limit_amount: '', //疫苗总金额限制
					nurses_limit_amount: '', //儿保总金额限制
					effective_days: '', //有效天数
					created_at: '', //创建时间
					updated_at: '' //更新时间
				}
			}
		},
		methods: {
			//关注
			follow(e) {

			},
			isqueren() {
				this.num++
				if (this.num % 2 == 0) {
					this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyixuan.png"
					this.imgitem.istrue = true

				} else {
					this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
					this.imgitem.istrue = false
				}
			},
			next(e) {
				if (this.imgitem.istrue == false) {
					uni.showToast({
						icon: 'none',
						position: 'bottom',
						title: '请先同意《协议》'
					});
				}else{
					uni.navigateTo({
						url:'/pages/service_packs/packs_information'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.footer {
		width: 100%;
		height: auto;
		display: flex;
		position: fixed;
		bottom: 0;
	}

	.round {
		height: 45rpx;
		width: 50rpx;
		border-radius: 50%;
		background-color: #ececec;
	}

	.card {
		padding: 30rpx 30rpx;
		box-sizing: border-box;

		.card_view {
			width: 100%;
			background-color: #ffffff;
			border-radius: 15rpx;

			.title {
				width: 100%;
				height: 20vh;
				display: flex;
				justify-content: center;
				align-items: flex-end;

				.img {
					width: 90%;
					height: 90%;
				}
			}

			.describe {
				width: 100%;
				height: 1;
				padding: 100rpx 40rpx 20rpx 40rpx;
			}
		}
	}

	.list {
		margin: 20rpx 0 10rpx 0;
		display: flex;
		width: 100%;
		height: 200rpx;
		border-radius: 15rpx;
		background-color: #FFFFFF;
		box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);

		.portrait {
			width: 30%;
			height: 100%;
			display: flex;
			justify-content: center;
			align-items: center;



			.img {
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
			}

			.bun {
				text-align: center;
				width: 80rpx;
				height: 36rpx;
				background-color: #D92975;
				margin: 0 10rpx;
				border-radius: 60rpx;
				position: relative;
				top: -20rpx;
				font-size: 20rpx;
				color: #FFFFFF;
				padding: 3rpx 0;
			}
		}

		//文字
		.text {
			width: 70%;
			height: 100%;

			padding: 20rpx 0;

			//名字+标签
			.name {
				font-size: 30rpx;
				font-weight: bold;
				display: flex;
				align-items: center;

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

			//科室
			.department {
				padding: 20rpx 0;
				color: #666666;

				text {
					margin-right: 15rpx;
				}
			}

			// 选项
			.option {
				display: flex;

				view {
					background-color: #E4E4E4;
					width: 100rpx;
					height: 48rpx;
					border-radius: 12px;
					margin-right: 15rpx;
					display: flex;
					justify-content: center;
					align-items: center;
				}
			}

		}



	}
</style>
