<template>

	<RefreshView ref="mescrollRef" :hasBack="true" text="联系方式" :useDownScroll="false" :useUpScroll="false"
		useTitleRightBtn="1" titleRightBtnSource="确定" @rightBtn='rightBtnClick'>

		<view style="display: flex;flex-direction: column;">

			<text style=" margin-top: 50rpx; margin-left: 65rpx;">联系人</text>

			<view class="input" style="margin-top: 20rpx;">
				<input class="input_text" v-model="activityBaseInfo.linkerName" @input="nameText" placeholder="请输入联系人" />
			</view>

			<text style=" margin-top: 50rpx; margin-left: 65rpx; margin-top: 30rpx;">联系电话</text>

			<view class="input" style="margin-top: 20rpx;">

				<input class="input_text" type="number" v-model="activityBaseInfo.linkerPhone" maxlength="11"
					@input="phoneText" placeholder="请输入联系电话" />

			</view>
		</view>

	</RefreshView>
</template>

<script>
	export default {
		data() {
			return {
				activityBaseInfo: {
					linkerName: "",
					linkerPhone: "",
				}
			};
		},
		onLoad: function(option) {
			this.activityBaseInfo.linkerName =option.linkerName;
			this.activityBaseInfo.linkerPhone = option.linkerPhone;
			console.log(JSON.stringify(this.activityBaseInfo))
		},
		mounted() {

		},
		methods: {
			nameText(e) {
				this.activityBaseInfo.linkerName = e.detail.value;
			},
			phoneText(e) {
				this.activityBaseInfo.linkerPhone = e.detail.value
			},
			rightBtnClick() {

				if (this.IsEmpty(this.activityBaseInfo.linkerName)) {
					this.Toast("请输入联系人姓名")
					return
				}
				let o = parseInt(this.activityBaseInfo.linkerPhone)
				if (isNaN(o) || !this.activityBaseInfo.linkerPhone.startsWith(1) || this.activityBaseInfo.linkerPhone.length !=
					11) {
					this.Toast("输入的电话格式有误")
				} else {
					this.SetResult(this.activityBaseInfo)
					console.log(this.activityBaseInfo)
				}

			},
		}
	}
</script>

<style lang="scss">
	.input {
		margin-left: 65rpx;
		margin-right: 65rpx;
		height: 80rpx;
		background: #F2F2F2;
		border-radius: 42rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		display: flex;
		align-items: center;


		.input_text {
			width: 100%;
		}
	}
</style>
