<template>
	<view class="">
		<view class="list" @tap="caseDetail">
			<view class="listItem">
				<view class="lable">
					案件编号：
				</view>
				<view class="main">
					{{defalutVal.caseNum}}
				</view>
			</view>
			<view class="listItem" v-if="sysType == 1">
				<view class="lable">
					申请人姓名：
				</view>
				<view class="main">
					{{defalutVal.applicantName}}
				</view>
			</view>
			<view class="listItem" v-if="sysType == 2">
				<view class="lable">
					申请人姓名：
				</view>
				<view class="main">
					{{defalutVal.applicationOrganName}}
				</view>
			</view>
			<view class="listItem" style="margin-top:22rpx">
				<view class="lable">
					被申请人姓名：
				</view>
				<view class="main">
					{{defalutVal.respondentName}}
				</view>
			</view>
			<view class="listItem">
				<view class="lable">
					案件状态：
				</view>
				<view class="main">
					{{defalutVal.caseStatusName}}
				</view>
			</view>
			<view class="listItem">
				<view class="lable">
					案件房间号：
				</view>
				<view class="main">
					{{defalutVal.roomId}}
				</view>
			</view>
			<view class="listItem" v-if="sysType == 1">
				<view class="lable">
					开庭时间：
				</view>
				<view class="main">
					{{defalutVal.scheduleStartTime}}
				</view>
			</view>
			<view class="listItem" v-if="sysType == 2">
				<view class="lable">
					开庭时间：
				</view>
				<view class="main">
					{{defalutVal.hearDate}}
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				sysType: null
			}
		},
		props: {
			defalutVal: {
				type: Object,
				default: () => {}
			}
		},
		methods: {
			// 在线开庭详情以及操作
			caseDetail() {
				let imUrl = '';
				let type = 1;
				if (this.sysType == 1) {
					imUrl = encodeURIComponent(
						`https://txroom.xayunmei.com/#/home?name=${this.$store.state.user.name}&id=${this.defalutVal.id}&userId=${this.$store.state.user.userId}&roomId=${this.defalutVal.roomId}`
					)
				} else if (this.sysType == 2) {
					imUrl = encodeURIComponent(
						`https://txroom.xayunmei.com/#/home?name=${this.$store.state.user.name}&id=${this.defalutVal.id}&userId=${this.$store.state.user.userId}&roomId=${this.defalutVal.roomId}&type=${type}`
					)
				}
				uni.navigateTo({
					url: `/pages/im/component/imHome?imUrl=${imUrl}`
				})
			}
		},
		created() {
			this.sysType = uni.getStorageSync('sysType');
		}
	}
</script>

<style lang="scss" scoped>
	.list {
		padding: 15rpx;
		display: flex;
		flex-direction: column;
		background-color: #ffffff;
		border-radius: 30rpx;
		margin-top: 20rpx;

		.listItem {
			width: 100%;
			display: flex;
			height: 50rpx;

			.lable {
				width: 30%;
			}

			.main {
				width: 60%;
			}
		}

		.btn {
			margin-top: 20rpx;
			width: 100%;
			display: flex;
			justify-content: space-between;

			.btnItem {
				height: 50rpx;
				background-color: #5395ff;
				border-radius: 10rpx;
				text-align: center;
				line-height: 50rpx;
			}
		}
	}
</style>