index.vue 19 KB

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