|
@@ -1,28 +1,44 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div class="services-menu"> |
|
|
<div class="services-menu"> |
|
|
<button class="selected">Services</button> |
|
|
|
|
|
<button>Credits</button> |
|
|
|
|
|
<div class="menu-slider"><div></div></div> |
|
|
|
|
|
|
|
|
<a href="#new-order" :class="{selected: page == 'new-order'}">Services</a> |
|
|
|
|
|
<a href="#credits" :class="{selected: page == 'credits'}">Credits</a> |
|
|
|
|
|
<div :class="page" class="menu-slider"><div></div></div> |
|
|
</div> |
|
|
</div> |
|
|
<h4 class="credits-display">Credits: {{credits}}</h4> |
|
|
|
|
|
<div class="services-legend"><h5>Name</h5> |
|
|
|
|
|
<h5>Credits per 1000</h5><h5>Min Qt.</h5><h5>Max Qt.</h5></div> |
|
|
|
|
|
<ServicePane :site="'youtube'" :services="services" @select="select"></ServicePane> |
|
|
|
|
|
<ServicePane :site="'instagram'" :services="services" @select="select"></ServicePane> |
|
|
|
|
|
<ServicePane :site="'twitter'" :services="services" @select="select"></ServicePane> |
|
|
|
|
|
<ServicePane :site="'tiktok'" :services="services" @select="select"></ServicePane> |
|
|
|
|
|
<div id="overlay" v-if="selected"> |
|
|
|
|
|
|
|
|
<h4 class="credits-display">Credits: {{credits.toLocaleString('en')}}</h4> |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="page == 'new-order'"> |
|
|
|
|
|
|
|
|
|
|
|
<div class="services-legend"> |
|
|
|
|
|
<h5>Name</h5><h5>Credits per 1000</h5><h5>Min Qt.</h5><h5>Max Qt.</h5> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<ServicePane :site="'youtube'" :services="services" |
|
|
|
|
|
@select="select"></ServicePane> <ServicePane :site="'instagram'" |
|
|
|
|
|
:services="services" @select="select"></ServicePane> <ServicePane |
|
|
|
|
|
:site="'twitter'" :services="services" @select="select"></ServicePane> |
|
|
|
|
|
<ServicePane :site="'tiktok'" :services="services" |
|
|
|
|
|
@select="select"></ServicePane> |
|
|
|
|
|
|
|
|
|
|
|
<div id="overlay" v-if="selected"> |
|
|
|
|
|
|
|
|
<div v-if="!completed" class="overlay-item"> |
|
|
<div v-if="!completed" class="overlay-item"> |
|
|
<img @click="completed = false; selected = null" class="cancel icon" src="../../images/cancel-icon2.svg" alt=""/> |
|
|
|
|
|
<img v-if="selected.site == 'youtube'" class="icon" src="../../images/youtube-icon.svg" alt=""> |
|
|
|
|
|
<img v-if="selected.site == 'instagram'" class="icon" src="../../images/instagram-icon.svg" alt=""> |
|
|
|
|
|
<img v-if="selected.site == 'twitter'" class="icon" src="../../images/twitter.svg" alt=""> |
|
|
|
|
|
<img v-if="selected.site == 'tiktok'" class="icon" src="../../images/tik-tok.svg" alt=""> |
|
|
|
|
|
|
|
|
<img @click="completed = false; selected = null" class="cancel icon" |
|
|
|
|
|
src="../../images/cancel-icon2.svg" alt=""/> |
|
|
|
|
|
<img v-if="selected.site == 'youtube'" class="icon" |
|
|
|
|
|
src="../../images/youtube-icon.svg" alt=""/> |
|
|
|
|
|
<img v-if="selected.site == 'instagram'" class="icon" |
|
|
|
|
|
src="../../images/instagram-icon.svg" alt=""/> |
|
|
|
|
|
<img v-if="selected.site == 'twitter'" class="icon" |
|
|
|
|
|
src="../../images/twitter.svg" alt=""/> |
|
|
|
|
|
<img v-if="selected.site == 'tiktok'" class="icon" |
|
|
|
|
|
src="../../images/tik-tok.svg" alt=""/> |
|
|
<h3>{{selected.name}}</h3> |
|
|
<h3>{{selected.name}}</h3> |
|
|
<h4>Cost: {{cost.toLocaleString('en')}}</h4> |
|
|
<h4>Cost: {{cost.toLocaleString('en')}}</h4> |
|
|
<h4>Quantity</h4> |
|
|
<h4>Quantity</h4> |
|
|
<div><input required :min="selected.minimum" :max="selected.maximum" type="number" v-model="amount" id="selQty"><span> / {{selected.maximum.toLocaleString('en')}}</span></div> |
|
|
|
|
|
|
|
|
<div><input required :min="selected.minimum" :max="selected.maximum" |
|
|
|
|
|
type="number" v-model="amount" id="selQty"><span> / |
|
|
|
|
|
{{selected.maximum.toLocaleString('en')}}</span></div> |
|
|
<template v-if="selected.modifier == 'location'"> |
|
|
<template v-if="selected.modifier == 'location'"> |
|
|
<h4>Location</h4> |
|
|
<h4>Location</h4> |
|
|
<div><select required id="country" name=""> |
|
|
<div><select required id="country" name=""> |
|
@@ -31,24 +47,36 @@ |
|
|
<option value="uk">United Kingdom</option> |
|
|
<option value="uk">United Kingdom</option> |
|
|
<option value="germany">Germany</option> |
|
|
<option value="germany">Germany</option> |
|
|
<option value="france">France</option> |
|
|
<option value="france">France</option> |
|
|
</select></div> |
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<h4>URL</h4> |
|
|
<h4>URL</h4> |
|
|
<div><input required type="url" id="url" v-model="url"></div> |
|
|
<div><input required type="url" id="url" v-model="url"></div> |
|
|
<button @click="buyService" :disabled="paying">Submit<loading v-if="paying"></loading></button> |
|
|
|
|
|
|
|
|
<button @click="buyService" :disabled="paying">Submit<loading |
|
|
|
|
|
v-if="paying"></loading></button> |
|
|
<p id="overlay-error"></p> |
|
|
<p id="overlay-error"></p> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="overlay-item" v-else-if="completed"> |
|
|
<div class="overlay-item" v-else-if="completed"> |
|
|
<img @click="completed = false; selected = null" class="cancel icon" src="../../images/cancel-icon2.svg" alt=""/> |
|
|
|
|
|
<img class="icon" src="../../images/checked2.svg" alt=""> |
|
|
|
|
|
|
|
|
<img @click="completed = false; selected = null" class="cancel icon" |
|
|
|
|
|
src="../../images/cancel-icon2.svg" alt=""/> |
|
|
|
|
|
<img class="icon" src="../../images/checked2.svg" alt=""/> |
|
|
<h3>Success!</h3> |
|
|
<h3>Success!</h3> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<credits v-if="page == 'credits'"></credits> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import ServicePane from './service-pane.vue' |
|
|
import ServicePane from './service-pane.vue' |
|
|
|
|
|
import Credits from './credits.vue' |
|
|
import Loading from '../icons/loading.vue' |
|
|
import Loading from '../icons/loading.vue' |
|
|
|
|
|
|
|
|
function select(service) { |
|
|
function select(service) { |
|
@@ -64,7 +92,12 @@ function buyService() { |
|
|
if (!this.url) { |
|
|
if (!this.url) { |
|
|
document.getElementById('overlay-error').textContent = "You must provide a URL." |
|
|
document.getElementById('overlay-error').textContent = "You must provide a URL." |
|
|
return |
|
|
return |
|
|
|
|
|
} else if (Math.ceil(this.cost > this.credits)) { |
|
|
|
|
|
document.getElementById('overlay-error').textContent = |
|
|
|
|
|
'Insuficient Credits' |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.paying = true |
|
|
this.paying = true |
|
|
let note = '' |
|
|
let note = '' |
|
|
let country = document.getElementById('country') |
|
|
let country = document.getElementById('country') |
|
@@ -85,23 +118,38 @@ function buyService() { |
|
|
document.getElementById('overlay-error').textContent = `Success!` |
|
|
document.getElementById('overlay-error').textContent = `Success!` |
|
|
this.completed = true |
|
|
this.completed = true |
|
|
this.$emit('updateUser') |
|
|
this.$emit('updateUser') |
|
|
|
|
|
this.$emit('updateOrders') |
|
|
|
|
|
} else if (response.status == 520) { |
|
|
|
|
|
document.getElementById('overlay-error').textContent = |
|
|
|
|
|
'Insuficient Credits' |
|
|
} else { |
|
|
} else { |
|
|
document.getElementById('overlay-error').textContent = `Error |
|
|
document.getElementById('overlay-error').textContent = `Error |
|
|
${response.status}: ${response.statusText}` |
|
|
${response.status}: ${response.statusText}` |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.paying = false |
|
|
this.paying = false |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function page() { |
|
|
|
|
|
switch (this.active) { |
|
|
|
|
|
case '#new-order': |
|
|
|
|
|
return 'new-order' |
|
|
|
|
|
case '#credits': |
|
|
|
|
|
return 'credits' |
|
|
|
|
|
} |
|
|
|
|
|
console.log(this.active) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return {servicePane: true, services: null, selected: null, amount: 0, |
|
|
return {servicePane: true, services: null, selected: null, amount: 0, |
|
|
paying: false, url: '', completed: false} |
|
|
paying: false, url: '', completed: false} |
|
|
}, |
|
|
}, |
|
|
components: {ServicePane, Loading}, |
|
|
|
|
|
props: ['token', 'credits'], |
|
|
|
|
|
|
|
|
components: {ServicePane, Loading, Credits}, |
|
|
|
|
|
props: ['token', 'credits', 'active'], |
|
|
created() { |
|
|
created() { |
|
|
fetch("/panel/services", { |
|
|
fetch("/panel/services", { |
|
|
method: 'GET', |
|
|
method: 'GET', |
|
@@ -113,7 +161,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: {select, buyService}, |
|
|
methods: {select, buyService}, |
|
|
computed: {cost}, |
|
|
|
|
|
emits: ['updateUser'] |
|
|
|
|
|
|
|
|
computed: {cost, page}, |
|
|
|
|
|
emits: ['updateUser', 'updateOrders'] |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |