<style >
	.listsignUp{
		width: 100%;
		height: 100vh;
		overflow-y: auto;
		background:#F6F6F6 ;
		padding: 18px;
	}
	.listsignUp .single_Phone {
		font-size: 28rpx;
		color: #1F1F1F;
		font-weight: bold;
		margin-bottom:10rpx;
	}
	.listsignUp .single_Input{
		border-bottom:1px solid #DADCE6;
		padding:10rpx 0 20rpx 0;
	}
	.listsignUp .single_Remark{
		margin:10rpx 0 40rpx 0;
		font-size:25rpx;
		color:#808080;
	}
	.listsignUp .btn{
		width: 100%;
		height: 44px;
		border-radius: 10px;
		background: #F70027;
		font-size: 16px;
		color: #FFF;
		text-align: center;
		line-height: 44px;
		margin: 20px 0;
	}
</style>
<template>
	<view class="listsignUp">
		<view style="width: 100%;padding: 15px;border-radius: 15px;background: #FFF;">
			
				<template v-for="(item,index) in dataList">
					<singleText v-if="item.CompKey=='SingleLineText'" :CompData="item.CompData"  :index='index' @success="datasuccess()"></singleText>
					<multipleText v-if="item.CompKey=='MultiLineText'" :CompData="item.CompData" :index='index' @success="datasuccess()"></multipleText>
					<selectChoice v-if="item.CompKey=='DorpDownList'" :CompData="item.CompData" :index='index' @success="datasuccess()"></selectChoice>
					<pictureUpload v-if="item.CompKey=='ImageUploadComp'" :CompData="item.CompData" :index='index' @success="datasuccess()"></pictureUpload>
					<videoUpload v-if="item.CompKey=='VideoUploadComp'" :CompData="item.CompData" :index='index' @success="datasuccess()"></videoUpload>
				</template>
				<view class="btn" @click="setapply()">
					提交申请
				</view>
			
			
		</view>
	</view>
	
</template>

<script>
	import singleText from "./plugin/singleText";
	import multipleText from "./plugin/multipleText"
	import selectChoice from "./plugin/selectChoice"
	import pictureUpload from "./plugin/pictureUpload"
	import videoUpload from "./plugin/videoUpload"
	
	export default {
		components: {
			singleText,
			multipleText,
			selectChoice,
			pictureUpload,
			videoUpload
		},
		data() {
			return {
				pageTitle: '榜单报名',
				msg: {
					Id: 5,
				},
				dataList: [],
				pageCount: 1,
				formData:null
			}
		},
		created() {
			uni.setNavigationBarTitle({
			  title: "榜单报名",
			});
		},
		mounted() {
			
		},
		onLoad(option) {
			if(option && option.formData){//解码
				this.formData = JSON.parse(decodeURIComponent(option.formData))
				console.log(this.formData)
				this.getCustomForm()
			}
		},
		methods: {
			getCustomForm(){
				let parms = {
					url: "/api/AppletCustomForm/GetCustomForm",
					data:{FormType:this.formData.ListType}
				}
				this.request2(parms, (res) => {
					if (res.resultCode == 1) {
						this.dataList=res.data.FormData;
					}
				})
			},
			datasuccess(data,index){
				console.log(data,index)
				this.dataList[index].CompData = data
				
			},
			setapply(){
				console.log('提交',this.dataList)
			}
		
		}
	}
</script>
