www_fpvone_cn/application/index/view/club - 副本/myplayer.html

332 lines
14 KiB
HTML
Raw Normal View History

2024-12-20 12:29:51 +08:00
<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/css/flyer.css">
<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/layui-v2.9.3/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="__CDN__/assets/css/door/css/newClub.css?v={$site.version}">
<style>
.clublist{
margin-top: 0;
padding: 20px 10%;
}
.clublist .list .item{
align-items: center;
}
.clublist .list .item>div{
display: flex;
}
.clublist .list .item p{
white-space: nowrap;
}
.clublist .list .item .w160{
width: 160px;
}
.clublist .list .item button{
width: 70px;
padding: 0;
height: 30px;
margin: 0 5px;
}
.clublist .list .item .rejuse{
background: #aaa;
}
.layui-layer-btn0{
background: #000!important;
}
@media screen and (max-width: 768px){
.clublist{
padding: 0 2% 20px;
}
.clublist .head p:last-child{
display: none;
}
.clublist .list .item p{
width: 25%;
overflow: hidden;
}
.clublist .list .item p:nth-child(2){
}
.clublist .list .item button{
width: 40px;
margin: 0 2px;
}
.clublist .list .item .w160{
width: 86px;
}
}
</style>
<div class="fly-right">
<div class="fr-wrap">
<p class="my-event">俱乐部飞手 | Club Members</p>
<div class="clublist">
<div class="head">
<div>
<p>飞手姓名</p>
<p>Pilot Name</p>
</div>
<div>
<p>申请时间</p>
<p>Application Time</p>
</div>
<div>
<p>申请事项</p>
<p>Application Item</p>
</div>
<div>
<p>操作</p>
<p>Operation</p>
</div>
</div>
<div class="list"></div>
<div id="page"></div>
</div>
</div>
</div>
<script src="__CDN__/assets/css/door/js/jquery.form.min.js"></script>
<script src="__CDN__/assets/css/door/layui/layui.js"></script>
<script>
layui.use(['layer','laypage'],function(){
const laypage=layui.laypage;
const layer=layui.layer;
// 更新列表
function getlist(res){
$('.clublist .head>div').show()
$('.clublist .list').empty()
let itemhtml=''
let ophtml='';
let status='';
res.forEach((item)=>{
if(item.status==4||item.status==5){
status='退出俱乐部'
item.color='redtext'
}else{
status='加入俱乐部'
}
// 判断是否显示操作按钮
if(item.status==2){
ophtml=`
<p style="color:#999;" class="w160">已通过</p>
`
}else if(item.status==3||item.status==5){
ophtml=`
<p class="redtext w160">已拒绝</p>
`
}else if(item.status==1){
ophtml=`
<button class="joinbtn agbtn" id="${item.check_id}" type="1">通过</button>
<button class="joinbtn rejuse" id="${item.check_id}" type="2">拒绝</button>
`
}else{
ophtml=`
<button class="joinbtn agbtn" id="${item.check_id}" type="3">通过</button>
<button class="joinbtn rejuse" id="${item.check_id}" type="4">拒绝</button>
`
}
if(item.player){
itemhtml+=`
<div class="item">
<p>${item.player.real_name}</p>
<p>${item.player.created_at}</p>
<p class="${item.color}">${status}</p>
<div>
${ophtml}
</div>
<div class="playerinfo" style="display:none;">
<div class="boxs">
<p class="my-event">飞手信息 | Pilot Information</p>
<div class="list">
<div class="item">
<div class="pcitem">
<div>
<p>姓名</p>
<p>Name</p>
</div>
<div>${item.player.real_name}</div>
</div>
<div class="pcitem">
<div>
<p>性别</p>
<p>Gender</p>
</div>
<div>${item.player.gender}</div>
</div>
</div>
<div class="item">
<div class="pcitem">
<div>
<p>出生日期</p>
<p>Birth</p>
</div>
<div>${item.player.birthday}</div>
</div>
<div class="pcitem">
<div>
<p>国籍</p>
<p>Nationality</p>
</div>
<div>${item.player.country}</div>
</div>
</div>
<div class="item">
<div class="pcitem">
<div>
<p>居住地</p>
<p>To Live</p>
</div>
<div>${item.player.province}${item.player.city}${item.player.district}</div>
</div>
<div class="pcitem">
<div>
<p>地址</p>
<p>Address</p>
</div>
<div>${item.player.address}</div>
</div>
</div>
<div class="item">
<div class="pcitem">
<div>
<p>照片</p>
<p>Photo</p>
</div>
<div><img src="${item.player.player_pic}" width="150"></div>
</div>
<div class="pcitem">
<div>
<p>辅导员姓名</p>
<p>Counselor Name</p>
</div>
<div>${item.player.counselor_name}</div>
</div>
</div>
<div class="item">
<div class="pcitem">
<div>
<p>ASFC会员</p>
<p>ASFC User</p>
</div>
<div>${item.player.asfc_user?'否':'是'}</div>
</div>
<div class="pcitem">
<div>
<p>飞行证号</p>
<p>Flight Number</p>
</div>
<div>${item.player.flight_number}</div>
</div>
</div>
<div class="item">
<div class="pcitem">
<div>
<p>俱乐部成员</p>
<p>Club Members</p>
</div>
<div>${item.player.club_members?'否':'是'}</div>
</div>
<div class="pcitem">
<div>
<p>联系电话</p>
<p>Contact</p>
</div>
<div>${item.player.phone}</div>
</div>
</div>
<div class="item">
<div class="pcitem">
<div>
<p>参赛获奖经历</p>
<p>Entries And Awards</p>
</div>
<div>${item.player.experience}</div>
</div>
</div>
</div>
</div>
</div>
</div>
`
}
})
$('.clublist .list').append(itemhtml)
// 点击获取飞手详细信息
$('.clublist .list .item>p').click(function(){
layer.open({
title:false,
type:1,
content:$(this).siblings('.playerinfo').html(),
shadeClose: true,
closeBtn:0,
area:['60%','80%']
})
})
// 拒绝申请
$('.rejuse').click(function(){
const rethat=$(this)
layer.prompt({
title: '拒绝理由',
formType: 2
}, function(text, index){
layer.close(index);
$.post('/index/club/pass_join',{
type:rethat.attr('type'),
id:rethat.attr('id'),
reject_reason:text
},function(res){
if(res.code){
layer.msg('操作成功',{icon:1});
setTimeout(function () {
location.reload();
}, 2000);
}
})
})
})
// 通过申请
$('.agbtn').click(function(){
$.post('/index/club/pass_join',{
type:$(this).attr('type'),
id:$(this).attr('id')
},function(res){
if(res.code){
layer.msg('操作成功',{icon:1});
setTimeout(function () {
location.reload();
}, 2000);
}
})
})
}
// 获取飞手列表
let page=1;
$.get('/index/club/myplayer_data',{
page
},function(res){
if(res.total>0){
getlist(res.data)
// 分页
laypage.render({
elem: 'page',
limit: 10,
count: res.total,
layout: ['count', 'prev', 'page', 'next'],
prev: '<em><</em>',
next: '<em>></em>',
theme: '#C2C2C2',
curr: page,
jump: function(obj){
$.get('/index/club/myplayer_data',{
page:obj.curr
},function(data){
getlist(data.data)
})
}
})
}else{
$('.clublist .list').html('<p class="nofly">暂无飞手</p>')
}
})
})
</script>