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.

144 lines
3.8 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
  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. </div>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import TwoDots from "@/components/TwoDots";
  46. import bookingListContent from "@/components/user/bookingListContent.vue";
  47. import userSidebar from "@/components/user/userSidebar.vue";
  48. import userSearchBar from "@/components/user/userSearchBar.vue";
  49. export default {
  50. name: "myBooking",
  51. layout: "profile_gray",
  52. components: {
  53. TwoDots,
  54. bookingListContent,
  55. userSidebar,
  56. userSearchBar
  57. },
  58. data() {
  59. return {
  60. firstName: "",
  61. lastName: "",
  62. userData: {},
  63. width: 0,
  64. youMightLikeList: [],
  65. countrycode: [],
  66. regionName: [],
  67. searchValue: "",
  68. searchQuery: "",
  69. };
  70. },
  71. created() {
  72. this.fetchUserData();
  73. if (process.browser) {
  74. window.addEventListener("resize", this.handleResize);
  75. }
  76. this.handleResize();
  77. },
  78. mounted() {
  79. this.$nextTick(() => {
  80. window.addEventListener("resize", this.onResize);
  81. });
  82. },
  83. destroyed() {
  84. if (process.browser) {
  85. window.removeEventListener("resize", this.handleResize);
  86. }
  87. },
  88. methods: {
  89. //Get Member Info
  90. fetchUserData() {
  91. this.$axios
  92. .get(
  93. `/trending/api/Members/Info`
  94. )
  95. .then((response) => {
  96. //console.log(JSON.stringify(response));
  97. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  98. let data = response.data.DATA.rel
  99. if(data){
  100. this.userData = data;
  101. this.firstName = this.userData.FirstName;
  102. this.lastName = this.userData.LastName;
  103. }
  104. }
  105. })
  106. .catch((error) => {
  107. console.log(error);
  108. });
  109. },
  110. logout() {
  111. this.$auth.$storage.removeUniversal("jwt");
  112. this.$auth.$storage.removeUniversal("userPicture");
  113. this.$auth.$storage.removeUniversal("userLastName");
  114. this.$auth.$storage.removeUniversal("userBeforePath");
  115. if (width < 1024) {
  116. this.$router.push(this.localePath("/"));
  117. } else {
  118. this.$router.push(this.localePath("/user"));
  119. }
  120. this.$auth.logout();
  121. },
  122. handleResize() {
  123. if (process.browser) {
  124. this.width = window.innerWidth;
  125. }
  126. },
  127. // query(value){
  128. // this.searchValue = value;
  129. // },
  130. change(value){
  131. this.searchValue = value;
  132. console.log("shitValue:" + this.searchValue);
  133. }
  134. },
  135. };
  136. </script>
  137. <style scoped lang="scss"></style>