<template>
	<view class="container">
		<view class="name">请选择注册您的身份</view>
		<view class="image" @click="ToRegister(1)">
			<image src="../../static/img/img001.png"></image>
			<view class="identity">用户</view>
			<view class="info">完成注册后可联系麻醉医师</view>
		</view>
		<view class="image" @click="ToRegister(2)">
			<image src="../../static/img/img002.png"></image>
			<view class="identity">我是麻醉医师</view>
			<view class="info">完成注册 成为入驻医生</view>
		</view>
		<view class="image" @click="ToRegister(3)">
			<image src="../../static/img/img003.png"></image>
			<view class="identity">医疗机构</view>
			<view class="info">完成注册后可联系麻醉医师</view>
		</view>
	</view>
</template>
<script>
import { choseType } from '@/api/index.js';
export default {
	data() {
		return {};
	},
	methods: {
		ToRegister(item) {
			let obj = this;
			let type = +item;
			choseType({
				type: type
			})
				.then(function(e) {
					if (e.msg == '修改成功') {
						if (type == 1) {
							uni.navigateTo({
								url: `/pages/public/PatRegister`
							});
						}
						if (type == 2) {
							uni.navigateTo({
								url: `/pages/public/DocRegister`
							});
						}
						if (type == 3) {
							uni.navigateTo({
								url: `/pages/public/MecRegister`
							});
						}
					}
				})
				.catch(e => {
					console.log(e);
				});
		},
	}
};
</script>

<style lang="scss">
page {
	background: #ffffff;
	height: 100%;
}
.container {
	width: 100%;
	padding: 90rpx 60rpx;
}
.name {
	padding: 60rpx 0rpx;
	color: #323232;
	font-size: 50rpx;
	font-weight: bold;
}
.image {
	width: 100%;
	height: 230rpx;
	position: relative;
	margin-bottom: 45rpx;
	image {
		width: 100%;
		height: 100%;
	}
	.identity {
		position: absolute;
		top: 60rpx;
		left: 50rpx;
		color: #ffffff;
		font-size: 40rpx;
	}
	.info {
		position: absolute;
		left: 50rpx;
		top: 125rpx;
		color: #ffffff;
		font-size: 28rpx;
		opacity: 0.5;
	}
}
</style>
