InvoiceThankyou.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <div class="InvoiceShow"
  3. :style="localOptions.style">
  4. <div class="row justify-center items-center">
  5. <div class="col-md-6 q-mt-lg">
  6. <q-card>
  7. <q-card-section class="text-center">
  8. <div v-if="$route.query.status === 'true'">
  9. پرداخت با موفقیت انجام شد
  10. </div>
  11. <div v-else>
  12. پرداخت نا موفق بود
  13. </div>
  14. <div>
  15. کد پیگیری:
  16. {{ $route.query.code }}
  17. </div>
  18. </q-card-section>
  19. </q-card>
  20. </div>
  21. </div>
  22. <div v-if="$route.query.invoice && !invoice.loading"
  23. class="row justify-center items-center">
  24. <div class="col-md-6 q-mt-lg">
  25. <invoice-show :options="{invoiceId: $route.query.invoice, invoice: invoice}" />
  26. </div>
  27. </div>
  28. <div v-if="invoice & !invoice.loading"
  29. class="flex justify-center q-mt-md">
  30. <q-btn v-if="invoice.type === 'CLASSROOM'"
  31. color="primary"
  32. :to="{name: 'UserPanel.Profile.AllClassrooms'}">
  33. مشاهده دوره های من
  34. </q-btn>
  35. <q-btn v-if="invoice.type === 'EVENT'"
  36. color="primary"
  37. :to="{name: 'UserPanel.Profile.AllEvents'}">
  38. مشاهده رویدادهای من
  39. </q-btn>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import { Invoice } from 'src/models/Invoice.js'
  45. import { mixinWidget } from 'src/mixin/Mixins.js'
  46. import { APIGateway } from 'src/api/APIGateway.js'
  47. import InvoiceShow from 'src/components/Widgets/Invoice/InvoiceShow/InvoiceShow.vue'
  48. export default {
  49. name: 'InvoiceThankyou',
  50. components: {
  51. InvoiceShow
  52. },
  53. mixins: [mixinWidget],
  54. data () {
  55. return {
  56. invoice: new Invoice()
  57. }
  58. },
  59. created() {
  60. this.invoice.loading = true
  61. },
  62. mounted() {
  63. if (this.$route.query.invoice) {
  64. this.getInvoice()
  65. }
  66. },
  67. methods: {
  68. getInvoice () {
  69. this.invoice.loading = true
  70. APIGateway.invoice.get({ data: { id: this.$route.query.invoice } })
  71. .then(invoice => {
  72. this.invoice = invoice
  73. this.invoice.loading = false
  74. })
  75. .catch(() => {
  76. this.invoice.loading = false
  77. })
  78. }
  79. }
  80. }
  81. </script>