index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. <template>
  2. <view class="interview-container">
  3. <!-- 职位列表 -->
  4. <view class="job-list-container" v-if="!userInfoFilled">
  5. <view class="job-list-title">可选职位列表</view>
  6. <view class="job-list">
  7. <view v-for="(job, index) in jobList" :key="index" class="job-item"
  8. :class="{'job-selected': selectedJobId === job.id}" @click="selectJob(job)">
  9. <view class="job-name">{{job.title}}</view>
  10. <view class="job-details">
  11. <text class="job-salary">{{job.publish_date}}</text>
  12. <text class="job-location">{{job.location}}</text>
  13. </view>
  14. </view>
  15. </view>
  16. <button class="apply-btn" :disabled="!selectedJobId" @click="applyForJob">申请面试</button>
  17. </view>
  18. <!-- 表单信息 -->
  19. <view class="form-container" v-if="userInfoFilled">
  20. <view class="form-title">请完成验证信息填写</view>
  21. <view class="form-item phone-item">
  22. <view class="country-code">
  23. <text>+86</text>
  24. <!-- <text class="dropdown-icon">▼</text> -->
  25. </view>
  26. <input type="number" v-model="formData.phone" placeholder="请输入手机号" maxlength="11" @input="validatePhone" />
  27. <view class="validation-icon" v-if="formData.phone">
  28. <text class="icon-success" v-if="isPhoneValid">✓</text>
  29. <text class="icon-error" v-else>✗</text>
  30. </view>
  31. </view>
  32. <view class="form-item">
  33. <input type="text" v-model="formData.name" placeholder="请输入姓名" @input="validateName" />
  34. <view class="validation-icon" v-if="formData.name">
  35. <text class="icon-success" v-if="isNameValid">✓</text>
  36. <text class="icon-error" v-else>✗</text>
  37. </view>
  38. </view>
  39. <view class="form-item">
  40. <input type="text" v-model="formData.idCard" placeholder="请输入身份证号" maxlength="18" @input="validateIdCard" />
  41. <view class="validation-icon" v-if="formData.idCard">
  42. <text class="icon-success" v-if="isIdCardValid">✓</text>
  43. <text class="icon-error" v-else>✗</text>
  44. </view>
  45. </view>
  46. <!-- 添加性别选择 -->
  47. <view class="form-item">
  48. <picker @change="genderChange" :value="genderIndex" :range="genderOptions">
  49. <view class="picker-input">
  50. <input type="text" disabled placeholder="请选择性别" :value="formData.gender" />
  51. <view class="dropdown-icon">▼</view>
  52. </view>
  53. </picker>
  54. </view>
  55. <button class="verify-btn" :disabled="!canSubmitSimple" @click="submitForm">确认面试</button>
  56. <view class="agreement">
  57. <checkbox :checked="isAgreed" @tap="toggleAgreement" color="#0039b3" />
  58. <text class="agreement-text">
  59. 我已阅读并同意<text class="agreement-link">《用户协议》</text>和<text class="agreement-link">《隐私政策》</text>
  60. </text>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import { apiBaseUrl } from '@/common/config.js';
  67. import {
  68. fillUserInfo,
  69. getUserInfo,
  70. getJobList,
  71. applyJob
  72. } from '@/api/user';
  73. export default {
  74. data() {
  75. return {
  76. formData: {
  77. name: '',
  78. gender: '',
  79. phone: '',
  80. email: '',
  81. idCard: '',
  82. emergencyContact: '',
  83. emergencyPhone: '',
  84. relation: ''
  85. },
  86. relationOptions: ['父母', '配偶', '子女', '兄弟姐妹', '朋友', '其他'],
  87. relationIndex: 0,
  88. isAgreed: false,
  89. userInfoFilled: false,
  90. jobList: [],
  91. selectedJobId: null,
  92. selectedJob: null,
  93. isPhoneValid: false,
  94. isNameValid: false,
  95. isIdCardValid: false,
  96. genderOptions: ['男', '女'],
  97. genderIndex: 0,
  98. genderMapping: {
  99. '男': '1',
  100. '女': '2',
  101. '1': '男',
  102. '2': '女'
  103. }
  104. }
  105. },
  106. onLoad(options) {
  107. console.log('options:', options);
  108. if (options.scene) {
  109. // 对scene进行解码
  110. const scene = decodeURIComponent(options.scene);
  111. console.log('解码后的scene:', scene);
  112. // 如果scene是key1=val1&key2=val2格式
  113. const sceneParams = {};
  114. scene.split('&').forEach(pair => {
  115. const [key, value] = pair.split('=');
  116. sceneParams[key] = value;
  117. });
  118. console.log('解析后的参数:', sceneParams);
  119. }
  120. this.checkUserInfo();
  121. this.fetchJobList();
  122. },
  123. computed: {
  124. canSubmit() {
  125. return this.formData.name.trim() &&
  126. this.formData.gender &&
  127. this.formData.phone.trim() &&
  128. (/^1\d{10}$/.test(this.formData.phone)) &&
  129. (!this.formData.email || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(this.formData.email)) &&
  130. this.formData.idCard.trim() &&
  131. this.formData.emergencyContact.trim() &&
  132. this.formData.emergencyPhone.trim() &&
  133. (/^1\d{10}$/.test(this.formData.emergencyPhone)) &&
  134. this.formData.relation &&
  135. this.isAgreed;
  136. },
  137. canSubmitSimple() {
  138. return this.formData.name.trim() &&
  139. this.formData.phone.trim() &&
  140. this.isPhoneValid &&
  141. this.formData.idCard.trim() &&
  142. this.isIdCardValid &&
  143. this.isAgreed;
  144. }
  145. },
  146. methods: {
  147. checkLogin() {
  148. const userInfo = uni.getStorageSync('userInfo');
  149. if (!userInfo) {
  150. // 未登录时跳转到身份验证登录页面
  151. uni.reLaunch({
  152. url: '/pages/login/login',
  153. success: () => {
  154. console.log('跳转到身份验证登录页面成功');
  155. },
  156. fail: (err) => {
  157. console.error('跳转到身份验证登录页面失败:', err);
  158. uni.showToast({
  159. title: '跳转失败,请重试',
  160. icon: 'none'
  161. });
  162. }
  163. });
  164. return false;
  165. }
  166. try {
  167. const parsedUserInfo = JSON.parse(userInfo);
  168. if (!parsedUserInfo.openid) {
  169. // 没有openid时跳转到身份验证登录页面
  170. uni.navigateTo({
  171. url: '/pages/login/login'
  172. });
  173. return false;
  174. }
  175. return true;
  176. } catch (e) {
  177. console.error('解析用户信息失败:', e);
  178. uni.removeStorageSync('userInfo');
  179. uni.navigateTo({
  180. url: '/pages/login/login'
  181. });
  182. return false;
  183. }
  184. },
  185. goHome() {
  186. uni.navigateBack({
  187. delta: 1
  188. });
  189. },
  190. toggleAgreement() {
  191. this.isAgreed = !this.isAgreed;
  192. },
  193. relationChange(e) {
  194. this.relationIndex = e.detail.value;
  195. this.formData.relation = this.relationOptions[this.relationIndex];
  196. },
  197. checkUserInfo() {
  198. // if (!this.checkLogin()) {
  199. // return;
  200. // }
  201. uni.showLoading({
  202. title: '加载中...'
  203. });
  204. try {
  205. const userInfo = JSON.parse(uni.getStorageSync('userInfo'));
  206. console.log('id:', userInfo.id);
  207. getUserInfo(userInfo.id)
  208. .then(res => {
  209. uni.hideLoading();
  210. const userData = res;
  211. if (!userData.name || !userData.phone) {
  212. this.userInfoFilled = true;
  213. this.formData.name = userData.name || '';
  214. if (userData.gender) {
  215. this.formData.gender = this.genderMapping[userData.gender] || userData.gender;
  216. const index = this.genderOptions.findIndex(item => item === this.formData.gender);
  217. if (index !== -1) {
  218. this.genderIndex = index;
  219. }
  220. } else {
  221. this.formData.gender = '';
  222. }
  223. this.formData.phone = userData.phone || '';
  224. this.formData.idCard = userData.id_card || '';
  225. this.formData.emergencyContact = userData.emergency_contact || '';
  226. this.formData.emergencyPhone = userData.emergency_phone || '';
  227. this.formData.relation = userData.relation || '';
  228. if (userData.relation) {
  229. const index = this.relationOptions.findIndex(item => item === userData.relation);
  230. if (index !== -1) {
  231. this.relationIndex = index;
  232. }
  233. }
  234. }
  235. })
  236. .catch(err => {
  237. uni.hideLoading();
  238. console.error('获取用户信息失败:', err);
  239. uni.showToast({
  240. title: '获取用户信息失败',
  241. icon: 'none'
  242. });
  243. });
  244. } catch (e) {
  245. uni.hideLoading();
  246. console.error('获取用户信息失败:', e);
  247. uni.showToast({
  248. title: '获取用户信息失败',
  249. icon: 'none'
  250. });
  251. // uni.navigateTo({
  252. // url: '/pages/login/login'
  253. // });
  254. }
  255. },
  256. fetchJobList() {
  257. uni.showLoading({
  258. title: '加载职位列表...'
  259. });
  260. getJobList()
  261. .then(res => {
  262. uni.hideLoading();
  263. console.log(res);
  264. this.jobList = res;
  265. })
  266. .catch(err => {
  267. uni.hideLoading();
  268. console.error('获取职位列表失败:', err);
  269. uni.showToast({
  270. title: '网络错误,请稍后重试',
  271. icon: 'none'
  272. });
  273. });
  274. },
  275. selectJob(job) {
  276. // 清除之前的问题缓存
  277. try {
  278. uni.removeStorageSync('interviewQuestions');
  279. uni.removeStorageSync('currentQuestionIndex');
  280. } catch (e) {
  281. console.error('清除问题缓存失败:', e);
  282. }
  283. // 更新选中的职位
  284. this.selectedJobId = job.id;
  285. this.selectedJob = job;
  286. // 立即更新本地存储中的职位信息
  287. uni.setStorageSync('selectedJob', JSON.stringify(job));
  288. console.log('已选择职位:', job.id, job.title);
  289. },
  290. applyForJob() {
  291. if (!this.checkLogin()) {
  292. return;
  293. }
  294. if (!this.selectedJobId) {
  295. uni.showToast({
  296. title: '请选择一个职位',
  297. icon: 'none'
  298. });
  299. return;
  300. }
  301. // 保存所选职位信息
  302. uni.setStorageSync('selectedJob', JSON.stringify(this.selectedJob));
  303. applyJob({
  304. job_id: this.selectedJobId,
  305. tenant_id: 1,
  306. openid: JSON.parse(uni.getStorageSync('userInfo')).openid
  307. }).then(res => {
  308. // 保存返回的应用ID到本地存储
  309. if (res && res.id) {
  310. // 将应用ID保存到本地
  311. uni.setStorageSync('appId', res.id);
  312. // 也可以更新已有的userInfo对象
  313. try {
  314. const userInfo = JSON.parse(uni.getStorageSync('userInfo') || '{}');
  315. userInfo.appId = res.id;
  316. uni.setStorageSync('userInfo', JSON.stringify(userInfo));
  317. } catch (e) {
  318. console.error('更新用户信息失败:', e);
  319. }
  320. }
  321. uni.navigateTo({
  322. url: '/pages/Personal/Personal',
  323. fail: (err) => {
  324. console.error('页面跳转失败:', err);
  325. uni.showToast({
  326. title: '页面跳转失败',
  327. icon: 'none'
  328. });
  329. }
  330. });
  331. }).catch(err => {
  332. console.error('申请职位失败:', err);
  333. uni.showToast({
  334. title: '申请职位失败,请重试',
  335. icon: 'none'
  336. });
  337. });
  338. },
  339. submitForm() {
  340. if (!this.checkLogin()) {
  341. return;
  342. }
  343. if (!this.formData.name.trim()) {
  344. uni.showToast({
  345. title: '请输入姓名',
  346. icon: 'none'
  347. });
  348. return;
  349. }
  350. if (!this.formData.gender) {
  351. uni.showToast({
  352. title: '请选择性别',
  353. icon: 'none'
  354. });
  355. return;
  356. }
  357. if (!this.formData.phone.trim()) {
  358. uni.showToast({
  359. title: '请输入手机号',
  360. icon: 'none'
  361. });
  362. return;
  363. }
  364. if (!/^1\d{10}$/.test(this.formData.phone)) {
  365. uni.showToast({
  366. title: '请输入正确的手机号',
  367. icon: 'none'
  368. });
  369. return;
  370. }
  371. if (!this.formData.idCard.trim()) {
  372. uni.showToast({
  373. title: '请输入身份证号',
  374. icon: 'none'
  375. });
  376. return;
  377. }
  378. const idCardReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  379. if (!idCardReg.test(this.formData.idCard)) {
  380. uni.showToast({
  381. title: '请输入正确的身份证号',
  382. icon: 'none'
  383. });
  384. return;
  385. }
  386. if (!this.isAgreed) {
  387. uni.showToast({
  388. title: '请阅读并同意相关协议',
  389. icon: 'none'
  390. });
  391. return;
  392. }
  393. uni.showLoading({
  394. title: '验证身份信息...'
  395. });
  396. // 先调用身份验证接口
  397. uni.request({
  398. url: `${apiBaseUrl}/wechat/identity/verify`,
  399. method: 'POST',
  400. data: {
  401. name: this.formData.name,
  402. id_number: this.formData.idCard,
  403. mobile: this.formData.phone
  404. },
  405. header: {
  406. 'content-type': 'application/x-www-form-urlencoded'
  407. },
  408. success: (res) => {
  409. // 身份验证成功后,继续提交用户信息
  410. console.log(res);
  411. if (res.statusCode === 200) {
  412. if (res.data.code === 200) {
  413. this.submitUserInfo();
  414. } else {
  415. uni.showToast({
  416. title: res.data.data.message,
  417. icon: 'none'
  418. });
  419. }
  420. } else {
  421. uni.hideLoading();
  422. uni.showToast({
  423. title: '身份验证失败,请检查信息是否正确',
  424. icon: 'none'
  425. });
  426. }
  427. },
  428. fail: (err) => {
  429. uni.hideLoading();
  430. console.error('身份验证失败:', err);
  431. uni.showToast({
  432. title: '网络错误,请稍后重试',
  433. icon: 'none'
  434. });
  435. }
  436. });
  437. },
  438. submitUserInfo() {
  439. const genderValue = this.genderMapping[this.formData.gender] || this.formData.gender;
  440. const submitData = {
  441. openid: JSON.parse(uni.getStorageSync('userInfo') || '{}').openid || '',
  442. name: this.formData.name,
  443. phone: this.formData.phone,
  444. id_card: this.formData.idCard,
  445. status: 1,
  446. source: 'mini',
  447. examine: 0,
  448. tenant_id: '1',
  449. /* emergency_contact: this.formData.emergencyContact,
  450. emergency_phone: this.formData.emergencyPhone,
  451. relation: this.formData.relation, */
  452. age: '20',
  453. job_id: this.selectedJobId,
  454. gender: genderValue
  455. };
  456. fillUserInfo(submitData)
  457. .then(res => {
  458. uni.hideLoading();
  459. this.updateLocalUserInfo(res.id);
  460. uni.showToast({
  461. title: '提交成功',
  462. icon: 'success',
  463. duration: 1500,
  464. success: () => {
  465. this.userInfoFilled = false;
  466. // setTimeout(() => {
  467. // }, 1500);
  468. }
  469. });
  470. })
  471. .catch(err => {
  472. uni.hideLoading();
  473. console.error('提交表单失败:', err);
  474. uni.showToast({
  475. title: '网络错误,请稍后重试',
  476. icon: 'none'
  477. });
  478. });
  479. },
  480. updateLocalUserInfo(data) {
  481. getUserInfo(data)
  482. .then(res => {
  483. if (res.code === 200 && res.data) {
  484. let userInfo = {};
  485. try {
  486. userInfo = JSON.parse(uni.getStorageSync('userInfo') || '{}');
  487. } catch (e) {
  488. console.error('解析本地存储用户信息失败:', e);
  489. userInfo = {};
  490. }
  491. const updatedUserInfo = {
  492. ...userInfo,
  493. ...res.data
  494. };
  495. uni.setStorageSync('userInfo', JSON.stringify(updatedUserInfo));
  496. }
  497. })
  498. .catch(err => {
  499. console.error('更新本地用户信息失败:', err);
  500. });
  501. },
  502. validatePhone() {
  503. this.isPhoneValid = /^1\d{10}$/.test(this.formData.phone);
  504. },
  505. validateName() {
  506. this.isNameValid = this.formData.name.trim().length >= 2;
  507. },
  508. validateIdCard() {
  509. const idCardReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  510. this.isIdCardValid = idCardReg.test(this.formData.idCard);
  511. },
  512. genderChange(e) {
  513. this.genderIndex = e.detail.value;
  514. const displayGender = this.genderOptions[this.genderIndex];
  515. this.formData.gender = displayGender;
  516. }
  517. }
  518. }
  519. </script>
  520. <style>
  521. .interview-container {
  522. display: flex;
  523. flex-direction: column;
  524. min-height: 100vh;
  525. background-color: #f5f7fa;
  526. }
  527. .nav-bar {
  528. display: flex;
  529. justify-content: space-between;
  530. align-items: center;
  531. padding: 20rpx 30rpx;
  532. background-color: #0039b3;
  533. color: #fff;
  534. }
  535. .scan-btn {
  536. display: flex;
  537. flex-direction: column;
  538. align-items: center;
  539. background-color: #ff9f43;
  540. padding: 10rpx 30rpx;
  541. border-radius: 30rpx;
  542. font-size: 24rpx;
  543. }
  544. .interview-info {
  545. background-color: #0039b3;
  546. color: #fff;
  547. padding: 20rpx 30rpx 40rpx;
  548. }
  549. .info-item {
  550. margin: 10rpx 0;
  551. font-size: 28rpx;
  552. }
  553. .label {
  554. margin-right: 10rpx;
  555. }
  556. .form-container {
  557. flex: 1;
  558. background-color: #fff;
  559. padding: 40rpx 30rpx;
  560. }
  561. .form-title {
  562. font-size: 32rpx;
  563. font-weight: bold;
  564. margin-bottom: 40rpx;
  565. text-align: center;
  566. color: #333;
  567. }
  568. .form-item {
  569. margin-bottom: 30rpx;
  570. position: relative;
  571. }
  572. .validation-icon {
  573. position: absolute;
  574. right: 20rpx;
  575. top: 50%;
  576. transform: translateY(-50%);
  577. font-size: 36rpx;
  578. display: flex;
  579. align-items: center;
  580. justify-content: center;
  581. }
  582. .icon-success {
  583. color: #4cd964;
  584. }
  585. .icon-error {
  586. color: #ff3b30;
  587. }
  588. input {
  589. width: 100%;
  590. height: 80rpx;
  591. border: 1px solid #eee;
  592. border-radius: 8rpx;
  593. padding: 0 60rpx 0 20rpx;
  594. font-size: 28rpx;
  595. box-sizing: border-box;
  596. background-color: #f9f9f9;
  597. }
  598. .phone-item {
  599. display: flex;
  600. align-items: center;
  601. position: relative;
  602. }
  603. .phone-item .validation-icon {
  604. right: 20rpx;
  605. }
  606. .phone-item input {
  607. flex: 1;
  608. border-radius: 0 8rpx 8rpx 0;
  609. }
  610. .verify-btn {
  611. width: 100%;
  612. height: 90rpx;
  613. line-height: 90rpx;
  614. background-color: #0039b3;
  615. color: #fff;
  616. border-radius: 45rpx;
  617. font-size: 32rpx;
  618. margin-top: 60rpx;
  619. }
  620. .verify-btn[disabled] {
  621. background-color: #b2b2b2;
  622. color: #fff;
  623. opacity: 0.7;
  624. }
  625. .agreement {
  626. display: flex;
  627. align-items: center;
  628. margin-top: 30rpx;
  629. }
  630. .agreement-text {
  631. font-size: 24rpx;
  632. color: #666;
  633. line-height: 1.5;
  634. margin-left: 10rpx;
  635. }
  636. .agreement-link {
  637. color: #0039b3;
  638. }
  639. /* 职位列表样式 */
  640. .job-list-container {
  641. flex: 1;
  642. background-color: #fff;
  643. border-radius: 20rpx 20rpx 0 0;
  644. margin-top: -20rpx;
  645. padding: 40rpx 30rpx;
  646. }
  647. .job-list-title {
  648. font-size: 32rpx;
  649. font-weight: bold;
  650. margin-bottom: 30rpx;
  651. }
  652. .job-list {
  653. max-height: 800rpx;
  654. overflow-y: auto;
  655. }
  656. .job-item {
  657. padding: 30rpx;
  658. border-radius: 12rpx;
  659. background-color: #f8f9fa;
  660. margin-bottom: 20rpx;
  661. border: 2rpx solid transparent;
  662. }
  663. .job-selected {
  664. border-color: #0039b3;
  665. background-color: rgba(108, 92, 231, 0.1);
  666. }
  667. .job-name {
  668. font-size: 30rpx;
  669. font-weight: bold;
  670. margin-bottom: 10rpx;
  671. }
  672. .job-details {
  673. display: flex;
  674. justify-content: space-between;
  675. font-size: 24rpx;
  676. color: #666;
  677. }
  678. .job-salary {
  679. color: #ff6b6b;
  680. }
  681. .apply-btn {
  682. width: 100%;
  683. height: 90rpx;
  684. line-height: 90rpx;
  685. background-color: #0039b3;
  686. color: #fff;
  687. border-radius: 45rpx;
  688. font-size: 32rpx;
  689. margin-top: 40rpx;
  690. }
  691. .apply-btn[disabled] {
  692. background-color: #b2b2b2;
  693. color: #fff;
  694. }
  695. /* 修复国家代码样式 */
  696. .country-code {
  697. display: flex;
  698. align-items: center;
  699. justify-content: space-between;
  700. width: 100rpx;
  701. padding: 0 20rpx;
  702. height: 80rpx;
  703. border: 1px solid #eee;
  704. border-radius: 8rpx 0 0 8rpx;
  705. border-right: none;
  706. font-size: 28rpx;
  707. background-color: #f9f9f9;
  708. }
  709. .dropdown-icon {
  710. font-size: 20rpx;
  711. color: #999;
  712. margin-left: 10rpx;
  713. }
  714. /* 修复手机号输入框样式 */
  715. .phone-item {
  716. display: flex;
  717. align-items: center;
  718. position: relative;
  719. }
  720. .phone-item input {
  721. flex: 1;
  722. border-radius: 0 8rpx 8rpx 0;
  723. }
  724. /* 修复验证图标位置 */
  725. .validation-icon {
  726. position: absolute;
  727. right: 20rpx;
  728. top: 50%;
  729. transform: translateY(-50%);
  730. font-size: 36rpx;
  731. display: flex;
  732. align-items: center;
  733. justify-content: center;
  734. z-index: 2;
  735. }
  736. .phone-item .validation-icon {
  737. right: 20rpx;
  738. }
  739. /* 修改图标样式与图片一致 */
  740. .icon-success {
  741. color: #4cd964;
  742. font-weight: bold;
  743. }
  744. .icon-error {
  745. color: #ff3b30;
  746. font-weight: bold;
  747. }
  748. /* 修改性别选择样式,使其看起来像输入框 */
  749. .picker-input {
  750. position: relative;
  751. width: 100%;
  752. }
  753. .picker-input input {
  754. width: 100%;
  755. height: 80rpx;
  756. border: 1px solid #eee;
  757. border-radius: 8rpx;
  758. padding: 0 60rpx 0 20rpx;
  759. font-size: 28rpx;
  760. box-sizing: border-box;
  761. background-color: #f9f9f9;
  762. }
  763. .picker-input .dropdown-icon {
  764. position: absolute;
  765. right: 20rpx;
  766. top: 50%;
  767. transform: translateY(-50%);
  768. font-size: 24rpx;
  769. color: #999;
  770. }
  771. </style>