consultation-modal.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. formRef.value?.resetFields()
  178. formRef.value?.clearValidate()
  179. emit('update:modelValue', false)
  180. }
  181. const handleSubmit = async () => {
  182. if (!formRef.value) return
  183. await formRef.value.validate((valid) => {
  184. if (valid) {
  185. close()
  186. }
  187. })
  188. }
  189. </script>
  190. <style scoped lang="scss">
  191. .form-label {
  192. @apply font-s-16px text-#334155 mb-14px;
  193. @apply lt-sm:font-s-26px lt-sm:mb-14px;
  194. }
  195. /* Custom Input Styles to match design */
  196. :deep(.custom-input .el-input__wrapper) {
  197. @apply lt-sm:h-82px lt-sm:rounded-8px lt-sm:px-24px;
  198. height: 52px;
  199. border-radius: 4px;
  200. box-shadow: 0 0 0 1px #e2e8f0; /* border-gray-200 */
  201. padding: 0 16px;
  202. background-color: white;
  203. transition: all 0.2s;
  204. }
  205. :deep(.custom-input .el-input__wrapper:hover) {
  206. box-shadow: 0 0 0 1px #cbd5e1;
  207. }
  208. :deep(.custom-input .el-input__wrapper.is-focus) {
  209. box-shadow: 0 0 0 1px #0f67f8 !important; /* border-#0F67F8 */
  210. outline: 2px solid rgba(219, 234, 254, 0.5);
  211. }
  212. :deep(.custom-input .el-input__inner) {
  213. @apply h-52px lt-sm:h-82px;
  214. font-size: 14px;
  215. color: #0f172a;
  216. }
  217. :deep(.custom-textarea .el-textarea__inner) {
  218. @apply min-h-127px lt-sm:min-h-166px;
  219. @apply lt-sm:rounded-8px lt-sm:p-24px;
  220. border-radius: 4px;
  221. box-shadow: 0 0 0 1px #e2e8f0;
  222. padding: 12px 16px;
  223. font-size: 14px;
  224. color: #0f172a;
  225. transition: all 0.2s;
  226. }
  227. :deep(.custom-textarea .el-textarea__inner:focus) {
  228. box-shadow: 0 0 0 1px #0f67f8 !important;
  229. outline: 2px solid rgba(219, 234, 254, 0.5);
  230. }
  231. /* Custom Button Styles */
  232. .custom-button {
  233. background-color: #0f67f8;
  234. border: none;
  235. transition: background-color 0.2s;
  236. &:hover {
  237. background-color: #0a50ff;
  238. }
  239. }
  240. /* Remove default el-form-item margin-bottom to control gap via flex gap */
  241. :deep(.el-form-item) {
  242. margin-bottom: 0;
  243. }
  244. @keyframes zoomIn {
  245. from {
  246. opacity: 0;
  247. transform: scale(0.95);
  248. }
  249. to {
  250. opacity: 1;
  251. transform: scale(1);
  252. }
  253. }
  254. .animate-zoom-in {
  255. animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  256. }
  257. .right-info {
  258. background-image: url('@/assets/images/bg-4.png');
  259. background-size: 100% 100%;
  260. }
  261. </style>