Examples of code I've written in PHP, Javascript, SCSS, etc.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
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>