<template>
	<view class="container">
		<view class="form-box">
			<view class="item">
				<view class="label">客户姓名</view>
				<view class="input">
					<u-input :clearable="false" input-align="right" v-model="form.name" placeholder="请输入客户姓名"></u-input>
					<view class="contact-btn" @click="getPhonelist">从通讯录选择</view>
				</view>
			</view>
			<view class="item">
				<view class="label">手机号码</view>
				<view class="input">
					<u-input :clearable="false" maxlength="11" type="number" input-align="right" v-model="form.tel" placeholder="请输入客户手机号码"></u-input>
				</view>
			</view>
			<view class="item">
				<view class="label">客户性别</view>
				<view class="input">
					<u-radio-group v-model="form.sex" @change="sexChange">
						<u-radio active-color="#FF6D25" :name="0">男</u-radio>
						<u-radio active-color="#FF6D25" :name="1">女</u-radio>
					</u-radio-group>
				</view>
			</view>
			<view class="item">
				<view class="label">渠道来源</view>
				<view class="input">
					<u-input height="102" disabled input-align="right" v-model="form.sourceName"  @click="sourceShow = true"  placeholder="请选择渠道来源"></u-input>
					<image class="path" src="/static/path.png" mode="" />
					<u-select confirm-color="#FF6D25" v-model="sourceShow" :list="sourceList" @confirm="confirmSource"></u-select>
				</view>
			</view>
			<view class="item">
				<view class="label">意向租金</view>
				<view class="input">
					<u-input :clearable="false" type="number" input-align="right" v-model="form.rentMoney" placeholder="请输入意向租金"></u-input>
					<view class="yuan">元</view>
				</view>
			</view>
			<view class="item">
				<view class="label">需求类型</view>
				<view class="input">
						<u-radio-group v-model="form.needType" @change="needChange">
						<u-radio active-color="#FF6D25" :name="0">整租</u-radio>
						<u-radio active-color="#FF6D25" :name="1">合租</u-radio>
					</u-radio-group>
				</view>
			</view>
			<view class="last-item">
				<view class="label">备注内容</view>
					<u-input style="flex:1" :custom-style="customStyle" v-model="mark" :height="60" :auto-height="true" type="textarea" :clearable="false"  placeholder="请输入备注内容"></u-input>
			</view>
		</view>
		<view class="submit-btn">提交</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				sourceShow: false,
				form: {
					name: '',//客户姓名
					sex: 0,//性别
					tel: '',//手机号
					source:'',//渠道来源
					sourceName: '',
					rentMoney: '',// 租金
					needType: 0,//需求类型 
					mark: 's d c d s'//备注
				},
				sourceList: [
					{
						value: '1',
						label: '来电'
					},
					{
						value: '2',
						label: '来访'
					},
					{
						value: '3',
						label: '到访'
					},
					{
						value: '4',
						label: '2来访'
					},
				],
				customStyle:{
					maxHeight:'200rpx',
					padding: '20rpx',
					fontSize: '30rpx',
					borderBottom:'1px solid #e0e0e0'
				}
			};
		},
		onLoad(options) {
		},
		onShow() {
		
		},
		methods: {
			confirmSource(e){
				console.log(e)
				this.form.source = e[0].value
				this.form.sourceName = e[0].label
			},
			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;
				}
				.contact-btn{
					margin-left: 20rpx;
				}
				.yuan{
					margin-left: 20rpx;
				}

			}
		}
		.last-item{
			display: flex;
			.label{
				line-height: 102rpx;
				font-size: 30rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-right: 150rpx;
			}

		}
	}
	.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>
