|
|
@@ -13,12 +13,13 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="credits-pane"><div><h2>1000 Credits</h2><span>+150 Free Credits</span></div> |
|
|
|
<h3>$1010</h3> <div><span>Qty</span><input min="0" max="1000" v-model="packs.credits1000" type="number"></div> |
|
|
|
<h3>$1010.00</h3> <div><span>Qty</span><input min="0" max="1000" v-model="packs.credits1000" type="number"></div> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
|
|
|
|
<section class="credits-confirm"> |
|
|
|
<h3>Total: ${{total.toLocaleString('en')}}</h3> |
|
|
|
<button class="brand-btn">Continue</button> |
|
|
|
|
|
|
|
<button @click="getSecret" :disabled="total == 0 || loading" class="brand-btn">Continue</button> |
|
|
|
</section> |
|
|
|
</template> |
|
|
|
|
|
|
@@ -29,11 +30,32 @@ function total() { |
|
|
|
+ this.packs.credits100*109.99 + this.packs.credits1000*1010 |
|
|
|
} |
|
|
|
|
|
|
|
function getSecret() { |
|
|
|
fetch('/panel/secret', { |
|
|
|
method: 'POST', |
|
|
|
headers: {'Content-Type': 'application/json', |
|
|
|
'Accept': 'application/json', |
|
|
|
'X-XSRF-TOKEN': this.token}, |
|
|
|
body: JSON.stringify({'packs': this.packs}) |
|
|
|
}).then((response) => { |
|
|
|
if (response.ok) { |
|
|
|
return response.text() |
|
|
|
} else { |
|
|
|
//handle errors here |
|
|
|
console.log('an error occured') |
|
|
|
} |
|
|
|
}).then(data => { |
|
|
|
console.log(data) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return {packs: {credits10: 0, credits50: 0, |
|
|
|
credits100: 0, credits1000: 0}} |
|
|
|
credits100: 0, credits1000: 0}, loading: false} |
|
|
|
}, |
|
|
|
computed: {total} |
|
|
|
computed: {total}, |
|
|
|
methods: {getSecret}, |
|
|
|
props: ['token'] |
|
|
|
} |
|
|
|
</script> |