@ -22,15 +22,18 @@
< p class = "profile-text" style = "display: inline" > Статус { { player [ 'permition' ] [ 'status' ] } } : < / p >
< p class = "profile-text" style = "color: green;display: inline" v-if ="player['permition']['status'] === 'VIP'" > Куплен < / p >
< p class = "profile-text" v -else style = "color: #fd8846;display: inline" > Имеется < / p >
< br >
< p class = "profile-text" style = "display: inline" > Дата окончания : < / p >
< p class = "profile-text" v-if ="player['permition']['amount'] === 0" style="display: inline" > Навсегда < / p >
< p class = "profile-text" v -else style = "display: inline" > { { new Date ( ( player [ 'permition' ] [ 'u_timestamp' ] + player [ 'permition' ] [ 'amount' ] ) * 1000 ) . toLocaleDateString ( ) } } < / p >
< / div >
< hr >
< md -menu md -direction = " bottom -start " md -size = " auto " >
<!-- GAMETIME -- >
< md -button v -on :click ="loadingUserTime()" v -if = " usertime.loaded = = = false " class = "md-raised" style = "color: #131213; font-family: tf2build; background: #fd8846; margin: 0% 0%" md -menu -trigger > { { usertime . loading ? 'Загрузка' : 'Статистика по картам' } } < / m d - b u t t o n >
< md -menu v -else md -direction = " bottom -start " md -size = " auto " >
< md -button class = "md-raised" style = "color: #131213; font-family: tf2build; background: #fd8846" md -menu -trigger > Статистика по картам < / m d - b u t t o n >
< md -menu -content >
< md -menu -item v-for ="g in getPlayerGametime() " :key="g[0]+'g'" > {{ g [ 0 ] }} - {{ timeFormat ( g [ 1 ] ) }} < / md -menu -item >
< md -menu -item v-for ="g in usertime.store " :key="g[0]+'g'" > {{ g [ 0 ] }} - {{ timeFormat ( g [ 1 ] ) }} < / md -menu -item >
< / m d - m e n u - c o n t e n t >
< / m d - m e n u >
< br >
@ -41,17 +44,21 @@
< / m d - m e n u - c o n t e n t >
< / m d - m e n u >
< br >
< md -menu md -direction = " bottom -start " md -size = " auto " v-if ="player['donates'].length > 0" >
<!-- DONATES -- >
< md -button v -on :click ="loadingDonates()" v -if = " donates.loaded = = = false " class = "md-raised" style = "color: #131213; font-family: tf2build; background: #fd8846; margin: 0% 0%" md -menu -trigger > { { donates . loading ? 'Загрузка' : 'Покупки VIP' } } < / m d - b u t t o n >
< md -menu v -else md -direction = " bottom -start " md -size = " auto " >
< md -button class = "md-raised" style = "color: #131213; font-family: tf2build; background: #fd8846" md -menu -trigger > Покупки VIP < / m d - b u t t o n >
< md -menu -content >
< md -menu -item v-for ="d in player['donates'] " :key="d['utime']+'d'" > {{ new Date ( d [ ' utime ' ] * 1000 ) .toLocaleDateString ( ) }} | {{ d [ ' status ' ] }} < / md -menu -item >
< md -menu -item v-for ="d in donates.store " :key="d['utime']+'d'" > {{ new Date ( d [ ' utime ' ] * 1000 ) .toLocaleDateString ( ) }} | {{ d [ ' status ' ] }} < / md -menu -item >
< / m d - m e n u - c o n t e n t >
< / m d - m e n u >
< br >
< md -menu md -direction = " bottom -start " md -size = " auto " v-if ="false" >
<!-- BAN LIST -- >
< md -button v -on :click ="loadingBanList()" v -if = " ban_list.loaded = = = false " class = "md-raised" style = "color: #131213; font-family: tf2build; background: #fd8846; margin: 0% 0%" md -menu -trigger > { { ban_list . loading ? 'Загрузка' : 'История банов' } } < / m d - b u t t o n >
< md -menu v -else md -direction = " bottom -start " md -size = " auto " >
< md -button class = "md-raised" style = "color: #131213; font-family: tf2build; background: #fd8846" md -menu -trigger > История Банов < / m d - b u t t o n >
< md -menu -content >
< md -menu -item v-for ="d in []" :key="d['utime']+'d '" > {{ new Date ( d [ ' utime ' ] * 1000 ) .toLocaleDateString ( ) }} | {{ d [ ' status ' ] }} < / md -menu -item >
< md -menu -item v-for ="b in ban_list.store" :key="b['id']+'b '" > # {{ b [ ' id ' ] }} | {{ new Date ( b [ ' ban_ utime' ] * 1000 ) .toLocaleDateString ( ) }} | {{ b [ ' ban_length ' ] = = = 0 ? ' Навсегда ' : ` $ { b [ ' ban_length ' ] } минут ` }} < / md -menu -item >
< / m d - m e n u - c o n t e n t >
< / m d - m e n u >
< / div >
@ -62,9 +69,9 @@
< p class = "profile-text" style = "text-align: right; cursor: pointer;" v-if ="this.player['play_on'] !== null && 'ip' in this.player['play_on']" v-on:click="showIP()" > IP : {{ player_ip }} < / p >
< p class = "profile-text" style = "text-align: right" v-if ="this.player['play_on'] !== null && 'kills' in this.player['play_on']" > Убийств : {{ this.player [ ' play_on ' ] [ ' kills ' ] }} < / p >
< p class = "profile-text" style = "text-align: right" v-if ="this.player['play_on'] !== null && 'deads' in this.player['play_on']" > Смертей : {{ this.player [ ' play_on ' ] [ ' deads ' ] }} < / p >
< p class = "profile-text" style = "text-align: right" > Наиграно : { { getTotalPlaytime ( ) } } < / p >
< p class = "profile-text" style = "text-align: right; cursor: pointer" v -on :click ="loadingUserTime() " > Наиграно : { { usertime . total } } < / p >
< div style = "justify-content: right; display: flex" >
< DiscordSvg :h ="'10%'" :w ="'40'" style = "margin-left: 5%" / >
< DiscordSvg :h ="'10%'" :w ="'40'" style = "margin-left: 5%" v -if = " this.player [ ' attached_discords ' ] .filter ( v = > v [ 'active' ] === 1 ) . length > 0 " :url=" ` https://discord.com/channels/@me/ ${ this . player [ 'attached_discords' ] . filter ( v => v [ 'active' ] === 1 ) [ 0 ] [ 'discord_id' ] } ` " / >
< SteamSvg :h ="'10%'" :w ="'40'" style = "margin-left: 5%" :url ="this.player['steamids']['community_url']" / >
< / div >
< / div >
@ -90,7 +97,23 @@ export default {
} ,
} ,
data : ( ) => ( {
player_ip : "Показать"
player_ip : "Показать" ,
donates : {
loading : false ,
loaded : false ,
store : [ ]
} ,
ban_list : {
loading : false ,
loaded : false ,
store : [ ]
} ,
usertime : {
loading : false ,
loaded : false ,
store : [ ] ,
total : "Показать"
}
} ) ,
methods : {
getAvatar ( ) {
@ -100,15 +123,9 @@ export default {
return require ( '@/assets/profile-user.svg' ) ;
}
} ,
getPlayerGametime ( ) {
return this . $API . player . getGametime ( this . $API , this . player ) ;
} ,
timeFormat ( seconds ) {
return this . $API . UNIX2FACTI_TIME ( seconds ) ;
} ,
getTotalPlaytime ( ) {
return this . timeFormat ( this . $API . player . getGametimeTotal ( this . player ) ) ;
} ,
getLastPlay ( ) {
return this . $API . player . getLastplayList ( this . player ) ;
} ,
@ -127,6 +144,52 @@ export default {
} ) . catch ( ( ) => {
this . player_ip = "хаха нет" ;
} )
} ,
loadingDonates ( ) {
if ( this . donates . loading ) return ;
this . donates . loading = true ;
axios . get ( ` api/profile/web?steam64= ${ this . player [ 'steamids' ] [ 'steam64' ] } &requests=donates ` )
. then ( response => {
this . donates . store = response . data [ 'donates' ] ;
this . donates . loaded = true ;
if ( this . donates . store . length === 0 ) {
this . donates . store . push ( { "utime" : Date . now ( ) / 1000 , "status" : "Пока тут пусто" } )
}
} )
. catch ( ( ) => this . donates . loaded = false )
. finally ( ( ) => this . donates . loading = false )
} ,
loadingBanList ( ) {
if ( this . ban_list . loading || this . ban_list . loaded ) return ;
this . ban_list . loading = true ;
axios . get ( ` api/profile/web?steam64= ${ this . player [ 'steamids' ] [ 'steam64' ] } &requests=ban_list ` )
. then ( response => {
this . ban_list . store = response . data [ 'ban_list' ] ;
this . ban_list . loaded = true ;
if ( this . ban_list . store . length === 0 ) {
this . ban_list . store . push ( { "ban_utime" : Date . now ( ) / 1000 , "id" : "Пока тут пусто, надеюсь" , "ban_length" : 0 } )
}
} )
. catch ( ( ) => this . ban_list . loaded = false )
. finally ( ( ) => this . ban_list . loading = false )
} ,
loadingUserTime ( ) {
if ( this . usertime . loading || this . usertime . loaded ) return ;
this . usertime . loading = true ;
this . usertime . total = "считаем сколько" ;
axios . get ( ` api/profile/web?steam64= ${ this . player [ 'steamids' ] [ 'steam64' ] } &requests=usertime ` )
. then ( response => {
this . usertime . store = this . $API . player . getGametime ( this . $API , response . data [ 'gametime' ] ) ;
this . usertime . total = this . timeFormat ( this . $API . player . getGametimeTotal ( response . data [ 'gametime' ] ) ) ;
this . usertime . loaded = true ;
if ( this . usertime . store . length === 0 ) {
this . usertime . store . push ( [ "Не играл ни где" , 0 ] ) ;
this . usertime . total = "отсутствует" ;
}
} )
. catch ( ( ) => this . usertime . loaded = false )
. finally ( ( ) => this . usertime . loading = false )
}
}
}