<template>
	<view class="content">
		<view class="cont-bg">
			<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/42d328f9604947eea86b6331ff7013e6.jpg"></image>
		</view>
		<view class="cont" >
			<view class="inquiry-item" v-for="(item) in inquirySubTypes"  @click="doInquiryForm(item.value)" >
				<view class="left"  >
					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/logo.png" mode="aspectFit"></image>
					<view class="inquiry-cont">
						<view class="name">{{item.lable}}</view>
						<!-- <view class="desc">医疗专家团队远程咨询</view> -->
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import {getConfigByKey} from '@/api/common.js'
	export default {
		data() {
			return {
				inquirySubTypes:[],
				companyId:null,
				companyUserId:null,
				isShare:null,
				 
			}
		},
		onLoad(options) {
			this.isShare=options.isShare;
			this.companyId=options.companyId;
			this.companyUserId=options.companyUserId;
			this.getConfig();
			
		},
		onShow() {
		 
		},
		methods: {
			getConfig(){
				var data={key:"his.inquiryConfig",appId:wx.getAccountInfoSync().miniProgram.appId,}
				getConfigByKey(data).then(
					res => {
						if(res.code==200){
							console.log(res)
							this.inquirySubTypes=JSON.parse(res.data).inquirySubType;
							 
						}
					},
					rej => {}
				);
			},
			doInquiryForm(type){
				this.$isLogin().then(
					res => {
						console.log(res)
						if(res){
							if(type==3){
								uni.navigateTo({
								 	url: "/pages_order/inquiryForm2_2?inquiryType=2&orderType=2&inquirySubType="+type+"&companyId="+this.companyId+"&companyUserId="+this.companyUserId+"&isShare="+this.isShare,
								})
							} else if(type==4) {
								
							} else {
								uni.navigateTo({
								 	url: "/pages_order/inquiryForm2_1?inquiryType=2&orderType=2&inquirySubType="+type+"&companyId="+this.companyId+"&companyUserId="+this.companyUserId+"&isShare="+this.isShare,
								})
							}
						}
						else{
							uni.navigateTo({
								url:'/pages/auth/login'
							})
						}
					}
				);
				
				
			}
			 
		}
	}
</script>
<style lang="scss">
	page{
		background: #f1f6fc;
	}
</style>
<style scoped lang="scss">
	.content{
		position: relative;
		.cont-bg{
			z-index: 1;
			position: fixed;
			top:0rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;
			height:100%;
			image{
				width: 100%;
				height:100%
			}
		}
		.bg{
			position: relative;
			z-index: 999;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;
			image{
				width:400rpx;
				height:400rpx;
			}
		}
		 
		.cont{
			position: relative;
			z-index: 999;
			margin: 30rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.inquiry-item{
				background: linear-gradient(0deg, #FCE2C9, #FFFBF5);
				border: 5rpx solid rgba(247,201,162,0.25);
				box-shadow: 0px 5rpx 20rpx 3rpx rgba(0,0,0,0.61);
				border-radius: 120rpx;
				margin-bottom: 60rpx;
				padding: 10rpx;
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				.left{
					display: flex;
					align-items: center;
					justify-content: flex-start;
					image{
						border: 10rpx solid #fff;
						border-radius: 50%;
						background-color: #fff;
						width: 150rpx;
						height:150rpx;
					}
					.inquiry-cont{
						margin-left: 20rpx;
						display: flex;
						flex-direction: column;
						align-items: flex-start;
						justify-content: flex-start;
						.name{
							font-size: 30upx;
							font-family: PingFang SC;
							font-weight: bold;
							color: #76491C;
						}
						.desc{
							margin-top: 15rpx;
							font-size: 28upx;
							font-family: PingFang SC;
							color: #6F471E;
						}
					}
				}
				 
			}
		}
	}
</style>
