ConsultationModal.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <Transition
  3. enter-active-class="transition duration-300 ease-out"
  4. enter-from-class="opacity-0"
  5. enter-to-class="opacity-100"
  6. leave-active-class="transition duration-200 ease-in"
  7. leave-from-class="opacity-100"
  8. leave-to-class="opacity-0"
  9. >
  10. <div
  11. v-if="modelValue"
  12. class="fixed inset-0 z-[999] flex items-center justify-center bg-black/50 backdrop-blur-sm"
  13. @click.self="close"
  14. >
  15. <div
  16. class="relative w-1200px bg-white rounded-8px shadow-2xl overflow-hidden animate-zoom-in"
  17. >
  18. <!-- Close Button -->
  19. <i
  20. class="i-ep-close wh-22px font-semibold absolute top-20px right-20px text-gray-500 cursor-pointer"
  21. @click="close"
  22. ></i>
  23. <div class="py-46px px-36px">
  24. <!-- Header -->
  25. <div class="text-center mb-45px">
  26. <div class="font-s-36px pf-sc-semibold text-#000000 mb-4px">
  27. 开启您的智慧社区转型之旅
  28. </div>
  29. <div class="font-s-16px text-#091221/70 lh-30px pf-sc-regular">
  30. 提交您的需求,我们的专属顾问将在24小时内为您提供定制化解决方案
  31. </div>
  32. </div>
  33. <div class="flex gap-60px">
  34. <!-- Left Form -->
  35. <div class="flex-1">
  36. <el-form
  37. ref="formRef"
  38. :model="form"
  39. :rules="rules"
  40. label-position="top"
  41. class="flex flex-col gap-24px"
  42. :hide-required-asterisk="true"
  43. @submit.prevent="handleSubmit"
  44. >
  45. <!-- Name -->
  46. <el-form-item prop="name" class="custom-form-item">
  47. <template #label>
  48. <span class="form-label">
  49. 您的称谓
  50. <span class="text-red-500">*</span>
  51. </span>
  52. </template>
  53. <div class="flex gap-28px w-full">
  54. <el-input
  55. v-model="form.name"
  56. placeholder="请输入您的称谓"
  57. class="custom-input flex-1"
  58. />
  59. <el-radio-group v-model="form.gender" class="shrink-0 flex-1">
  60. <el-radio value="mr">先生</el-radio>
  61. <el-radio value="ms">女士</el-radio>
  62. </el-radio-group>
  63. </div>
  64. </el-form-item>
  65. <!-- Phone -->
  66. <el-form-item prop="phone" class="custom-form-item">
  67. <template #label>
  68. <span class="form-label">
  69. 手机号码
  70. <span class="text-red-500">*</span>
  71. </span>
  72. </template>
  73. <el-input
  74. v-model="form.phone"
  75. placeholder="请输入您的手机号码"
  76. class="custom-input w-full"
  77. />
  78. </el-form-item>
  79. <!-- Company/Address -->
  80. <el-form-item prop="company" class="custom-form-item">
  81. <template #label>
  82. <span class="form-label">
  83. 公司名称或项目地址
  84. <span class="text-red-500">*</span>
  85. </span>
  86. </template>
  87. <el-input
  88. v-model="form.company"
  89. placeholder="请输入公司名称或项目地址"
  90. class="custom-input w-full"
  91. />
  92. </el-form-item>
  93. <!-- Description -->
  94. <el-form-item prop="desc" class="custom-form-item">
  95. <el-input
  96. v-model="form.desc"
  97. type="textarea"
  98. placeholder="简要描述您的需求 (可选)"
  99. class="custom-textarea w-full"
  100. :rows="3"
  101. resize="none"
  102. />
  103. </el-form-item>
  104. <!-- Submit Button -->
  105. <button
  106. v-loading="loading"
  107. class="mt-56px h-48px! w-268px! bg-#0F67F8 text-white pf-sc-regular rounded-8px px-16px flex items-center justify-between hover:opacity-80"
  108. @click="handleSubmit"
  109. >
  110. <span class="font-s-16px">立即咨询</span>
  111. <i class="i-custom-arrow-right wh-18px"></i>
  112. </button>
  113. </el-form>
  114. </div>
  115. <!-- Right Info -->
  116. <div class="w-390px rounded-8px p-40px flex flex-col overflow-hidden right-info">
  117. <div class="relative flex flex-col items-start">
  118. <div class="wh-40px bg-white rounded-10px flex-center">
  119. <i class="i-custom-phone wh-23px"></i>
  120. </div>
  121. <div class="mt-14px font-s-16px text-#091221/70">
  122. 即刻拨打400官方热线,7x24h为您服务
  123. </div>
  124. <div class="font-s-40px text-#0F67F8 d-din-pro-700-bold">400-600-7709</div>
  125. </div>
  126. <!-- QR Code Section -->
  127. <div class="relative mt-48px flex flex-col gap-13px">
  128. <div class="wh-40px bg-white rounded-10px flex-center">
  129. <i class="i-custom-message wh-28px"></i>
  130. </div>
  131. <div class="font-s-16px text-#091221/70 pf-sc-regular">
  132. 微信扫码添加“绘家科技”企业微信
  133. </div>
  134. <div class="text-#0F67F8 font-s-28px">一对一专人服务</div>
  135. <i class="i-custom-qrcode wh-136px"></i>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </Transition>
  143. </template>
  144. <script setup lang="ts">
  145. import type { FormInstance, FormRules } from 'element-plus'
  146. const props = defineProps<{
  147. modelValue: boolean
  148. }>()
  149. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  150. const _ = props
  151. const emit = defineEmits<{
  152. (e: 'update:modelValue', value: boolean): void
  153. }>()
  154. const formRef = ref<FormInstance>()
  155. const loading = ref(false)
  156. const form = reactive({
  157. name: '',
  158. gender: 'mr',
  159. phone: '',
  160. company: '',
  161. desc: '',
  162. })
  163. const rules = reactive<FormRules>({
  164. name: [{ required: true, message: '请输入您的称谓', trigger: 'blur' }],
  165. phone: [{ required: true, message: '请输入您的手机号码', trigger: 'blur' }],
  166. company: [{ required: true, message: '请输入公司名称或项目地址', trigger: 'blur' }],
  167. })
  168. const close = () => {
  169. emit('update:modelValue', false)
  170. }
  171. const handleSubmit = async () => {
  172. if (!formRef.value) return
  173. await formRef.value.validate((valid) => {
  174. if (valid) {
  175. loading.value = true
  176. // TODO: Implement submission logic
  177. setTimeout(() => {
  178. console.log('Form submitted:', form)
  179. ElMessage.success('需求已提交,我们会尽快联系您!')
  180. loading.value = false
  181. close()
  182. }, 1000)
  183. }
  184. })
  185. }
  186. </script>
  187. <style scoped lang="scss">
  188. .form-label {
  189. @apply font-s-16px text-#334155 mb-14px;
  190. }
  191. /* Custom Input Styles to match design */
  192. :deep(.custom-input .el-input__wrapper) {
  193. height: 52px;
  194. border-radius: 4px;
  195. box-shadow: 0 0 0 1px #e2e8f0; /* border-gray-200 */
  196. padding: 0 16px;
  197. background-color: white;
  198. transition: all 0.2s;
  199. }
  200. :deep(.custom-input .el-input__wrapper:hover) {
  201. box-shadow: 0 0 0 1px #cbd5e1;
  202. }
  203. :deep(.custom-input .el-input__wrapper.is-focus) {
  204. box-shadow: 0 0 0 1px #0f67f8 !important; /* border-#0F67F8 */
  205. // ring-2 ring-blue-100 simulation
  206. outline: 2px solid rgba(219, 234, 254, 0.5);
  207. }
  208. :deep(.custom-input .el-input__inner) {
  209. @apply h-52px!;
  210. font-size: 14px;
  211. color: #0f172a;
  212. }
  213. :deep(.custom-textarea .el-textarea__inner) {
  214. @apply min-h-127px!;
  215. border-radius: 4px;
  216. box-shadow: 0 0 0 1px #e2e8f0;
  217. padding: 12px 16px;
  218. font-size: 14px;
  219. color: #0f172a;
  220. transition: all 0.2s;
  221. }
  222. :deep(.custom-textarea .el-textarea__inner:focus) {
  223. box-shadow: 0 0 0 1px #0f67f8 !important;
  224. outline: 2px solid rgba(219, 234, 254, 0.5);
  225. }
  226. /* Custom Button Styles */
  227. .custom-button {
  228. background-color: #0f67f8;
  229. border: none;
  230. transition: background-color 0.2s;
  231. &:hover {
  232. background-color: #0a50ff;
  233. }
  234. }
  235. /* Remove default el-form-item margin-bottom to control gap via flex gap */
  236. :deep(.el-form-item) {
  237. margin-bottom: 0;
  238. }
  239. @keyframes zoomIn {
  240. from {
  241. opacity: 0;
  242. transform: scale(0.95);
  243. }
  244. to {
  245. opacity: 1;
  246. transform: scale(1);
  247. }
  248. }
  249. .animate-zoom-in {
  250. animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  251. }
  252. .right-info {
  253. background-image: url('@/assets/images/bg-4.png');
  254. background-size: 100% 100%;
  255. }
  256. </style>