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.

119 lines
3.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <modal name="delete-contact-modal" width="100%" :clickToClose="false">
  3. <div class="tw-p-[20px] md:tw-p-[30px] tw-overflow-auto">
  4. <div
  5. class="modal-header tw-flex tw-justify-between tw-w-full tw-items-center tw-mb-[30px]"
  6. >
  7. <div
  8. class="tw-grid tw-grid-cols-[24px_auto] tw-gap-[10px] tw-items-center tw-mr-[10px] md:tw-gap-[15px]"
  9. >
  10. <img src="~/assets/svg/deleteWarning.svg" alt="" />
  11. <div class="tw-text-[18px] tw-font-bold md:tw-text-[20px]">
  12. {{ $t("Delete Contact Info") }}
  13. </div>
  14. </div>
  15. <button
  16. class="close tw-transition tw-btn-md"
  17. @click="$modal.hide('delete-contact-modal')"
  18. ></button>
  19. </div>
  20. <div
  21. class="tw-text-[14px] tw-mb-[30px] md:tw-text-[16px] md:tw-mb-[40px]"
  22. >
  23. {{ `"${contactName}" ` + $t("will be removed in your list") }}
  24. </div>
  25. <div class="modal-footer tw-grid tw-grid-cols-2 tw-gap-[15px]">
  26. <button
  27. class="tw-bg-white tw-text-error-default tw-text-[16px] tw-rounded-[12px] tw-py-[10px] md:tw-text-[18px]"
  28. @click="$modal.hide('delete-contact-modal')"
  29. >
  30. {{ $t("Cancel") }}
  31. </button>
  32. <button
  33. class="tw-bg-error-default tw-text-white tw-text-[16px] tw-rounded-[12px] tw-py-[10px] md:tw-text-[18px]"
  34. @click="deleteContactInfo"
  35. >
  36. {{ $t("Delete") }}
  37. </button>
  38. </div>
  39. </div>
  40. </modal>
  41. </template>
  42. <script>
  43. export default {
  44. name: "delete-contact-modal",
  45. props: {
  46. contactId: {
  47. type: String,
  48. },
  49. contactName: {
  50. type: String,
  51. },
  52. },
  53. methods: {
  54. deleteContactInfo() {
  55. this.$axios
  56. .post(
  57. `/trending/api/Members/Contact?ContactID=${this.contactId}`
  58. )
  59. .then((response) => {
  60. console.log(JSON.stringify(response));
  61. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  62. let data = response.data.DATA.rel
  63. if(data){
  64. console.log("刪除成功");
  65. this.$modal.hide("delete-contact-modal");
  66. this.$emit("update");
  67. }
  68. }
  69. })
  70. .catch((error) => {
  71. console.log(error);
  72. });
  73. },
  74. },
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .close {
  79. // position: absolute;
  80. right: 30px;
  81. top: 32px;
  82. background-image: url("~/assets/svg/close.svg");
  83. background-position: center;
  84. background-repeat: no-repeat;
  85. background-size: cover;
  86. width: 14px;
  87. height: 14px;
  88. @media screen and (min-width: 768px) {
  89. right: 40px;
  90. top: 40px;
  91. }
  92. }
  93. .v--modal-overlay::v-deep {
  94. .v--modal {
  95. // max-width: 294px !important;
  96. width: fit-content !important;
  97. height: fit-content !important;
  98. border-radius: 16px;
  99. @media screen and (min-width: 768px) {
  100. width: fit-content !important;
  101. }
  102. }
  103. .v--modal-box {
  104. width: 294px !important;
  105. height: fit-content !important;
  106. @media screen and (min-width: 768px) {
  107. width: fit-content !important;
  108. }
  109. }
  110. .v--modal-background-click {
  111. display: flex;
  112. align-items: center;
  113. }
  114. }
  115. </style>