ConsultationModal.vue 9.7 KB

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