diff --git a/client/src/App.vue b/client/src/App.vue index e54f6b9..b218105 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -24,7 +24,7 @@
diff --git a/client/src/components/CustomSelect.vue b/client/src/components/CustomSelect.vue index 1318d40..6b97b9f 100644 --- a/client/src/components/CustomSelect.vue +++ b/client/src/components/CustomSelect.vue @@ -137,12 +137,12 @@ onUnmounted(() => { .dropdown-options { z-index: 99999999999999999999; - background: rgba(255, 255, 255, 0.08); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - border: 1px solid rgba(255, 255, 255, 0.08); + background: rgba(12, 12, 14, 0.72); + backdrop-filter: blur(24px); + -webkit-backdrop-filter: blur(24px); + border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 0.5rem; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); max-height: 200px; overflow-y: auto; } @@ -157,7 +157,7 @@ onUnmounted(() => { } .option-item:hover { - background: rgba(212, 179, 131, 0.1); + background: rgba(212, 179, 131, 0.15); color: #d4b383; } diff --git a/client/src/components/InquiryModal.vue b/client/src/components/InquiryModal.vue index 9abe88b..15f8dc1 100644 --- a/client/src/components/InquiryModal.vue +++ b/client/src/components/InquiryModal.vue @@ -1,169 +1,166 @@ @@ -173,6 +170,7 @@ import RadioGroup from './ui/RadioGroup.vue' import EmailAutocomplete from './ui/EmailAutocomplete.vue' import { submitInquiry } from '../services/api' +const isOpen = ref(false) const isSubmitting = ref(false) const formData = ref({ @@ -199,27 +197,25 @@ const getContactLabel = computed(() => { }) const openModal = () => { - const modal = document.getElementById('inquiry-modal') - if (modal) { - modal.classList.remove('hidden') - modal.classList.add('flex') - document.body.style.overflow = 'hidden' - } + isOpen.value = true + document.body.style.overflow = 'hidden' } const closeModal = () => { - const modal = document.getElementById('inquiry-modal') - if (modal) { - modal.classList.remove('flex') - modal.classList.add('hidden') - document.body.style.overflow = '' + isOpen.value = false + document.body.style.overflow = '' +} + +const handleEscape = (event: KeyboardEvent) => { + if (event.key === 'Escape' && isOpen.value) { + closeModal() } } const handleSubmit = async () => { if (isSubmitting.value) return isSubmitting.value = true - + try { await submitInquiry({ name: formData.value.name, @@ -229,10 +225,9 @@ const handleSubmit = async () => { budget: formData.value.budget, description: formData.value.description }) - + closeModal() showToast('合作咨询已发送,我们会尽快与您联系!') - // Reset form formData.value = { name: '', company: '', @@ -273,18 +268,42 @@ const showToast = (message: string, type: string = 'success') => { } } -// 暴露方法给全局使用 onMounted(() => { if (typeof window !== 'undefined') { - (window as any).openInquiry = openModal; - (window as any).closeInquiry = closeModal; + ;(window as any).openInquiry = openModal + ;(window as any).closeInquiry = closeModal } + document.addEventListener('keydown', handleEscape) }) onUnmounted(() => { if (typeof window !== 'undefined') { - delete (window as any).openInquiry; - delete (window as any).closeInquiry; + delete (window as any).openInquiry + delete (window as any).closeInquiry } + document.removeEventListener('keydown', handleEscape) + document.body.style.overflow = '' }) - \ No newline at end of file + + + diff --git a/client/src/components/SnippetModal.vue b/client/src/components/SnippetModal.vue index cda3b93..56468c0 100644 --- a/client/src/components/SnippetModal.vue +++ b/client/src/components/SnippetModal.vue @@ -2,42 +2,165 @@
-
-
- - {{ title }} +
+
+
-
+ +
+ 关联文章 + + {{ p.title }} ↗ + +
+ + +
+ +
-
-
- -
{{ code }}
+
+ +
+
+ +
+
+
{{ code }}
+
-
+ +
+ + +
+ +
+