ConsultationModal.vue 10.0 KB

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