Examples of code I've written in PHP, Javascript, SCSS, etc.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

34 linhas
942 B

  1. <template>
  2. <div v-once id="main">
  3. <div v-if="active == '#transaction-complete' && user.paying" class="status-dialog">
  4. <img class="icon" src="../../images/checked2.svg" alt=""/>
  5. <h3>Purchase complete.</h3>
  6. </div>
  7. <div v-if="active == '#transaction-failed' && user.paying" class="status-dialog">
  8. <img class="icon" src="../../images/warning-colored.svg" alt=""/>
  9. <h3>Purchase failed.</h3>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. props: ['token', 'user', 'active'],
  16. emits: ['purchaseComplete'],
  17. //Should check that user is actualling in the paying state. If so, send get
  18. //request to panel/transaction-end. It's then() should emit a payment
  19. //complete to panel for a user state refresh.
  20. mounted() {
  21. fetch('/panel/clear-paying', {
  22. method: 'GET',
  23. headers: {'Content-Type': 'application/json',
  24. 'Accept': 'application/json',
  25. 'X-XSRF-TOKEN': this.token}}).then(() => this.$emit('purchaseComplete'))
  26. }
  27. }
  28. </script>