<template>
	<view class="page">
		<view class="zhutu">
			  <!-- <u-image width="100%" height="300rpx" :src="$img+record.appendicesContract" border-radius="10"></u-image> -->
			  <u-image width="100%" height="300rpx" :src="record.cereBasicInformationShop&&record.cereBasicInformationShop.displayMainImage?$img + record.cereBasicInformationShop.displayMainImage:record.cereBasicInformationVenue&&record.cereBasicInformationVenue.displayImage?$img + record.cereBasicInformationVenue.displayImage:record.cereAdvertisingInformation&&record.cereAdvertisingInformation.locationDiagram?$img + record.cereAdvertisingInformation.locationDiagram:''"></u-image>
		</view>
		<view class="msglist">
			
			<view class="form-item">
				<view class="label">租赁状态</view>
				<text>{{record.auditStatus =='1'?'待审核':record.auditStatus =='2'?'待签约':record.auditStatus =='3'?'已驳回':record.auditStatus =='4'?'已签约':'已终止'}}</text>
			</view>
			<view class="form-item" v-if="!record.advertisingSpaceType">
				<view class="label">经营用途</view>
				<text>{{record.businessPurpose}}</text>
			</view>
			<view class="form-item">
				<view class="label">租赁期限</view>
				<text>{{record.contractTerminationDate}}</text>
			</view>
			<view class="form-item">
				<view class="label">租金</view>
				<text>{{record.contractAmount}}</text>
			</view>
			<view class="form-item">
				<view class="label">付款日</view>
				<text>{{record.paymentCycle}}</text>
			</view>	
		</view>
			<view class="msglist" v-if="mapType == '商铺'">
		<u-read-more show-height="300" color="#3f9b6a" close-text="查看更多" text-indent="0em">
	
			<view class="form-item">
				<view class="label">商铺名称</view>
				<text>{{record.warrantyIssue || record.complaintType}}</text>
			</view>
			<view class="form-item">
				<view class="label">商铺类型</view>
				<text>{{record.applicationTime}}</text>
			</view>
			<view class="form-item">
				<view class="label">租赁期限</view>
				<text>{{record.deviceType || record.problemDescription}}</text>
			</view>
			<view class="form-item">
				<view class="label">租金</view>
				<text>{{record.memo || record.remark}}</text>
			</view>
			<view class="form-item">
				<view class="label">付款日</view>
				<text>{{record.memo || record.remark}}</text>
			</view>	
	
			</u-read-more>
				</view>
				<view class="msglist" v-if="mapType == '广告位'">
				<u-read-more show-height="300" color="#3f9b6a" close-text="查看更多" text-indent="0em">
					
					<view class="form-item">
						<view class="label">广告位名称</view>
						<text>{{record.warrantyIssue || record.complaintType}}</text>
					</view>
					<view class="form-item">
						<view class="label">所属端</view>
						<text>{{record.applicationTime}}</text>
					</view>
					<view class="form-item">
						<view class="label">租赁期限</view>
						<text>{{record.deviceType || record.problemDescription}}</text>
					</view>
					<view class="form-item">
						<view class="label">租金</view>
						<text>{{record.memo || record.remark}}</text>
					</view>
					<view class="form-item">
						<view class="label">付款日</view>
						<text>{{record.memo || record.remark}}</text>
					</view>	
					
					</u-read-more>
						</view>
						<view class="msglist" v-if="mapType == '场地'">
						<u-read-more show-height="300" color="#3f9b6a" close-text="查看更多" text-indent="0em">
							
							<view class="form-item">
								<view class="label">场地名称</view>
								<text>{{record.warrantyIssue || record.complaintType}}</text>
							</view>
							<view class="form-item">
								<view class="label">场地类型</view>
								<text>{{record.applicationTime}}</text>
							</view>
							<view class="form-item">
								<view class="label">实际使用面积</view>
								<text>{{record.deviceType || record.problemDescription}}</text>
							</view>
							<view class="form-item">
								<view class="label">租金</view>
								<text>{{record.memo || record.remark}}</text>
							</view>
							<view class="form-item">
								<view class="label">付款日</view>
								<text>{{record.memo || record.remark}}</text>
							</view>	
							
							</u-read-more>
								</view>
				<view v-if="btnShow&&mapType == '商铺'"><u-button @click="xiuMsg(1)" shape="circle" :custom-style="hoverStyle" hover-class="none" :plain="true">添加我的店铺信息</u-button></view>
				<view class="msglist"  v-if="btnShow == false&&mapType == '商铺'">
				<u-read-more show-height="300" color="#3f9b6a" close-text="查看更多" text-indent="0em"  >
					
					<view class="form-item">
						<view class="label">商铺名称</view>
						<text>{{record.warrantyIssue || record.complaintType}}</text>
					</view>
					<view class="form-item">
						<view class="label">商铺类型</view>
						<text>{{record.applicationTime}}</text>
					</view>
					<view class="form-item">
						<view class="label">租赁期限</view>
						<text>{{record.deviceType || record.problemDescription}}</text>
					</view>
					<view class="form-item">
						<view class="label">租金</view>
						<text>{{record.memo || record.remark}}</text>
					</view>
					<view class="form-item">
						<view class="label">付款日</view>
						<text>{{record.memo || record.remark}}</text>
					</view>	
					
					</u-read-more>
						</view>
						<view class="msglist"  v-if="mapType == '广告位'">
						
							
							<view class="form-item">
								<view class="label">投放内容</view>
							</view>
							 <u-parse :html="content"></u-parse>
						

								</view>
						<view class="page-footer">
							<u-button style="background-color: #DFE0E4; flex: 1; margin: 0 10px;" @click="getQuit('/pagesA/myZiyuan/myZiyuanQuit')"
								>申请退租</u-button>
							<u-button type="success" style="flex: 1; margin: 0 10px;" @click="xuShow = true" >申请续租</u-button>
							<u-button type="success" style="flex: 1; margin: 0 10px;" @click="xiuMsg(2)"  v-if="btnShow == false&&mapType == '商铺'">修改资料</u-button>
						</view>
							<u-modal v-model="xuShow" :content="content" @confirm="xufirm" :show-cancel-button="true" ></u-modal>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				record:{},
				btnShow:true,
				hoverStyle:{
					
					color:'#3f9b6a'
				},
				mapType:'商铺',
				content:'<p>露从今夜白，月是故乡明</p>',
				xuShow:false,
				content:'您确定是否需要续租'
			}
		},
		 onLoad(options) {
		    const item = JSON.parse(decodeURIComponent(options.item));
		    console.log('Received item:', item);
			this.record = item
		  },
		methods: {
			getQuit(urls){
				console.log(urls)
				uni.navigateTo({
					url: urls
				})
			},
			xufirm(){
				
			},
			xiuMsg(val){
				if(val == 1){
					uni.navigateTo({
						url: '/pagesA/myZiyuan/addMyshop'
					})
				}else{
					uni.navigateTo({
						url: '/pagesA/myZiyuan/addMyshop'
					})
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.page{
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		padding: 0 24rpx;
	}
	.zhutu{
		margin: 15px 0;
		background-color: #fff;
	}

	/* 记录列表 */
	.record-list{
		margin-top: 20rpx;
		.good-item {
			width: 100%;
			display: flex;
			background-color: #fff;
			padding: 16rpx;
			border-radius: 14rpx;
			margin-bottom: 26rpx;
			.img {
				width: 200rpx;
				height: 200rpx;
			}
			.info {
				width: calc(100% - 220rpx);
				margin-left: 20rpx;
				.title {
					width: 100%;
					font-size: 28rpx;
					line-height: 44rpx;
					font-weight: 700;
					white-space: nowrap;
					overflow : hidden;
					text-overflow: ellipsis;
					margin-bottom: 20rpx;
				}
				.info-item {
					display: flex;
					line-height: 30rpx;
					font-size: 26rpx;
					color: #717981;
					text {
						white-space: nowrap;
						overflow : hidden;
						text-overflow: ellipsis;
						margin-left: 10rpx;
						span {
							font-size: 30rpx;
							color: #000;
							font-weight: 700;
						}
					}
					.u-tag {
						margin: 0 6rpx;
						border: unset;
					}
				}
			}
		}
	}
	.msglist{
		padding: 0 30rpx;
		background-color: #Fff;
		border-radius: 14rpx;
		margin-bottom: 20rpx;
		.form-item {
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			line-height: 70rpx;
			border-bottom: #eee solid 1rpx;
			padding: 10rpx 0;
			&[label-top] {
				flex-direction: column;
				justify-content: flex-start;
				align-items: flex-start;
			}
			text {
				font-size: 24rpx;
				color: #3D3D3D;
			}
			.img {
				padding-bottom: 18rpx;
			}
			.deom-box {
				width: 100%;
				display: flex !important;
				margin: 0 -20rpx;
				background-color: #FFFFFF;
				border-radius: 9px;
				// margin-top: 9px;
				width: 100%;
				// .u-upload {
				// .u-add-wrap {
				// 	width: 304rpx !important;
				// 	height: 182rpx !important;
				// }
				// }
				// .u-upload {
				// 	height: 88px;
				// 	width: 155px;
				// 	background: url(/static/images/uploadID1.png);
				// 	background-size:134rpx 188rpx;
				// 	background-repeat:no-repeat;
				// }
				.img-deom {
					flex: 1;
					display: flex;
					flex-direction: column;
					align-items: center;
					padding: 20rpx;
					text {
						margin-top: 18rpx;
					}
				}
			}
		}
		:last-child {
			border-bottom: unset;
		}
	}
	.footbtn{
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 10;
		height:180rpx;
		width: 100%;
		border-radius: 26rpx 26rpx 0 0;
		background-color: #fff;
		.info-total {
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			margin: 24rpx 50rpx;
			font-weight: 700;
			font-size: 24rpx;
			span {
				color: #0FBB59;
				font-size: 32rpx
			}
		}
		.footer-btn {
			display: flex;
			.u-btn {
				width: 40%;
			}
		}
	}
	.page-footer{
		position: fixed;
		left: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		width: 100%;
		height: 125rpx;
		background-color: #FFFFFF;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
		.footer-buy{
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 100%;
			height: 100%;
			.cart-add{
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 100rpx;
				background-color: #3f9b6a;
				text{
					font-size: 28rpx;
					color: #FFFFFF;
				}
			}
		}
	}
</style> 
