<template>
	<view class="container">
		<view class="form-box">
			<view class="item">
				<view class="label">房源地址</view>
				<view class="input">
					<u-input height="102" disabled input-align="right" v-model="form.address"  @click="topage"  placeholder="请选择房源地址"></u-input>
					<image class="path" src="/static/path.png" mode="" />
				</view>
			</view>
			<view class="item">
				<view class="label">带看时间</view>
				<view class="input">
					<u-input height="102" disabled input-align="right" v-model="form.date"  @click="calendarShow = true"  placeholder="请选择带看时间"></u-input>
					<image class="calendar" src="/static/kehu/calendar.png" mode="" />
					<u-picker mode="time" confirm-color="#FF6D25" :default-time="form.date" v-model="calendarShow" :params="params" @confirm="dateConfirm"></u-picker>
				</view>
			</view>
		</view>
		<view class="submit-btn">提交</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				calendarShow: false,
				form: {
					date: '',//带看时间
					address:'',//房源地址
				},
				sourceList: [
					{
						value: '1',
						label: '来电'
					},
					{
						value: '2',
						label: '来访'
					},
					{
						value: '3',
						label: '到访'
					},
					{
						value: '4',
						label: '2来访'
					},
				],
				params: {
					year: true,
					month: true,
					day: true,
					hour: true,
					minute: true,
					second: true
				},
				customStyle:{
					maxHeight:'200rpx',
					padding: '20rpx',
					fontSize: '30rpx',
					borderBottom:'1px solid #e0e0e0'
				}
			};
		},
		onLoad(options) {
			
		},
		onShow() {
			let houseSource = wx.getStorageSync('houseSource')
			if(houseSource&&houseSource.address){
				this.form.address = houseSource.address
			}
		},
		methods: {
			topage(){
				wx.navigateTo({
					url: '/pages/customer/selectHousesource'
				})
			},
			dateConfirm(e){
				console.log(e)
				this.form.date = e.year + '-'+e.month + '-'+e.day+ ' '+e.hour+':'+e.minute+':'+e.second
			},
			submit() {
				
			},
			sexChange(){
				console.log(this.form.sex)
			},
			needChange(){},
			getPhonelist(){
				let that = this
				// 拉起通讯录
				wx.chooseContact(
					{
						success:function(obj){
								that.form.name = obj.displayName
								that.form.tel = obj.phoneNumber
						}
					}
				)
			},
		},

	};
</script>

<style lang="scss" scoped>
.container {
	width: 750rpx;
	min-height: 100vh;
	background: #F8F8F8;
	padding-top: 20rpx;
	.form-box{
		background: #fff;
		padding: 0 30rpx;
		.item{
			height: 102rpx;
			font-size: 30rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			line-height: 102rpx;
			color: #333333;
			border-bottom: 1px solid #e0e0e0;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.label{
				width: 120rpx;
				margin-right: 20rpx;
			}
			.input{
				display: flex;
				align-items: center;
				.path{
					width: 14rpx;
					height: 30rpx;
					margin-left: 20rpx;
				}
				.calendar{
					width: 40rpx;
					height: 40rpx;
					margin-left: 20rpx;
				}
			}
		}
	}
	.submit-btn{
		width: 690rpx;
		height: 88rpx;
		line-height: 88rpx;
		text-align: center;
		background: #FFB692;
		border-radius: 12rpx;
		margin-left: 30rpx;
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		position: fixed;
		bottom: 90rpx;
	}
}
</style>
