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.

147 lines
3.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <modal name="CancelBooking" :clickToClose="false">
  3. <div class="tw-text-base-primary">
  4. <div class="modal-header tw-flex tw-w-full tw-justify-between tw-mb-[20px]">
  5. <div class="t14 tw-font-bold tw-mr-[120px] md:tw-text-[20px] md:tw-mb-[10px]">
  6. {{ $t("Cancel Booking") }}
  7. </div>
  8. <button class="close tw-transition tw-btn-md" @click="$modal.hide('CancelBooking')"></button>
  9. </div>
  10. <div class="modal-content md:tw-items-center">
  11. <div class="t14 tw-mb-[20px] md:t16 md:mb-[15px]">
  12. {{ $t("Are you sure you want to cancel this booking?") }}
  13. </div>
  14. <div class="tw-flex tw-flex-row tw-items-start">
  15. <img src="@/assets/svg/Notice.svg" class="tw-mr-[6px] md:tw-mr-[12px]" />
  16. <div class="t12 tw-mb-[25px] tw-whitespace-normal tw-text-neutrals-400 md:t14 md:tw-mb-[40px]">
  17. {{ $t("ShowEasy customer service will contact you for the cancellation process,please wait patiently.") }}
  18. </div>
  19. </div>
  20. </div>
  21. <div class="modal-footer">
  22. <div class="tw-flex md:tw-justify-end">
  23. <button class="t14 tw-bg-[#FFFFFF] tw-text-primary-1 tw-rounded-[16px] tw-px-[45px] tw-py-[10px] tw-mr-[5px]">
  24. {{ $t("No") }}
  25. </button>
  26. <button class="t14 hover:tw-bg-primary-3 tw-bg-primary-1 tw-text-[#FFFFFF] tw-rounded-[16px] tw-px-[45px] tw-py-[10px]"
  27. @click="cancelBooking()"
  28. >
  29. {{ $t("Yes") }}
  30. </button>
  31. </div>
  32. </div>
  33. </div>
  34. </modal>
  35. </template>
  36. <script>
  37. export default {
  38. name: "CancelBooking",
  39. data() {
  40. return {
  41. };
  42. },
  43. props:{
  44. BookingOrder:{
  45. type: Object,
  46. },
  47. },
  48. methods: {
  49. cancelBooking(){
  50. this.$axios
  51. .post(
  52. `/trending/api/BookingOnline/CancelBooking?Lang=${this.$i18n.localeProperties["langQuery"]}&BookingID=${this.BookingOrder.BookingID}`
  53. )
  54. .then((response) => {
  55. console.log(JSON.stringify(response))
  56. if(response && response.data){
  57. this.$modal.hide('CancelBooking');
  58. window.location.href = '/user/booking/' + this.BookingOrder.BookingNo;
  59. }
  60. })
  61. .catch((error) => {
  62. console.log(error);
  63. });
  64. },
  65. }
  66. };
  67. </script>
  68. <style lang="scss" scoped>
  69. .close {
  70. position: absolute;
  71. right: 25px;
  72. top: 25px;
  73. background-image: url("~/assets/svg/close.svg");
  74. background-position: center;
  75. background-repeat: no-repeat;
  76. background-size: cover;
  77. width: 14px;
  78. height: 14px;
  79. @media (min-width: 1366px) {
  80. position: relative;
  81. right: initial;
  82. top: initial;
  83. }
  84. }
  85. :deep() {
  86. .v--modal {
  87. background-color: #f8f8f8 !important;
  88. text-align: left;
  89. border-radius: 16px;
  90. box-shadow: 0 20px 60px -2px rgb(27 33 58 / 40%);
  91. padding: 20px;
  92. max-width: max-content;
  93. top: 0 !important;
  94. left: 0 !important;
  95. right: 0 !important;
  96. margin: 0 auto;
  97. height: auto !important;
  98. vertical-align: middle;
  99. @media screen and (min-width: 768px) {
  100. padding: 30px;
  101. }
  102. }
  103. .v--modal-overlay {
  104. position: fixed;
  105. box-sizing: border-box;
  106. left: 0;
  107. top: 0;
  108. width: max-content;
  109. height: auto;
  110. background: rgba(0, 0, 0, 0.2);
  111. z-index: 999;
  112. opacity: 1;
  113. }
  114. .v--modal-top-right {
  115. display: block;
  116. position: fixed;
  117. right: 0;
  118. top: 0;
  119. }
  120. .v--modal-background-click {
  121. display: flex;
  122. justify-content: center;
  123. align-items: center;
  124. }
  125. .v--modal-box {
  126. margin-left: 60px;
  127. margin-right: 60px;
  128. @media (min-width: 768px) {
  129. margin-left: 67px;
  130. margin-right: 67px;
  131. }
  132. }
  133. }
  134. </style>