<template>
	<view class="page" :style="{'min-height':h+'px'}">

		<view class="tenant-title">
			<text>基本信息</text>
		</view>
		<view class="from-content">
			<view class="one-realName">
				<view class="realName">
					商户名称
				</view>
				<!-- <u--input v-model="realName" border="none" pl ></u--input> -->
				<view class="right">
					<input type="text" v-model="list.name" border="none" placeholder="请输入昵称" />
				</view>
			</view>

			<view class="one" @click="nav">
				<view class="">
					商户类型
				</view>
				<view class="">
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="one-mobile">
				<view class="mobile">
					企业名称
				</view>
				<view class="right">
					<input type="text" v-model="list.busName" border="none" placeholder="请输入" style="height: 48rpx;" />
				</view>
			</view>

			<view class="one" @click="nav">
				<view class="">
					企业类型
				</view>
				<view class="">
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>

			<view class="one-mobile">
				<view class="mobile">
					企业法人
				</view>
				<view class="right">
					{{list.legalPerson}}
				</view>
			</view>

			<view class="one-mobile">
				<view class="mobile">
					法人身份证号码
				</view>
				<view class="right">
					{{list.idCard}}
				</view>
			</view>

			<view class="one-mobile">
				<view class="mobile" style="width: 350rpx;">
					统一社区信用代码
				</view>
				<view class="right">
					{{list.creditCode}}
				</view>
			</view>

			<view class="one-mobile">
				<view class="mobile">
					企业地址
				</view>
				<view class="right">
					{{list.areaDetail}}
				</view>
			</view>

		</view>

		<view class="tenant-title">
			<text>联系人信息</text>
		</view>
		<view class="from-content">
			<view class="one-mobile">
				<view class="mobile">
					联系人姓名
				</view>
				<view class="right">
					{{list.linkName}}
				</view>
			</view>

			<view class="one-mobile">
				<view class="mobile">
					联系人号码
				</view>
				<view class="right">
					{{list.phone}}
				</view>
			</view>
		</view>

		<view class="tenant-title">
			<text>商家相册</text>
		</view>
		<view class="from-content" style="padding: 30rpx;">
			<view class="tenant-image">
				<view>
					<image :src="list.idCardFront" mode=""></image>
					<view>法人身份证国徽面</view>
				</view>
				<view>
					<image :src="list.idCardReverse" mode=""></image>
					<view>法人身份证人像面</view>
				</view>
				<view>
					<image :src="list.licensePic" mode=""></image>
					<view>营业执照</view>
				</view>
				<view>
					<image :src="list.usccl" mode=""></image>
					<view>统一社会信息代码证</view>
				</view>
				<view>
					<image :src="list.shopSign" mode=""></image>
					<view>门头照</view>
				</view>
				<view>
					<image :src="list.shopImgs" mode=""></image>
					<view>店铺照片</view>
				</view>

			</view>
		</view>

		<view class="from-content">
			<button class="tenant-button">
				立即保存
			</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				h: uni.getSystemInfoSync().windowHeight - 87,
				mt: uni.getSystemInfoSync().statusBarHeight + 44,
				titleHeader: '个人信息',
				fileList: [],
				dto: {
					realName: '黄沙村渔家乐', //昵称
					modifyPhone: '18755113256', //手机号
					headUrl: '', // 头像
					idCode: '', // 证件号
					id: ''
				},
				fishermanId: uni.getStorageSync('merchantId'),
				list: {}
			}
		},
		onLoad() {
			this.getList()
		},

		methods: {
			// 上传头像
			upImage() {
				uni.chooseImage({
					sourceType: ['album'], //从相册选择
					success: chooseImageRes => {
						const tempFilePaths = chooseImageRes.tempFilePaths;
						uni.uploadFile({
							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例，非真实的接口地址
							filePath: tempFilePaths[0],
							name: 'file',
							header: {
								token: wx.getStorageSync('access_token')
							},
							success: res => {
								// uploadFile上传成功后，根据和后台的约定msgCode判断接口调用状态
								let data = JSON.parse(res.data);
								this.dto.headUrl = data.data.url
							}
						});
					},
					fail: err => {
						this.myToast('图片上传失败', 'none');
					}
				});

			},

			getList() {
				// this.$api.get('/merchant/merchantFisherman/home?id=' + this.homestayId).then(res => {
				// 	console.log(res.data);
				// })
				let id = this.fishermanId
				this.$api.get(`/merchant/merchantFisherman/home/${id}`).then(res => {
					console.log(res.data);
					this.list = res.data.data
				})
			}

		}


	}
