baInformation.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <div class="ba-information">
  3. <div class="ba-information__content">
  4. <div class="page-header">
  5. <div class="page-title">完善个人信息</div>
  6. <div class="page-subtitle">请确保您的个人信息无误</div>
  7. </div>
  8. <div class="info-card">
  9. <div class="section-title">
  10. <span class="title-icon"></span>
  11. <span>基本信息</span>
  12. </div>
  13. <el-form
  14. ref="formRef"
  15. :model="form"
  16. :rules="rules"
  17. label-position="left"
  18. label-width="72px"
  19. class="info-form"
  20. require-asterisk-position="right"
  21. >
  22. <el-form-item label="姓名" prop="name">
  23. <el-input
  24. v-model="form.name"
  25. placeholder="请输入名字"
  26. maxlength="20"
  27. clearable
  28. />
  29. </el-form-item>
  30. <el-form-item label="手机号" prop="phone">
  31. <el-input
  32. v-model="form.phone"
  33. placeholder="请输入手机号"
  34. maxlength="11"
  35. clearable
  36. type="tel"
  37. />
  38. </el-form-item>
  39. </el-form>
  40. <div class="location-block">
  41. <div class="location-label">常驻点位</div>
  42. <div class="map-placeholder">
  43. <div class="map-placeholder__mask">点击地图选择常驻点位</div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="custom-bottom-fixed-btns">
  49. <div class="bottom-btn primary-btn" @click="handleNext">下一步 (1/3)</div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. import { reactive, ref } from "vue";
  55. const emit = defineEmits(["next"]);
  56. const formRef = ref(null);
  57. const form = reactive({
  58. name: "",
  59. phone: "",
  60. });
  61. const rules = {
  62. name: [
  63. { required: true, message: "请输入名字", trigger: "blur" },
  64. { min: 1, max: 20, message: "姓名长度不超过20个字", trigger: "blur" },
  65. ],
  66. phone: [
  67. { required: true, message: "请输入手机号", trigger: "blur" },
  68. {
  69. pattern: /^1[3-9]\d{9}$/,
  70. message: "请输入正确的手机号码",
  71. trigger: "blur",
  72. },
  73. ],
  74. };
  75. const handleNext = async () => {
  76. if (!formRef.value) return;
  77. try {
  78. await formRef.value.validate();
  79. emit("next", { ...form });
  80. } catch {
  81. // 校验未通过
  82. }
  83. };
  84. </script>
  85. <style lang="scss" scoped>
  86. .ba-information {
  87. flex: 1;
  88. display: flex;
  89. flex-direction: column;
  90. overflow: hidden;
  91. padding-bottom: 80px;
  92. &__content {
  93. flex: 1;
  94. overflow-y: auto;
  95. padding: 8px 16px 20px;
  96. }
  97. .page-header {
  98. padding: 8px 4px 16px;
  99. .page-title {
  100. font-size: 26px;
  101. color: #005599;
  102. font-family: "PangMenZhengDao";
  103. line-height: 36px;
  104. }
  105. .page-subtitle {
  106. margin-top: 4px;
  107. font-size: 14px;
  108. color: rgba(46, 46, 46, 0.4);
  109. line-height: 20px;
  110. }
  111. }
  112. .info-card {
  113. background: #fff;
  114. border-radius: 12px;
  115. padding: 16px 14px 8px;
  116. box-shadow: 0 2px 12px rgba(33, 153, 248, 0.08);
  117. }
  118. .section-title {
  119. display: flex;
  120. align-items: center;
  121. gap: 8px;
  122. margin-bottom: 8px;
  123. font-size: 16px;
  124. font-weight: 600;
  125. color: #1a1a1a;
  126. .title-icon {
  127. position: relative;
  128. width: 14px;
  129. height: 14px;
  130. flex-shrink: 0;
  131. &::before,
  132. &::after {
  133. content: "";
  134. position: absolute;
  135. width: 10px;
  136. height: 10px;
  137. border-radius: 50%;
  138. }
  139. &::before {
  140. left: 0;
  141. top: 2px;
  142. background: #2199f8;
  143. opacity: 0.85;
  144. }
  145. &::after {
  146. right: 0;
  147. top: 0;
  148. background: #7ec8ff;
  149. opacity: 0.9;
  150. }
  151. }
  152. }
  153. .info-form {
  154. :deep(.el-form-item) {
  155. margin-bottom: 0;
  156. padding: 10px 0;
  157. }
  158. :deep(.el-form-item__label) {
  159. color: #1a1a1a;
  160. font-size: 15px;
  161. font-weight: 400;
  162. padding: 0;
  163. line-height: 32px;
  164. height: 32px;
  165. }
  166. :deep(.el-form-item__content) {
  167. justify-content: flex-end;
  168. line-height: 32px;
  169. }
  170. :deep(.el-form-item__error) {
  171. padding-top: 4px;
  172. text-align: right;
  173. }
  174. :deep(.el-input__wrapper) {
  175. box-shadow: none;
  176. background: transparent;
  177. padding: 0;
  178. .el-input__inner {
  179. text-align: right;
  180. color: #1a1a1a;
  181. font-size: 15px;
  182. &::placeholder {
  183. color: rgba(0, 0, 0, 0.25);
  184. }
  185. }
  186. }
  187. }
  188. .location-block {
  189. padding: 10px 0 8px;
  190. .location-label {
  191. font-size: 15px;
  192. color: #1a1a1a;
  193. margin-bottom: 10px;
  194. }
  195. .map-placeholder {
  196. position: relative;
  197. width: 100%;
  198. height: 140px;
  199. border-radius: 8px;
  200. overflow: hidden;
  201. background: linear-gradient(135deg, #e8eef3 0%, #d4dde6 100%);
  202. &__mask {
  203. position: absolute;
  204. left: 0;
  205. right: 0;
  206. top: 0;
  207. padding: 8px 12px;
  208. background: rgba(0, 0, 0, 0.45);
  209. color: #fff;
  210. font-size: 13px;
  211. text-align: center;
  212. }
  213. }
  214. }
  215. .custom-bottom-fixed-btns {
  216. background: #FFF;
  217. box-shadow: 2px 2px 5px 0px rgba(0, 0, 0, 0.4);
  218. .bottom-btn {
  219. // flex: 1;
  220. padding: 0 30px;
  221. height: 40px;
  222. line-height: 40px;
  223. font-size: 16px;
  224. border-radius: 25px;
  225. }
  226. .primary-btn {
  227. background: #2199f8;
  228. color: #fff;
  229. }
  230. }
  231. }
  232. </style>