www_fpvone_cn/application/index/view/players/edit.html

872 lines
38 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/css/public.css">
<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/layuis/layui-main/src/css/layui.css">
<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/font/door//iconfont.css">
<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/css/fly.css">
<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/css/identity.css">
<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/css/operate.css">
<!--<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/css/layui.css">-->
<style>
.clubtips{
top: 10px;
}
@media screen and (max-width: 768px){
.clubtips{
top: 36px;
right: -26px;
}
.clubtips .tipText{
left: -312px;
top: -8px;
}
}
</style>
<div class="main">
<div class="title">
<p>
<?php if(!empty($playerinfo['id'])){ ?>
<i class="iconfont icon-fanhui" onclick="javascript:location.href='{:url('players/index')}'"></i>
<?php }else{ ?>
<i class="iconfont icon-fanhui" onclick="javascript:location.href='{:url('user/index')}'"></i>
<?php } ?>
<span>飞手</span>
<span class="etitle">Pilot</span>
</p>
</div>
<form class="layui-form" enctype="multipart/form-data" id="playerApply" lay-filter="playerApply">
<input type="hidden" name="id" value="{$playerinfo.id}">
<div class="basic">
<p class="fly-name">
<span>个人基本信息</span>
<span class="etitle">Basic Information</span>
</p>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>中文名</p>
<p>Chinese Name</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="real_name" lay-verify="required|chinese" autocomplete="off" class="layui-input" value="{$playerinfo.real_name}">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<div>
<p>英文名</p>
<p>English Name</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="eng_name" autocomplete="off" class="layui-input" value="{$playerinfo.eng_name}">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>性别</p>
<p>Gender</p>
</div>
</div>
<div class="layui-input-block gender">
<div>
<input type="radio" name="gender" {if $playerinfo.gender == ""} checked {/if} lay-verify="required" value="男" title="男" >
<span>Male</span>
</div>
<div>
<input type="radio" name="gender" {if $playerinfo.gender == ""} checked {/if} lay-verify="required" value="女" title="女" >
<span>Female</span>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>出生日期</p>
<p>Date Of Birth</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="birthday" id="birthday" lay-verify="date" autocomplete="off" class="layui-input" value="{$playerinfo.birthday}">
</div>
</div>
<div class="layui-form-item" style="display: none;">
<div class="inputname">
<div>
<p>年龄</p>
<p>Age</p>
</div>
</div>
<div class="layui-input-block">
<span id="showAge"></span>
<input type="hidden" name="age" id="age" value="{$playerinfo.age}">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>国籍</p>
<p>Nationality</p>
</div>
</div>
<div class="layui-input-block">
<select name="country" id="nationality" lay-verify="required" lay-search="" lay-filter="nationality">
<option value="">可搜索选择 Searchable selection</option>
</select>
</div>
</div>
<div class="layui-form-item" id="pro_city_dis">
<div class="inputname">
<span class="red">*</span>
<div>
<p>居住地</p>
<p>To Live</p>
</div>
</div>
<div class="layui-input-block town">
<div class="layui-input-inline">
<select name="province" id="province" lay-filter="province" >
<option value="">请选择省</option>
</select>
</div>
<div class="layui-input-inline">
<select name="city" id="city" lay-filter="city" >
<option value="">请选择市</option>
</select>
</div>
<div class="layui-input-inline">
<select name="district" id="district" lay-filter="district" >
<option value="">请选择县/区</option>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>地址</p>
<p>Address</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="address" autocomplete="off" class="layui-input address" value="{$playerinfo.address}" >
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>照片</p>
<p>Photo</p>
</div>
</div>
<div class="layui-input-block">
<div class="layui-upload-drag up" input-id="player_pic">
{if $playerinfo.player_pic}
<img width="118" height="152" src="{$playerinfo.player_pic}">
{else/}
<i class="layui-icon"></i>
<p>上传照片</p>
{/if}
</div>
<input type="hidden" name="player_pic" id="player_pic" value="{$playerinfo.player_pic}">
<p class="tip">请上传白底电子一寸照 像素295*413px</p>
<div class="tip">
<p>1.请上传电子一寸照,白色背景,图像清晰。</p>
<p>Please upload bareheaded photo with white color background.</p>
</div>
<div class="tip">
<p>2.请勿出现大幅度表情</p>
<p>Do not show exaggerated expressions.</p>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<div>
<p>辅导员姓名</p>
<p>Counselor Name</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="counselor_name" placeholder="中文名 or English name" autocomplete="off" class="layui-input" value="{$playerinfo.counselor_name}">
<div class="tip">
<p>一名飞手只允许填写一名教练员或助手。</p>
<p>A flyer is only allowed to fill in one trainer or assistant.</p>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>ASFC 会员</p>
<p>ASFC User</p>
</div>
</div>
<div class="layui-input-block gender">
<div>
<input type="radio" name="asfc_user" value="1" {if $playerinfo.asfc_user == "1"} checked {/if} title="是" lay-filter="asfc_user">
<span>Yes</span>
</div>
<div>
<input type="radio" name="asfc_user" value="0" title="否" {if $playerinfo.asfc_user == "0"} checked {/if} lay-filter="asfc_user">
<span>Deny</span>
</div>
</div>
</div>
<div class="layui-form-item membership_id_number" {if $playerinfo.asfc_user == "0"} style="display: none" {/if} >
<div class="inputname">
<span class="red">*</span>
<div>
<p>会员证号</p>
<p>Membership ID</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="membership_id" value="{$playerinfo.membership_id}" autocomplete="off" class="layui-input address">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<div>
<p>ASFC飞行证号</p>
<p>ASFC Number</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="flight_number" value="{$playerinfo.flight_number}" autocomplete="off" class="layui-input address">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<div>
<p>FAI许可证编号</p>
<p>FAI license number</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="fai_number" value="{$playerinfo.fai_number}" autocomplete="off" class="layui-input address">
</div>
<div class="clubtips">
<img src="/assets/addons/cms/img/tips.png" alt="">
<div class="tipText">
<img src="/assets/img/close.png" style="position:absolute;right:-12px;width:24px;top:-12px;" class="tipclose">
<div class="text">
<p>* 请检查FAI有效期。* 您必须获得FAI许可证。如果您没有FAI许可证可咨询工作人员咨询邮箱<a href="mailto:service@fpvone.cn">service@fpvone.cn</a>。FAI许可证可以通过您所在国家的FAI NAC获得。如果您所在国家/地区的FAI NAC未处于活动状态则可以直接从以下站点获取。=><a href="http://www.droneracing.aero/" target="_blank">http://www.droneracing.aero/</a></p>
<p>
* Please check the FAI expiration date. * You must obtain an FAI license. If you do not have an FAI permit, you may consult the staff at <a href="mailto:service@fpvone.cn">service@fpvone.cn</a>. FAI licenses can be obtained through the FAI NAC in your country. If the FAI NAC for your country is not active, it can be obtained directly from the following sites. =><a href="http://www.droneracing.aero/" target="_blank">http://www.droneracing.aero/</a>
</p>
</div>
</div>
</div>
</div>
<!--<div class="layui-form-item">-->
<!-- <div class="inputname">-->
<!-- <span class="red">*</span>-->
<!-- <div>-->
<!-- <p>俱乐部成员</p>-->
<!-- <p>Club Members</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="layui-input-block gender">-->
<!-- <div>-->
<!-- <input type="radio" name="club_members" value="1" title="是" {if $playerinfo.club_members == "1"} checked {/if} lay-filter="club_members">-->
<!-- <span>Yes</span>-->
<!-- </div>-->
<!-- <div>-->
<!-- <input type="radio" name="club_members" value="0" title="否" {if $playerinfo.club_members == "0"} checked {/if} lay-filter="club_members">-->
<!-- <span>Deny</span>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
<!-- <div class="layui-form-item club_name_block" {if $playerinfo.club_members == "0"} style="display: none;" {/if} >-->
<!-- <div class="inputname">-->
<!-- <div>-->
<!-- <p>俱乐部名称</p>-->
<!-- <p>Club Name</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="layui-input-block">-->
<!-- <input type="text" name="club_name" value="{$playerinfo.club_name}" autocomplete="off" class="layui-input address">-->
<!-- </div>-->
<!--</div>-->
<!--<div class="layui-form-item duties_style" style="display: none;">-->
<!-- <div class="inputname">-->
<!-- <div>-->
<!-- <p>职务</p>-->
<!-- <p>Duties</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="layui-input-block">-->
<!-- <input type="text" name="duties" value="{$playerinfo.duties}" autocomplete="off" class="layui-input address">-->
<!-- </div>-->
<!--</div>-->
<div class="layui-form-item layui-form-text">
<div class="inputname">
<div>
<p>参赛获奖经历</p>
<p>Entries And Awards</p>
</div>
</div>
<div class="layui-input-block">
<textarea class="layui-textarea" name="experience">{$playerinfo.experience}</textarea>
</div>
</div>
</div>
<div class="not-jhr">
<p class="fly-name isname">
<span>证件信息</span>
<span class="etitle">ID Information</span>
</p>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>证件类型</p>
<p>ID Type</p>
</div>
</div>
<div class="layui-input-block">
<select name="card_type" lay-filter="not-jhr-zj" id="not-jhr-zj">
<option {if $playerinfo.card_type == "身份证"} selected {/if} value="身份证">身份证 Identification card</option>
<option {if $playerinfo.card_type == "护照"} selected {/if} value="护照">护照 Passport</option>
<option {if $playerinfo.card_type == "台胞证"} selected {/if} value="台胞证">台胞证 Permit for Taiwan residents</option>
<option {if $playerinfo.card_type == "港澳通行证"} selected {/if} value="港澳通行证">港澳通行证 Hong Kong and Macao Permit</option>
<option {if $playerinfo.card_type == "社保卡"} selected {/if} value="社保卡">社保卡 Social security card</option>
<option {if $playerinfo.card_type == "户口本"} selected {/if} value="户口本">户口本 Residence booklet</option>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>证件号码</p>
<p>ID Number</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="card_number" autocomplete="off" class="layui-input" value="{$playerinfo.card_number}" lay-verify="identity">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>证件照片</p>
<p>ID Photo</p>
</div>
</div>
<div class="layui-input-block pic-box" >
<div class="show-card-view-same" style="display: {if($playerinfo && $playerinfo.card_type == '护照')} block {else /} none {/if};">
<input type="radio" name="card_view_same" {if($playerinfo && $playerinfo.card_view_same == 1)} checked {/if} value="1" title="人像页/签名页异页" lay-filter="people">
<input type="radio" name="card_view_same" {if($playerinfo && $playerinfo.card_view_same == 2)} checked {/if} value="2" title="人像页/签名部分同页" lay-filter="people">
</div>
<div class="layui-btn demoMore up pic1" input-id="card_front_view">
{if($playerinfo && $playerinfo.card_front_view)}
<img width="100%" height="80" src="{$playerinfo.card_front_view}">
{else /}
<p class="info-pic info-pic1"></p>
{/if}
</div>
<input type="hidden" name="card_front_view" id="card_front_view" value="{$playerinfo.card_front_view}" lay-verify="required">
<div class="layui-btn demoMore up pic2" input-id="card_back_view" style="display:{if($playerinfo && $playerinfo.card_view_same == 2) } none {else /} block {/if}" >
{if($playerinfo && $playerinfo.card_back_view)}
<img width="100%" height="80" src="{$playerinfo.card_back_view}">
{else /}
<p class="info-pic info-pic2"></p>
{/if}
</div>
<input type="hidden" name="card_back_view" id="card_back_view" value="{$playerinfo.card_back_view}" lay-verify="required">
<div class="tip">
<p>照片可以是身份证、户口本、社保卡等证件照</p>
<p>Photos can be ID cards, household registration books, social security cards and other documents</p>
</div>
</div>
</div>
</div>
<div class="jhr" style="display:{if $playerinfo.age < 18} block {else /} none{/if};">
<p class="fly-name isname">
<span>监护人证件信息</span>
<span class="etitle">Guardian Id Information</span>
</p>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>监护人姓名</p>
<p>Name Of Guardian</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="guarder_name" autocomplete="off" placeholder="中文名 or English name" class="layui-input" value="{$playerinfo.guarder_name}">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>监护人手机号码</p>
<p>Guardian Mobile Phone Number</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="guarder_phone" autocomplete="off" class="layui-input" value="{$playerinfo.guarder_phone}" >
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>监护人证件类型</p>
<p>Type Of Guardian Certificate</p>
</div>
</div>
<div class="layui-input-block">
<select name="guarder_card_type" lay-filter="jhr-zj" class="jhr-zj">
<option {if $playerinfo.guarder_card_type == "身份证"} selected {/if} value="身份证">身份证 Identification card</option>
<option {if $playerinfo.guarder_card_type == "护照"} selected {/if} value="护照">护照 Passport</option>
<option {if $playerinfo.guarder_card_type == "台胞证"} selected {/if} value="台胞证">台胞证 Permit for Taiwan residents</option>
<option {if $playerinfo.guarder_card_type == "港澳通行证"} selected {/if} value="港澳通行证">港澳通行证 Hong Kong and Macao Permit</option>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>监护人证件号码</p>
<p>Id Number Of Guardian</p>
</div>
</div>
<div class="layui-input-block">
<input type="text" name="guarder_card_number" class="guarder-card-number" autocomplete="off" class="layui-input" value="{$playerinfo.guarder_card_number}">
</div>
</div>
<div class="layui-form-item">
<div class="inputname">
<span class="red">*</span>
<div>
<p>监护人证件照片</p>
<p>Guardian Id Photo</p>
</div>
</div>
<div class="layui-input-block pic-box" >
<div class="show-guard-card-view-same" style="display: {if $playerinfo.guarder_card_type == '护照'} block {else/} none{/if};">
<input type="radio" name="guarder_card_view_same" value="1" title="人像页/签名页异页" {if $playerinfo.guarder_card_view_same == 1} checked {/if} lay-filter="people2">
<input type="radio" name="guarder_card_view_same" value="2" title="人像页/签名部分同页" {if $playerinfo.guarder_card_view_same == 2} checked {/if} lay-filter="people2">
</div>
<div class="layui-btn demoMore demoMore2 up pic3" input-id="guarder_card_front_view">
{if $playerinfo.guarder_card_front_view}
<img width="142" height="120" src="{$playerinfo.guarder_card_front_view}">
{else /}
<p class="info-pic info-pic1"></p>
{/if}
</div>
<input type="hidden" name="guarder_card_front_view" id="guarder_card_front_view" value="{$playerinfo.guarder_card_front_view}">
<div class="layui-btn demoMore demoMore2 up pic4" input-id="guarder_card_back_view" style="display: block;">
{if $playerinfo.guarder_card_back_view}
<img width="142" height="120" src="{$playerinfo.guarder_card_back_view}">
{else /}
<p class="info-pic info-pic2"></p>
{/if}
</div>
<input type="hidden" name="guarder_card_back_view" id="guarder_card_back_view" value="{$playerinfo.guarder_card_back_view}">
</div>
</div>
</div>
<div class="btn info-btn">
<button class="layui-btn reNext" id="submit" lay-submit="" lay-filter="demo1">
<span>提交</span>
<span>Submit</span>
</button>
</div>
</form>
</div>
<script src="__CDN__/assets/css/door/js/jquery.form.min.js"></script>
<!--<script src="__CDN__/assets/css/door/layui/layui.js"></script>-->
<script src="__CDN__/assets/css/door/layuis/layui-main/src/layui.js"></script>
<script src="__CDN__/assets/css/door/js/door/common.js"></script>
<script src="__CDN__/assets/css/door/js/area.js"></script>
<script src="__CDN__/assets/css/door/js/door/country.js"></script>
<script>
layui.use(['form','upload','layer','laydate'],function () {
var form = layui.form;
var upload = layui.upload;
var layer = layui.layer;
var laydate = layui.laydate;
for (index in country) {
$("#nationality").append('<option>' + country[index]["label"] + ' ' + country[index]['value'] + '</option>');
}
// 显示提示文字
$('.clubtips').click(function(){
$(this).children('.tipText').fadeIn();
})
$('.tipclose').click(function(e){
e.stopPropagation();
$(this).parent('.tipText').fadeOut();
})
form.render()
form.on('select(identityType)',function (data) {
location.href = $(data.elem).find("option:selected").attr("href");
});
laydate.render({
elem: '#birthday',
done: function(value, date, endDate){
if(value != ''){
var age = GetAge(value);
$("#showAge").html(age+"岁");
$("#age").val(age);
var country = $("#nationality").find("option:selected").val();
if(age < 18){
// $(".not-jhr").hide();
$(".jhr").show();
}else{
$(".jhr").hide();
$(".not-jhr").show();
}
}else{
$("#showAge").html("");
$("#age").val("");
}
}
});
form.on('select(nationality)', function(data){
var age = $("#age").val();
if(age < 18){
$(".jhr").show();
}
if("中国 China" == data.value ){
$('#not-jhr-zj').next().find('.layui-anim').children('dd[lay-value="身份证"]').click();
$("#pro_city_dis").show();
}else{
$('#province,#city,#district').val('')
$("#pro_city_dis").hide();
$('#not-jhr-zj').next().find('.layui-anim').children('dd[lay-value="护照"]').click();
form.render();
}
});
form.render();
form.render('select');
//普通图片上传
upload.render({
elem: '.up'
,url: '{:url("/api/common/upload")}'
,multiple: true
,accept:"images",
size:500
,data:{_token:'{{ csrf_token() }}'}
,done: function(res,index){
layer.msg('上传成功');
var element = this.item[0];
var input = element.getAttribute("input-id");
if(input == "player_pic"){
width = 118;
height = 152;
margin_top = 0;
}else{
width = 142;
height = 120;
margin_top = 10
}
element.innerHTML = "<img width="+width+" height="+height+" style='margin-top: "+margin_top+"px' src="+res.data.fullurl+">";
console.log(input)
$("#"+input).val(res.data.fullurl);
layer.closeAll('loading');
// $("#thumb").val(res.data);
// $('#layui-upload-box li p').text('上传成功');
// autoIframeHeight();
// return layer.msg('上传成功');
}
,error: function(index, upload){
layer.msg('上传失败');
layer.closeAll('loading');
}
});
//初始化时判定监护人证件类型
function checkJhrZj(){
let n = $('.jhr-zj option:selected').attr('value')
if(n=='身份证'){
$('.guarder-card-number').attr('lay-verify','required|identity')
}else{
$('.guarder-card-number').attr('lay-verify','required')
}
}
form.verify({
chinese: function(value, item){
if(!new RegExp("^[\u4e00-\u9fa5]+$").test(value)){
return '只能输入中文';
}
}
});
// checkJhrZj()
//监护人证件选择
form.on('select(jhr-zj)', function(data){
if(data.value == "护照"){
$(".pic3 p").addClass("info-pic3");
$(".pic4 p").addClass("info-pic4");
console.log($("input[name='guarder_card_view_same']:checked").val())
if($("input[name='guarder_card_view_same']:checked").val() == 2){
$(".pic4").hide();
}
$(".show-guard-card-view-same").show();
if(form.val('playerApply').card_view_same=='1'){
$('#guarder_card_back_view').attr('lay-verify','required')
}else if(form.val('playerApply').card_view_same=='2'){
$('#guarder_card_back_view').attr('lay-verify','')
}
}else{
$(".pic3 p").removeClass("info-pic3");
$(".pic4 p").removeClass("info-pic4");
$(".pic3").show();
$(".pic4").show();
$(".show-guard-card-view-same").hide();
$('#guarder_card_back_view').attr('lay-verify','required')
}
if(data.value=='身份证'){
$("input[name='guarder_card_number']").attr('lay-verify','identity|required')
}else{
$("input[name='guarder_card_number']").attr('lay-verify','required')
}
form.render();
});
//非监护人证件选择
form.on('select(not-jhr-zj)', function(data){
if(data.value == "护照"){
$(".pic1 p").addClass("info-pic3");
$(".pic2 p").addClass("info-pic4");
if($("input[name='card_view_same']:checked").val() == 2){
$(".pic2").hide();
}
$(".show-card-view-same").show();
if(form.val('playerApply').card_view_same=='1'){
$('#card_back_view').attr('lay-verify','required')
}else if(form.val('playerApply').card_view_same=='2'){
$('#card_back_view').attr('lay-verify','')
}
}else{
$(".pic1 p").removeClass("info-pic3");
$(".pic2 p").removeClass("info-pic4");
$(".pic1").show();
$(".pic2").show();
$(".show-card-view-same").hide();
$('#card_back_view').attr('lay-verify','required')
}
if(data.value=='社保卡'){
$("input[name='card_number']").attr('placeholder','请填写社保卡上身份证号')
}else if(data.value=='户口本'){
$("input[name='card_number']").attr('placeholder','请填写户口本上身份证号')
}else{
$("input[name='card_number']").attr('placeholder','')
}
if(data.value=='身份证'){
$("input[name='card_number']").attr('lay-verify','identity|required')
}else{
$("input[name='card_number']").attr('lay-verify','required')
}
form.render();
});
//非监护人护照同/异页选择
form.on('radio(people)', function (data) {
if(data.value=='2'){
$(".pic2").hide();
$('#card_back_view').attr('lay-verify','')
}else{
$(".pic2").show();
$('#card_back_view').attr('lay-verify','required')
}
form.render()
});
//监护人护照类型同/异页选择
form.on('radio(people2)', function (data) {
if(data.value=='2'){
$(".pic4").hide();
$('#guarder_card_back_view').attr('lay-verify','')
}else{
$(".pic4").show();
$('#guarder_card_back_view').attr('lay-verify','required')
}
form.render()
});
//护照初始化判断
console.log(form.val('playerApply'))
if(form.val('playerApply')){
let d=form.val('playerApply')
if(d.card_view_same=='2'){
$(".pic2").hide();
$('#card_back_view').attr('lay-verify','')
}
if(d.guarder_card_view_same=='2'){
$(".pic4").hide();
$('#guarder_card_back_view').attr('lay-verify','')
}
form.render()
}
// 是否是 asfc 会员
form.on('radio(asfc_user)', function (data) {
console.log(data)
if(data.value=='0'){
$(".membership_id_number").hide();
}else{
$(".membership_id_number").show();
}
});
// 是否是俱乐部会员
form.on('radio(club_members)', function (data) {
console.log(data)
if(data.value=='0'){
$(".club_name_block").hide();
$(".duties_style").hide();
}else{
$(".club_name_block").show();
$(".duties_style").show();
}
});
<?php if(!empty($playerinfo)){ ?>
//省市区联动
var defalutProvince = "{$playerinfo.province}";
var defalutCity = "{$playerinfo.city}";
var defalutDistrict = "{$playerinfo.district}";
//省
<?php } else{?>
//省市区联动
var defalutProvince = "";
var defalutCity = "";
var defalutDistrict = "";
//省
<?php } ?>
for(index in Area){
$("#province").append('<option item="'+index+'" value="'+Area[index]["provinceName"]+'" >' + Area[index]["provinceName"] + '</option>');
}
form.render('select');
//市
form.on('select(province)', function(data){
var item =$(data.elem).find("option:selected").attr("item");
$("#city").html('');
$("#district").html('');
if(item != undefined){
var citys = Area[item]["mallCityList"];
for(index in citys){
$("#city").append('<option item="'+item+','+index+'" value="'+citys[index]["cityName"]+'">' + citys[index]["cityName"] + '</option>');
}
}
form.render('select');
$('#city').next().find('.layui-anim').children().get(0).click();
});
//区
form.on('select(city)', function(data){
var item =$(data.elem).find("option:selected").attr("item");
$("#district").html('');
if(item != ""){
arr = item.split(",");
var district = Area[arr[0]]["mallCityList"][arr[1]]['mallAreaList'];
for(index in district){
$("#district").append('<option value="'+district[index]["areaName"]+'">' + district[index]["areaName"] + '</option>');
}
}
form.render('select');
});
//默认选中
if(defalutProvince != ''){
$('#province').next().find('.layui-anim').children('dd[lay-value="' + defalutProvince + '"]').click();
}
if(defalutCity != ''){
$('#city').next().find('.layui-anim').children('dd[lay-value="' + defalutCity + '"]').click();
}
if(defalutDistrict != ''){
$('#district').next().find('.layui-anim').children('dd[lay-value="' + defalutDistrict + '"]').click();
}
var formUrl = '{:url("players/edit")}';
$("#playerApply").submit(function () {
let layload = layer.msg('提交中... / Under submission...',{shade: 0.01,icon:16});
var _form = this;
// _form.submit.setAttribute("disabled",true);
var paramsArray = $('form').serializeArray();
var newParams = {};
$.map(paramsArray,function(n,i){
newParams[n["name"]]=n["value"];
})
if (newParams.player_pic.length <= 0){
layer.msg('照片不能为空 / The photo cannot be empty', {icon: 5});
return ;
}
var _form = this;
$(this).ajaxSubmit({
type: "POST",
url: formUrl,
data: $(this).formSerialize(),
dataType: "json",
success: function (data) {
layer.close(layload);
if (data.code == 0){
layer.msg(data.msg,{icon: 2});
}else{
layer.msg(data.msg,{icon: 1});
location.href = data.url;
}
return;
},
error: function (data) {
_form.submit.removeAttribute("disabled");
var errors = data.responseJSON.errors;
if(errors){
for (var index in errors){
layer.msg(errors[index][0],{icon: 2});
break;
}
}else{
layer.msg(data.responseJSON.message,{icon: 2});
}
}
});
return false;
});
{if $playerinfo}
$('#nationality').next().find('.layui-anim').children('dd[lay-value="{$playerinfo.country}"]').click();
{/if}
})
</script>