</script>

<style lang="scss" scoped>
	.page {
		box-sizing: border-box;
		// padding: 30rpx;
		// padding-top: 150rpx;

	}

	//标题样式
	.tenant-title {
		height: 88rpx;
		background: #F5F8FA;
		padding-left: 30rpx;

		text {
			line-height: 88rpx;
			font-size: 28rpx;
			color: #007A69;
		}
	}

	//商家相册样式
	.tenant-image {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-around;

		>view {
			width: 47%;
			text-align: center;

			image {
				width: 100%;
				height: 212rpx;
				background: #F6F8F9;
			}

			view {
				margin: 15rpx 0 45rpx 0;
			}
		}
	}

	//保存样式
	.tenant-button {
		background: #007A69;
		border-radius: 40rpx;
		font-weight: bold;
		font-size: 28rpx;
		color: #FFFFFF;
	}

	.from-content {
		padding: 30rpx;


		.title {
			margin: 40rpx 0 36rpx;
			font-size: 30rpx;
			font-weight: Regular;
			color: #111111;
		}


		.one-image {
			width: 100%;
			display: flex;
			justify-content: space-between;

			.image {
				width: 124rpx;
				height: 124rpx;
				border-radius: 100rpx;

				image {
					width: 100%;
					height: 100%;
					border-radius: 100rpx;
				}

			}


			.user {
				margin-top: 24rpx;
				font-size: 30rpx;
				color: #111;
				font-weight: Regular;
			}

		}

		.one-realName {
			width: 100%;
			display: flex;
			align-items: center;
			height: 120rpx;
			line-height: 120rpx;
			border-bottom: 1rpx solid #EFEFEF;

			.realName {
				width: 188rpx;
				height: 120rpx;
				font-size: 30rpx;
				color: #333333;
				font-weight: Regular;
			}

			.right {
				text-align: right;
				width: 100%;
				font-size: 30rpx;
				color: #666666;
				font-weight: Regular;
				// display: flex;
				// justify-content: space-between;
			}
		}

		.one-mobile {
			display: flex;
			width: 100%;
			align-items: center;
			height: 120rpx;
			line-height: 120rpx;
			border-bottom: 1rpx solid #EFEFEF;

			.right {
				width: 100%;
				text-align: right;
				font-size: 30rpx;
				color: #666666;
				font-weight: Regular;
			}

			.mobile {
				width: 380rpx !important;
				height: 120rpx;
				font-size: 30rpx;
				color: #333333;
				font-weight: Regular;
			}

			.replacement {
				border-radius: 50rpx;
				width: 80rpx;
				height: 48rpx;
				line-height: 48rpx;
				border: 1rpx solid #025EA7;
				color: #025EA7;
				font-weight: Regular;
				font-size: 24rpx;
				text-align: center;
			}
		}

		.one {
			height: 120rpx;
			line-height: 120rpx;
			display: flex;
			border-bottom: 1rpx solid #EFEFEF;
			justify-content: space-between;
			align-items: center;
			font-size: 30rpx;
			color: #333333;
			font-weight: Regular;
		}
	}

	.btn {
		margin: 120rpx auto;
		width: 650rpx;
		height: 88rpx;
		display: flex;
		background-color: #01B9F9;
		line-height: 88rpx;
		border-radius: 50rpx;

		.btn-btn {
			margin: 0 auto;
			font-size: 32rpx;
			color: #FFFFFF;
			font-weight: Regular;
		}
	}
</style>