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.

102 lines
3.0 KiB

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="deleteAccountModal" width="100%" height="auto" :scrollable="true" :clickToClose="true">
  3. <div class="tw-bg-neutral-100 tw-w-full tw-p-[20px] tw-h-full tw-overflow-auto">
  4. <div class="modal-header tw-flex tw-justify-between tw-items-center tw-mb-[20px] md:tw-mb-[30px]">
  5. <div class="tw-text-[18px] tw-font-bold tw-leading-[26px]">
  6. {{ $t("userProfile.deleteAccount") }}
  7. </div>
  8. <button class="close tw-transition tw-btn-md" @click="$modal.hide('deleteAccountModal')"></button>
  9. </div>
  10. <div class="modal-content">
  11. <div class="tw-flex tw-flex-col tw-items-center">
  12. <img src="@/assets/svg/deleteAccount.svg" />
  13. <div class="tw-mt-[20px] tw-text-[14px] tw-text-neutrals-800 tw-break-words">
  14. {{$t('userProfile.deleteText')}}
  15. </div>
  16. </div>
  17. <div class="tw-mt-[20px] tw-grid tw-grid-cols-2 tw-gap-[20px] md:tw-mt-[30px]">
  18. <button @click="deleteAccount()"
  19. class="tw-text-[16px] tw-bg-white tw-text-error-default tw-w-full tw-py-[12px] tw-rounded-[16px] disabled:tw-text-base-disable">{{$t('userProfile.delete')}}</button>
  20. <button @click="$modal.hide('deleteAccountModal')"
  21. class="tw-text-[16px] tw-bg-primary-1 tw-text-white tw-w-full tw-py-[12px] tw-rounded-[16px]">{{$t('userProfile.keep')}}</button>
  22. </div>
  23. </div>
  24. </div>
  25. </modal>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. props: {
  32. userData:{},
  33. },
  34. };
  35. },
  36. methods: {
  37. deleteAccount() {
  38. this.$axios
  39. .get(
  40. `/trending/api/Members/DeactivateAccount`
  41. )
  42. .then((res) => {
  43. console.log(JSON.stringify(res));
  44. //this.$auth.$storage.removeUniversal("jwt");
  45. //this.$auth.$storage.removeUniversal("token");
  46. this.$auth.$storage.removeUniversal("authtoken");
  47. this.$auth.$storage.removeUniversal("userPicture");
  48. this.$auth.$storage.removeUniversal("userLastName");
  49. this.$auth.$storage.removeUniversal("userBeforePath");
  50. if (this.width < 1024) {
  51. this.$router.push(this.localePath("/"));
  52. } else {
  53. this.$router.push(this.localePath("/user"));
  54. }
  55. this.$auth.logout();
  56. this.$nuxt.refresh();
  57. this.UserInfoPopup = false;
  58. //window.location.href = "/user"
  59. })
  60. .catch((err) => {
  61. console.log(err);
  62. });
  63. }
  64. },
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .v--modal-overlay[data-modal="deleteAccountModal"]::v-deep() .v--modal-background-click {
  69. display: flex;
  70. justify-content: center;
  71. align-items: center;
  72. }
  73. :deep(.v--modal) {
  74. border-radius: 16px;
  75. max-width: 294px;
  76. min-height: max-content !important;
  77. }
  78. .close {
  79. background-image: url("~/assets/svg/close.svg");
  80. background-position: center;
  81. background-repeat: no-repeat;
  82. background-size: cover;
  83. width: 14px;
  84. height: 14px;
  85. }
  86. </style>