3 changed files with 62 additions and 11 deletions
@ -0,0 +1,39 @@ |
|||
<template> |
|||
<md-dialog :md-active.sync="showFreeVipDialog" @close="showFreeVipDialog=false"> |
|||
<div class="md-layout md-alignment-bottom-center"> |
|||
<div class="md-layout-item md-size-100 md-small-size-100 md-alignment-bottom-center rounded-only"> |
|||
<h1 v-if="loading">Загрузка</h1> |
|||
<h5 v-else style="padding: 0% 5%; text-align: center">{{result}}</h5> |
|||
<md-button style="color: #fdfde1; font-family: tf2build; background: #000000;float: right" v-if="result.length>0" v-on:click="openFVD(false)">ОК</md-button> |
|||
</div> |
|||
</div> |
|||
</md-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import axios from "axios"; |
|||
export default { |
|||
name: 'FreeVipDialog', |
|||
data: () => ({ |
|||
showFreeVipDialog: false, |
|||
loading: false, |
|||
result: "" |
|||
}), |
|||
methods: { |
|||
openFVD(s) {this.showFreeVipDialog = s;}, |
|||
getFreeVIP() { |
|||
axios.post("api/profile/current/freevip").then( |
|||
(response) => { |
|||
if (response.data === 0) this.result="У тебя уже есть VIP, жать второй раз незачем"; |
|||
else if (response.data === 1) this.result="Бесплатный вип выдан, балдей..."; |
|||
else if (response.data > 1) this.result=`Ты не можешь получить вип бесплатно, вернись через ${this.$API.UNIX2FACTI_TIME(response)}`; |
|||
else if (response.data < 0) this.result=`Ты недостаточно наиграл у нас на серверах! Наиграй еще ${this.$API.UNIX2FACTI_TIME(response * -1)}`; |
|||
else this.result=`Сегодня не твой день...`; |
|||
this.openFVD(true); |
|||
} |
|||
).catch(() => {this.result="Тебя обоссал морген...";}) |
|||
.finally(() => {this.loading = false;}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue