<template>
	<view class="oppo-box">
		<image style="width: 100%; height: 247rpx;" src="@/static/bg (2).png"></image>
		<view class="custom-navigation-bar">
			<view class="left-button" @click="handleBack">
				<uni-icons type="left" color="#fff" size="30"></uni-icons>
			</view>
			<view class="title">
				{{ title }}
			</view>
		</view>
		<view class="formbox">
			<uni-section title="俱乐部LOGO（400px*400px）" type="line" class="linered">
				<view class="border"></view>
				<uni-file-picker v-model="formData.name" fileMediatype="image" mode="grid" @success="success"
					@fail="fail" />
			</uni-section>
		</view>
		<view class="formbox1">
			<uni-forms ref="form" :modelValue="formData" :rules="rules" label-width="200rpx">
				<uni-forms-item label="俱乐部名称" required name="name">
					<input class="input" v-model="formData.name" type="text" placeholder="请输入" />
				</uni-forms-item>
				<uni-forms-item label="联系人" required name="email">
					<input class="input" v-model="formData.email" type="text" placeholder="请输入邮箱"
						@input="binddata('email',$event.detail.value)" />
				</uni-forms-item>
				<uni-forms-item label="联系电话" required name="email">
					<input class="input" v-model="formData.email" type="text" placeholder="请输入邮箱"
						@input="binddata('email',$event.detail.value)" />
				</uni-forms-item>
			</uni-forms>
		</view>
		<view class="formbox2">
			<uni-row>
				<uni-col :span="12">
					<text style="color: red;">*</text> 俱乐部管理员
				</uni-col>
				<uni-col :span="4" :offset="8">
					<text style="color: red;">添加</text>
				</uni-col>
			</uni-row>
			<view class="border" style="margin-top: 20rpx;"></view>
			<uni-forms ref="form" :modelValue="formData" :rules="rules" label-width="250rpx">
				<uni-forms-item label="俱乐部所在城市" required name="name">
					<uni-data-select v-model="value" :localdata="range"></uni-data-select>
				</uni-forms-item>
				<uni-forms-item label="俱乐部地址" required name="email">
					<input class="input" v-model="formData.email" type="text" placeholder="请输入邮箱"
						@input="binddata('email',$event.detail.value)" />
				</uni-forms-item>
				<uni-forms-item label="地址定位" required name="name">
					<uni-data-select v-model="value" :localdata="range"></uni-data-select>
				</uni-forms-item>
			</uni-forms>
		</view>
		<view class="formbox3">
			<uni-forms ref="form" :modelValue="formData" :rules="rules" label-width="250rpx">
				<uni-forms-item label="俱乐部地址" required name="email">
					<input class="input" v-model="formData.email" type="text" placeholder="请输入邮箱"
						@input="binddata('email',$event.detail.value)" />
				</uni-forms-item>
				</uni-forms\>
		</view>
		<view class="formbox" style="margin-top: 20rpx;">
			<uni-section title="营业执照（盖章后上传）" type="line" class="linered">
				<view class="border"></view>
				<uni-file-picker v-model="formData.name" fileMediatype="image" mode="grid" @success="success"
					@fail="fail" />
			</uni-section>
		</view>
		<view class="formbox" style="margin-top: 20rpx;">
			<uni-section title="俱乐部授权书（下载盖章后拍照上传）" type="line" class="linered"> <text class="dow">下载附件</text>
				<view class="border"></view>
				<uni-file-picker v-model="formData.name" fileMediatype="image" mode="grid" @success="success"
					@fail="fail" />
			</uni-section>
		</view>
		<view class="formbox">
			<uni-section title="俱乐部门店图片（400px*400px）" type="line" class="linered">
				<view class="border"></view>
				<uni-file-picker v-model="formData.name" fileMediatype="image" mode="grid" @success="success"
					@fail="fail" />
			</uni-section>
		</view>
		<view class="formbox">
			<uni-section title="俱乐部简介" type="line" class="linered">
				<view class="border"></view>
				<textarea name="" id="" cols="30" rows="10" placeholder="请输入"></textarea>
			</uni-section>
		</view>
		<view class="">
			<button class="subbtn">确认提交</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				range: [{
						value: 0,
						text: "篮球"
					},
					{
						value: 1,
						text: "足球"
					},
					{
						value: 2,
						text: "游泳"
					},
				],
				title: '创建俱乐部',
				// 表单数据
				formData: {
					name: [],
					email: 'dcloud@email.com'
				},
				rules: {
					// 对name字段进行必填验证
					name: {
						rules: [{
							required: true,
							errorMessage: '请输入姓名',
						}]
					},
					// 对email字段进行必填验证
					email: {
						rules: [{
							format: 'email',
							errorMessage: '请输入正确的邮箱地址',
						}]
					}
				}
			}
		},
		methods: {
			detail() {
				uni.navigateTo({
					url: "/pages/user/notice/detail/detail"
				})
			},
			handleBack() {
				uni.navigateBack({
					delta: 2
				})
				// console.log(1344444);
				// uni.switchTab({
				// 	url: "/pages/user/index"
				// })
			},
			toPage() {
				console.log(1111232)
				uni.navigateTo({
					url: "/pages/user/index"
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.oppo-box {
		width: 100vw !important;
		height: 100vh !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
	}
	.subbtn{
		margin-top: 20rpx;
		width: 662rpx;
		height: 90rpx;
		background: #CA151F;
		border-radius: 45rpx;
	}
	.dow{
		color: red;
		position: relative;
		left: 80%;
		top: -60rpx;
	}
	.formbox3 {
		width: 750rpx;
		height: 107rpx;
		background: #FFFFFF;
		margin-top: 20rpx;
		padding: 20rpx;
	}

	.formbox2 {
		width: 730rpx;
		height: 326rpx;
		background: #FFFFFF;
		margin-top: 20rpx;
		padding: 20rpx;
	}

	.formbox1 {
		width: 730rpx;
		height: 326rpx;
		background: #FFFFFF;
		margin-top: 20rpx;
		padding: 20rpx;
	}

	.border {
		border: 1px solid #E6E6E6;
		;
	}

	.margintop {
		margin-top: -100px;
	}

	.formbox {
		padding: 20rpx;
		// margin: 20rpx;
		background: #fff;
	}

	.custom-navigation-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 220rpx;
		/* #ifdef MP-WEIXIN */
		margin-top: -230rpx;
		/* #endif */
	}

	.left-button,
	.right-button {
		padding: 0 12px;
	}

	.title {
		flex: 1;
		// text-align: center;
		color: #fff;
		font-size: 18px;
		font-weight: bold;
	}
</style>