acompetition_detial.js 1.0 KB
define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer'], function($, undefined, Frontend,
	Form, Template, Swiper, Layer) {
	var Controller = {
		index: function() {
			require(['upload'], function(Upload) {
				var first_swiper = new Swiper('#first_swiper', {
					loop: true, // 循环模式选项
					// 如果需要分页器
					autoplay:true,
					pagination: {
						el: '.swiper-pagination',
					}
				})
				$(".change").click(function(){
					$(this).text("保存信息")
					$("input").removeAttr("disabled")
					Upload.api.upload($('#btn-upload'));
					
					$("select").removeAttr("disabled")
					$(".add").click(function(){
						var len=$(".list").length+1
						$(".joiner").append(getPeopleItem(len))
					})
				})
				
				function getPeopleItem(index) {
					return `<div class="list">
						<text>人员`+index+`:</text>
						<div>
							<text>姓名</text>
							<input type="text" />
							<text>学号</text>
							<input type="text" />
						</div>
					</div>`
				}
			})
		},
	}
	return Controller;
});