You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

67 rivejä
1.3 KiB

  1. <template>
  2. <div class="qrview" >
  3. <VueQRCodeComponent
  4. v-if="!status || (status && status.valid)"
  5. class="qrcode"
  6. :text="token"
  7. color="#fff"
  8. bg-color="#000"
  9. />
  10. <div v-if="status && status.valid && status.anzeigename">
  11. {{status.anzeigename}}
  12. </div>
  13. <div v-if="status && !status.valid && status.reason">
  14. reservation {{ token }} from {{status.anzeigename}} is not valid<br>
  15. reason: {{status.reason }}
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import VueQRCodeComponent from 'vue-qrcode-component'
  21. export default {
  22. components: {
  23. VueQRCodeComponent
  24. },
  25. data() {
  26. return {
  27. status: null
  28. }
  29. },
  30. computed: {
  31. token () {
  32. return this.$route.params.token
  33. }
  34. },
  35. methods: {
  36. async getStatus () {
  37. const response = await fetch(`${process.env.VUE_APP_API_URL}guest/${this.token}`)
  38. const data = await response.json()
  39. this.status = data
  40. }
  41. },
  42. mounted () {
  43. this.getStatus()
  44. },
  45. }
  46. </script>
  47. <style>
  48. .qrview {
  49. display: flex;
  50. align-items: center;
  51. justify-content: center;
  52. flex-direction: column;
  53. min-height: 100vh;
  54. mix-blend-mode: difference;
  55. }
  56. .qrcode > img{
  57. /* padding: 100px; */
  58. /* background-color: #fff; */
  59. display: inline-flex;
  60. width: 400px;
  61. max-width: 80%;
  62. margin: 10%;
  63. }
  64. </style>