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.

150 lines
4.0 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
2 years ago
2 years ago
2 years ago
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. <div class="myBooking xl:tw-max-w-[1246px] xl:tw-mx-auto">
  3. <div class="xl:tw-flex xl:tw-justify-between xl:tw-items-start">
  4. <userSidebar
  5. :userData="userData"
  6. :firstName="firstName"
  7. :lastName="lastName"
  8. class="tw-hidden xl:tw-block"
  9. >
  10. </userSidebar>
  11. <!-- <div class="xl:tw-hidden"></div> -->
  12. <div
  13. class="tw-bg-transparent xl:tw-bg-white xl:tw-p-[30px] xl:tw-rounded-[20px] xl:tw-min-w-[900px] xl:tw-max-w-[900px]"
  14. >
  15. <div
  16. class="tw-flex tw-flex-col md:tw-flex-row md:tw-justify-between md:tw-items-center tw-mb-[20px] md:tw-mb-[34px]"
  17. >
  18. <div
  19. class="tw-text-[20px] tw-font-bold tw-text-base-primary tw-mb-[20px] md:t24 md:tw-mb-0"
  20. >
  21. <two-dots class="tw-mr-[30px]"></two-dots>{{ $t("My Bookings") }}
  22. </div>
  23. <div class="tw-w-full md:tw-max-w-[320px]">
  24. <userSearchBar
  25. :input="{
  26. id: 'searchQuery',
  27. placeHolder: $t('Enter exhibitions, booking number ...'),
  28. type: 'text',
  29. }"
  30. :default="searchQuery"
  31. @search="change"
  32. ></userSearchBar>
  33. </div>
  34. </div>
  35. <bookingListContent
  36. :searchValue="searchValue"
  37. :width="width"
  38. :userData="userData"
  39. ></bookingListContent>
  40. <loading :isLoading="isPageLoading"></loading>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. import TwoDots from "@/components/TwoDots";
  47. import bookingListContent from "@/components/user/bookingListContent.vue";
  48. import userSidebar from "@/components/user/userSidebar.vue";
  49. import userSearchBar from "@/components/user/userSearchBar.vue";
  50. import loading from "@/components/newComponent/loading/loading.vue";
  51. export default {
  52. name: "myBooking",
  53. layout: "profile_gray",
  54. components: {
  55. TwoDots,
  56. bookingListContent,
  57. userSidebar,
  58. userSearchBar,
  59. loading
  60. },
  61. data() {
  62. return {
  63. firstName: "",
  64. lastName: "",
  65. userData: {},
  66. width: 0,
  67. youMightLikeList: [],
  68. countrycode: [],
  69. regionName: [],
  70. searchValue: "",
  71. searchQuery: "",
  72. isPageLoading: false,
  73. };
  74. },
  75. created() {
  76. this.isPageLoading = true;
  77. this.fetchUserData();
  78. if (process.browser) {
  79. window.addEventListener("resize", this.handleResize);
  80. }
  81. this.handleResize();
  82. this.$nextTick(()=>{
  83. this.isPageLoading = false;
  84. });
  85. },
  86. mounted() {
  87. this.$nextTick(() => {
  88. window.addEventListener("resize", this.onResize);
  89. });
  90. },
  91. destroyed() {
  92. if (process.browser) {
  93. window.removeEventListener("resize", this.handleResize);
  94. }
  95. },
  96. methods: {
  97. //Get Member Info
  98. fetchUserData() {
  99. this.$axios
  100. .get(
  101. `/trending/api/Members/Info`
  102. )
  103. .then((response) => {
  104. //console.log(JSON.stringify(response));
  105. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  106. let data = response.data.DATA.rel
  107. if(data){
  108. this.userData = data;
  109. this.firstName = this.userData.FirstName;
  110. this.lastName = this.userData.LastName;
  111. }
  112. }
  113. })
  114. .catch((error) => {
  115. console.log(error);
  116. });
  117. },
  118. logout() {
  119. this.$auth.$storage.removeUniversal("jwt");
  120. this.$auth.$storage.removeUniversal("userPicture");
  121. this.$auth.$storage.removeUniversal("userLastName");
  122. this.$auth.$storage.removeUniversal("userBeforePath");
  123. if (width < 1024) {
  124. this.$router.push(this.localePath("/"));
  125. } else {
  126. this.$router.push(this.localePath("/user"));
  127. }
  128. this.$auth.logout();
  129. },
  130. handleResize() {
  131. if (process.browser) {
  132. this.width = window.innerWidth;
  133. }
  134. },
  135. // query(value){
  136. // this.searchValue = value;
  137. // },
  138. change(value){
  139. this.searchValue = value;
  140. }
  141. },
  142. };
  143. </script>
  144. <style scoped lang="scss"></style>