Personal.vue 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010
  1. <template>
  2. <view class="personal-container">
  3. <!-- Add loading indicator -->
  4. <view class="loading-container" v-if="isLoading">
  5. <view class="loading-spinner"></view>
  6. <text class="loading-text">加载中...</text>
  7. </view>
  8. <!-- 添加承诺书弹框 -->
  9. <view class="promise-modal" v-if="showPromiseModal">
  10. <view class="promise-content">
  11. <view class="promise-title">入职承诺书</view>
  12. <scroll-view scroll-y class="promise-text">
  13. <text>
  14. 本人郑重承诺:
  15. 所提交的入职登记表、学历证书、职业资格证明、工作履历等全部个人信息及证明材料均真实、准确、完整。若经公司核查发现存在虚构工作经历、伪造学历证书、隐瞒竞业限制义务、虚报健康状况等任何不实或欺诈情形,本人自愿承担以下责任:
  16. 1. 法律责任:因信息不实引发的劳动纠纷、民事赔偿、行政处罚或刑事追责,由本人独立承担全部法律后果,公司不承担任何连带责任;
  17. 2. 劳动关系处理:公司有权立即解除劳动合同,无需支付经济补偿,并保留向本人追偿因信息欺诈导致公司经济损失(包括但不限于招聘成本、培训费用、商誉损失等)的权利;
  18. 3. 其他后果:若已入职,公司可单方撤销录用决定,要求返还已发放的工资、福利等费用,并可将不实行为记入个人档案。
  19. 本人确认已充分理解上述条款内容,无任何歧义,并自愿受其约束。
  20. </text>
  21. </scroll-view>
  22. <view class="promise-checkbox">
  23. <checkbox :checked="promiseChecked" @click="togglePromiseChecked" />
  24. <text>我已阅读并同意以上承诺书内容</text>
  25. </view>
  26. <view class="promise-buttons">
  27. <button class="promise-btn confirm-btn" :disabled="!promiseChecked" @click="confirmPromise">确认</button>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="form-title">个人信息表</view>
  32. <!-- 添加步骤指示器 -->
  33. <!-- <view class="steps-indicator">
  34. <view
  35. v-for="(step, index) in steps"
  36. :key="step.id"
  37. class="step-item"
  38. :class="{ 'active': currentStep >= step.id, 'current': currentStep === step.id }"
  39. >
  40. <view class="step-number">{{ step.id }}</view>
  41. <view class="step-name">{{ step.name }}</view>
  42. </view>
  43. </view> -->
  44. <!-- 根据currentStep渲染对应的表单内容 -->
  45. <view class="form-content">
  46. <!-- 第一步:基本信息 -->
  47. <view v-if="currentStep === 1" class="form-container">
  48. <!-- 第一行 -->
  49. <view class="form-row">
  50. <view class="form-item" v-if="showNameField">
  51. <text class="label required">姓名</text>
  52. <input type="text" v-model="formData.name" placeholder="请输入姓名" :class="{'input-error': formErrors.name}" />
  53. <text v-if="formErrors.name" class="error-message">{{formErrors.name}}</text>
  54. </view>
  55. <view class="form-item" v-if="showGenderField">
  56. <text class="label required">性别</text>
  57. <picker @change="bindGenderChange" :value="genderIndex" :range="genderOptions">
  58. <view class="picker-text" :class="{'input-error': formErrors.gender}">{{ genderOptions[genderIndex] || '请选择性别' }}</view>
  59. </picker>
  60. <text v-if="formErrors.gender" class="error-message">{{formErrors.gender}}</text>
  61. </view>
  62. <!-- 当性别为女时显示三期选择 -->
  63. <view class="form-item" v-if="formData.gender === '女'">
  64. <text class="label required">是否为三期</text>
  65. <picker @change="bindThreePeriodChange" :value="threePeriodIndex" :range="threePeriodOptions" :class="{'input-error': formErrors.threePeriod}">
  66. <view class="picker-text">{{ threePeriodOptions[threePeriodIndex] || '请选择' }}</view>
  67. </picker>
  68. <text v-if="formErrors.threePeriod" class="error-message">{{formErrors.threePeriod}}</text>
  69. </view>
  70. <view class="form-row">
  71. <view class="form-item" v-if="showPhoneField">
  72. <text class="label required">手机号</text>
  73. <input type="number" v-model="formData.phone" placeholder="请输入手机号" :class="{'input-error': formErrors.phone}" />
  74. <text v-if="formErrors.phone" class="error-message">{{formErrors.phone}}</text>
  75. </view>
  76. </view>
  77. <!-- <view class="form-item">
  78. <text class="label">出生日期</text>
  79. <picker mode="date" :value="formData.birthDate" @change="bindDateChange">
  80. <view class="picker-text">{{ formData.birthDate || '请选择日期' }}</view>
  81. </picker>
  82. </view> -->
  83. </view>
  84. <view class="form-item" v-if="showIdCardField">
  85. <text class="label required">身份证号</text>
  86. <input type="idcard" v-model="formData.idCard" placeholder="请输入身份证号" :class="{'input-error': formErrors.idCard}" />
  87. <text v-if="formErrors.idCard" class="error-message">{{formErrors.idCard}}</text>
  88. </view>
  89. <!-- <view class="form-item">
  90. <text class="label">政治面貌</text>
  91. <picker @change="bindPoliticalChange" :value="politicalIndex" :range="politicalOptions">
  92. <view class="picker-text">{{ politicalOptions[politicalIndex] || '请选择政治面貌' }}</view>
  93. </picker>
  94. </view> -->
  95. <view class="form-item" v-if="showEthnicField">
  96. <text class="label required">民族</text>
  97. <picker @change="bindEthnicChange" :value="ethnicIndex" :range="ethnicOptions">
  98. <view class="picker-text" :class="{'input-error': formErrors.ethnic}">{{ ethnicOptions[ethnicIndex] || '请选择民族' }}</view>
  99. </picker>
  100. <text v-if="formErrors.ethnic" class="error-message">{{formErrors.ethnic}}</text>
  101. </view>
  102. <!-- 第三行 -->
  103. <view class="form-row">
  104. <view class="form-item" v-if="showHeightField">
  105. <text class="label">身高(cm)</text>
  106. <input type="digit" v-model="formData.height" placeholder="请输入身高" />
  107. </view>
  108. <view class="form-item" v-if="showWeightField">
  109. <text class="label">体重(kg)</text>
  110. <input type="digit" v-model="formData.weight" placeholder="请输入体重" />
  111. </view>
  112. <view class="form-item">
  113. <text class="label required">现居住地址</text>
  114. <input type="text" v-model="formData.currentAddress" placeholder="请输入现居住地址" :class="{'input-error': formErrors.currentAddress}" />
  115. <text v-if="formErrors.currentAddress" class="error-message">{{formErrors.currentAddress}}</text>
  116. </view>
  117. <!-- <view class="form-item">
  118. <text class="label">籍贯</text>
  119. <input type="text" v-model="formData.nativePlace" placeholder="请输入籍贯" />
  120. </view> -->
  121. </view>
  122. <!-- 第四行 -->
  123. <view class="form-row">
  124. <view class="form-item">
  125. <text class="label">户口所在地</text>
  126. <input type="text" v-model="formData.residence" placeholder="请输入户口所在地" />
  127. </view>
  128. <view class="form-item">
  129. <text class="label">婚育状况</text>
  130. <picker @change="bindMarriageChange" :value="marriageIndex" :range="marriageOptions">
  131. <view class="picker-text">{{ marriageOptions[marriageIndex] || '请选择婚育状况' }}</view>
  132. </picker>
  133. </view>
  134. <view class="form-item">
  135. <text class="label">期望薪资(元/月)</text>
  136. <input type="digit" v-model="formData.expectedSalary" placeholder="请输入期望薪资" />
  137. </view>
  138. </view>
  139. </view>
  140. <!-- 第二步:家庭成员 -->
  141. <view v-if="currentStep === 3" class="form-container">
  142. <view class="section-title">家庭主要成员信息</view>
  143. <!-- 已添加的家庭成员列表 -->
  144. <view class="family-members-list" v-if="familyMembers.length > 0">
  145. <view class="family-member-item" v-for="(member, index) in familyMembers" :key="index">
  146. <view class="family-member-header">
  147. <text class="family-member-title">成员 {{index + 1}}</text>
  148. <view class="family-member-actions">
  149. <text class="family-member-edit" @click="editFamilyMember(index)">编辑</text>
  150. <text class="family-member-delete" @click="deleteFamilyMember(index)">删除</text>
  151. </view>
  152. </view>
  153. <view class="family-member-content">
  154. <view class="family-member-row" v-if="showFamilyRelationField">
  155. <text class="family-member-label">称谓:</text>
  156. <text class="family-member-value">{{member.relation}}</text>
  157. </view>
  158. <view class="family-member-row" v-if="showFamilyNameField">
  159. <text class="family-member-label">姓名:</text>
  160. <text class="family-member-value">{{member.name}}</text>
  161. </view>
  162. <view class="family-member-row" v-if="showFamilyWorkplaceField">
  163. <text class="family-member-label">工作单位/家庭地址:</text>
  164. <text class="family-member-value">{{member.workplaceOrAddress}}</text>
  165. </view>
  166. <view class="family-member-row" v-if="showFamilyPositionField">
  167. <text class="family-member-label">职务:</text>
  168. <text class="family-member-value">{{member.position}}</text>
  169. </view>
  170. <view class="family-member-row" v-if="showFamilyPhoneField">
  171. <text class="family-member-label">联系电话:</text>
  172. <text class="family-member-value">{{member.phone}}</text>
  173. </view>
  174. <view class="family-member-row">
  175. <text class="family-member-label">是否为紧急联系人:</text>
  176. <text class="family-member-value">{{member.isEmergencyContact ? '是' : '否'}}</text>
  177. </view>
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 家庭成员信息表单 -->
  182. <view class="family-member-form">
  183. <view class="form-subtitle">
  184. {{ isEditing ? '编辑家庭成员' : '添加家庭成员' }}
  185. <text v-if="isEditing" class="cancel-edit" @click="cancelEdit">取消编辑</text>
  186. </view>
  187. <view class="form-row">
  188. <view class="form-item" v-if="showFamilyRelationField">
  189. <text class="label required">称谓</text>
  190. <input
  191. type="text"
  192. v-model="familyMemberForm.relation"
  193. placeholder="如:父亲、母亲、配偶等"
  194. :class="{'input-error': familyMemberErrors.relation}"
  195. />
  196. <text v-if="familyMemberErrors.relation" class="error-message">{{familyMemberErrors.relation}}</text>
  197. </view>
  198. <view class="form-item" v-if="showFamilyNameField">
  199. <text class="label required">姓名</text>
  200. <input
  201. type="text"
  202. v-model="familyMemberForm.name"
  203. placeholder="请输入姓名"
  204. :class="{'input-error': familyMemberErrors.name}"
  205. />
  206. <text v-if="familyMemberErrors.name" class="error-message">{{familyMemberErrors.name}}</text>
  207. </view>
  208. </view>
  209. <view class="form-row">
  210. <view class="form-item" v-if="showFamilyWorkplaceField">
  211. <text class="label ">工作单位/家庭地址</text>
  212. <input type="text" v-model="familyMemberForm.workplaceOrAddress" placeholder="请输入工作单位或家庭地址" />
  213. <!-- <text v-if="familyMemberErrors.workplaceOrAddress" class="error-message">{{familyMemberErrors.workplaceOrAddress}}</text> -->
  214. </view>
  215. <view class="form-item" v-if="showFamilyPositionField">
  216. <text class="label ">职务</text>
  217. <input type="text" v-model="familyMemberForm.position" placeholder="请输入职务" />
  218. <!-- <text v-if="familyMemberErrors.position" class="error-message">{{familyMemberErrors.position}}</text> -->
  219. </view>
  220. </view>
  221. <view class="form-row">
  222. <view class="form-item" v-if="showFamilyPhoneField">
  223. <text class="label required">联系电话</text>
  224. <input
  225. type="number"
  226. v-model="familyMemberForm.phone"
  227. placeholder="请输入联系电话"
  228. :class="{'input-error': familyMemberErrors.phone}"
  229. />
  230. <text v-if="familyMemberErrors.phone" class="error-message">{{familyMemberErrors.phone}}</text>
  231. </view>
  232. </view>
  233. <view class="form-row">
  234. <view class="form-item">
  235. <text class="label">是否为紧急联系人</text>
  236. <switch :checked="familyMemberForm.isEmergencyContact" @change="handleEmergencyContactChange" />
  237. </view>
  238. </view>
  239. <view class="form-row button-row">
  240. <view class="form-item button-container">
  241. <button class="circle-btn" @click="saveFamilyMember">
  242. <text class="btn-icon">{{ isEditing ? '✓' : '+' }}</text>
  243. </button>
  244. <text class="btn-text">{{ isEditing ? '保存修改' : '添加成员' }}</text>
  245. </view>
  246. </view>
  247. </view>
  248. </view>
  249. <!-- 第三步:教育经历 -->
  250. <view v-if="currentStep === 5" class="form-container">
  251. <view class="section-title">教育经历</view>
  252. <!-- 已添加的教育经历列表 -->
  253. <view class="education-list" v-if="educationList.length > 0">
  254. <view class="education-item" v-for="(edu, index) in educationList" :key="index">
  255. <view class="education-header">
  256. <text class="education-title">{{ index === 0 ? '第一学历' : '最高学历' }}</text>
  257. <view class="education-actions">
  258. <text class="education-edit" @click="editEducation(index)">编辑</text>
  259. <text class="education-delete" @click="deleteEducation(index)">删除</text>
  260. </view>
  261. </view>
  262. <view class="education-content">
  263. <view class="education-row" v-if="showEducationTimeField">
  264. <text class="education-label">起止时间:</text>
  265. <text class="education-value">{{edu.startTime}} 至 {{edu.endTime}}</text>
  266. </view>
  267. <view class="education-row" v-if="showEducationSchoolField">
  268. <text class="education-label">学校名称:</text>
  269. <text class="education-value">{{edu.schoolName}}</text>
  270. </view>
  271. <view class="education-row" v-if="showEducationMajorField">
  272. <text class="education-label">专业:</text>
  273. <text class="education-value">{{edu.major}}</text>
  274. </view>
  275. <view class="education-row" v-if="showEducationDegreeField">
  276. <text class="education-label">学历:</text>
  277. <text class="education-value">{{edu.degree}}</text>
  278. </view>
  279. </view>
  280. </view>
  281. </view>
  282. <!-- 教育经历表单 -->
  283. <view class="education-form" v-if="educationList.length < 2 || isEditingEducation">
  284. <view class="form-subtitle">
  285. {{ isEditingEducation ? '编辑教育经历' : (educationList.length === 0 ? '添加第一学历' : '添加最高学历') }}
  286. <text v-if="isEditingEducation" class="cancel-edit" @click="cancelEditEducation">取消编辑</text>
  287. </view>
  288. <view class="form-row">
  289. <view class="form-item" v-if="showEducationTimeField">
  290. <text class="label required">起止时间</text>
  291. <view class="date-range">
  292. <picker
  293. mode="date"
  294. :value="educationForm.startTime"
  295. @change="bindStartTimeChange"
  296. :class="{'input-error': educationErrors.startTime}"
  297. >
  298. <view class="picker-text">{{ educationForm.startTime || '开始时间' }}</view>
  299. </picker>
  300. <text class="date-separator">至</text>
  301. <picker
  302. mode="date"
  303. :value="educationForm.endTime"
  304. @change="bindEndTimeChange"
  305. :class="{'input-error': educationErrors.endTime}"
  306. >
  307. <view class="picker-text">{{ educationForm.endTime || '结束时间' }}</view>
  308. </picker>
  309. </view>
  310. <text v-if="educationErrors.startTime" class="error-message">{{educationErrors.startTime}}</text>
  311. <text v-if="educationErrors.endTime" class="error-message">{{educationErrors.endTime}}</text>
  312. </view>
  313. </view>
  314. <view class="form-row">
  315. <view class="form-item" v-if="showEducationSchoolField">
  316. <text class="label required">学校名称</text>
  317. <input
  318. type="text"
  319. v-model="educationForm.schoolName"
  320. placeholder="请输入学校名称"
  321. :class="{'input-error': educationErrors.schoolName}"
  322. />
  323. <text v-if="educationErrors.schoolName" class="error-message">{{educationErrors.schoolName}}</text>
  324. </view>
  325. <view class="form-item" v-if="showEducationMajorField">
  326. <text class="label required">专业</text>
  327. <input
  328. type="text"
  329. v-model="educationForm.major"
  330. placeholder="请输入专业"
  331. :class="{'input-error': educationErrors.major}"
  332. />
  333. <text v-if="educationErrors.major" class="error-message">{{educationErrors.major}}</text>
  334. </view>
  335. </view>
  336. <view class="form-row">
  337. <view class="form-item" v-if="showEducationDegreeField">
  338. <text class="label required">学历</text>
  339. <picker
  340. @change="bindDegreeChange"
  341. :value="degreeIndex"
  342. :range="degreeOptions"
  343. :class="{'input-error': educationErrors.degree}"
  344. >
  345. <view class="picker-text">{{ degreeOptions[degreeIndex] || '请选择学历' }}</view>
  346. </picker>
  347. <text v-if="educationErrors.degree" class="error-message">{{educationErrors.degree}}</text>
  348. </view>
  349. </view>
  350. <view class="form-row button-row">
  351. <view class="form-item button-container">
  352. <button class="circle-btn" @click="saveEducation">
  353. <text class="btn-icon">{{ isEditingEducation ? '✓' : '+' }}</text>
  354. </button>
  355. <text class="btn-text">{{ isEditingEducation ? '保存修改' : '添加学历' }}</text>
  356. </view>
  357. </view>
  358. </view>
  359. </view>
  360. <!-- 第四步:专业技能 -->
  361. <view v-if="currentStep === 6 && (showRequireTrainingInfoField || showRequireProfessionalSkillsField)" class="form-container">
  362. <view class="section-title" v-if="showRequireTrainingInfoField"><text class="required" style="margin-right: 4rpx;color: #ff4d4f;">*</text>专业技能</view>
  363. <view class="skills-container" v-if="showRequireTrainingInfoField">
  364. <textarea
  365. v-model="formData.skills"
  366. placeholder="请描述您的专业技能"
  367. class="skills-textarea"
  368. :class="{'input-error': formErrors.skills}"
  369. ></textarea>
  370. <text v-if="formErrors.skills" class="error-message">{{formErrors.skills}}</text>
  371. </view>
  372. <view class="section-title" v-if="showRequireProfessionalSkillsField"><text class="required" style="margin-right: 4rpx;color: #ff4d4f;">*</text>受过的培训</view>
  373. <view class="training-container" v-if="showRequireProfessionalSkillsField">
  374. <textarea
  375. v-model="formData.training"
  376. placeholder="请描述您接受过的培训经历"
  377. class="training-textarea"
  378. :class="{'input-error': formErrors.training}"
  379. ></textarea>
  380. <text v-if="formErrors.training" class="error-message">{{formErrors.training}}</text>
  381. </view>
  382. </view>
  383. <!-- 第五步:工作经历 -->
  384. <view v-if="currentStep === 8" class="form-container">
  385. <view class="section-title">工作经历</view>
  386. <!-- 已添加的工作经历列表 -->
  387. <view class="work-list" v-if="workList.length > 0">
  388. <view class="work-item" v-for="(work, index) in workList" :key="index">
  389. <view class="work-header">
  390. <text class="work-title">单位{{ index + 1 }}</text>
  391. <view class="work-actions">
  392. <text class="work-edit" @click="editWork(index)">编辑</text>
  393. <text class="work-delete" @click="deleteWork(index)">删除</text>
  394. </view>
  395. </view>
  396. <view class="work-content">
  397. <view class="work-row" v-if="showWorkTimeField">
  398. <text class="work-label">起止时间:</text>
  399. <text class="work-value">{{work.startTime}} 至 {{work.endTime}}</text>
  400. </view>
  401. <view class="work-row" v-if="showWorkCompanyField">
  402. <text class="work-label">单位名称:</text>
  403. <text class="work-value">{{work.companyName}}</text>
  404. </view>
  405. <view class="work-row" v-if="showWorkDepartmentField">
  406. <text class="work-label">任职部门:</text>
  407. <text class="work-value">{{work.department}}</text>
  408. </view>
  409. <view class="work-row" v-if="showWorkEmployeeCountField">
  410. <text class="work-label">单位人数:</text>
  411. <text class="work-value">{{work.employeeCount}}</text>
  412. </view>
  413. <view class="work-row" v-if="showWorkPositionField">
  414. <text class="work-label">担任职务:</text>
  415. <text class="work-value">{{work.position}}</text>
  416. </view>
  417. <view class="work-row" >
  418. <text class="work-label">月总收入:</text>
  419. <text class="work-value">{{work.monthlySalary}}</text>
  420. </view>
  421. <view class="work-row" >
  422. <text class="work-label">直接领导:</text>
  423. <text class="work-value">{{work.supervisor}}</text>
  424. </view>
  425. <view class="work-row" >
  426. <text class="work-label">领导电话:</text>
  427. <text class="work-value">{{work.supervisorPhone}}</text>
  428. </view>
  429. </view>
  430. </view>
  431. </view>
  432. <!-- 工作经历表单 -->
  433. <view class="work-form" v-if="workList.length < 2 || isEditingWork">
  434. <view class="form-subtitle">
  435. {{ isEditingWork ? '编辑工作经历' : '添加工作经历' }}
  436. <text v-if="isEditingWork" class="cancel-edit" @click="cancelEditWork">取消编辑</text>
  437. </view>
  438. <view class="form-row">
  439. <view class="form-item" v-if="showWorkTimeField">
  440. <text class="label required">起止时间</text>
  441. <view class="date-range">
  442. <picker
  443. mode="date"
  444. :value="workForm.startTime"
  445. @change="bindWorkStartTimeChange"
  446. :class="{'input-error': workErrors.startTime}"
  447. >
  448. <view class="picker-text">{{ workForm.startTime || '开始时间' }}</view>
  449. </picker>
  450. <text class="date-separator">至</text>
  451. <picker
  452. mode="date"
  453. :value="workForm.endTime"
  454. @change="bindWorkEndTimeChange"
  455. :class="{'input-error': workErrors.endTime}"
  456. >
  457. <view class="picker-text">{{ workForm.endTime || '结束时间' }}</view>
  458. </picker>
  459. </view>
  460. <text v-if="workErrors.startTime" class="error-message">{{workErrors.startTime}}</text>
  461. <text v-if="workErrors.endTime" class="error-message">{{workErrors.endTime}}</text>
  462. </view>
  463. </view>
  464. <view class="form-row">
  465. <view class="form-item" v-if="showWorkCompanyField">
  466. <text class="label required">单位名称</text>
  467. <input
  468. type="text"
  469. v-model="workForm.companyName"
  470. placeholder="请输入单位名称"
  471. :class="{'input-error': workErrors.companyName}"
  472. />
  473. <text v-if="workErrors.companyName" class="error-message">{{workErrors.companyName}}</text>
  474. </view>
  475. <view class="form-item" v-if="showWorkEmployeeCountField">
  476. <text class="label required">单位人数</text>
  477. <input
  478. type="number"
  479. v-model="workForm.employeeCount"
  480. placeholder="请输入单位人数"
  481. :class="{'input-error': workErrors.employeeCount}"
  482. />
  483. <text v-if="workErrors.employeeCount" class="error-message">{{workErrors.employeeCount}}</text>
  484. </view>
  485. </view>
  486. <view class="form-row">
  487. <view class="form-item" v-if="showWorkDepartmentField">
  488. <text class="label required">任职部门</text>
  489. <input
  490. type="text"
  491. v-model="workForm.department"
  492. placeholder="请输入任职部门"
  493. :class="{'input-error': workErrors.department}"
  494. />
  495. <text v-if="workErrors.department" class="error-message">{{workErrors.department}}</text>
  496. </view>
  497. <view class="form-item" v-if="showWorkPositionField">
  498. <text class="label required">担任职务</text>
  499. <input
  500. type="text"
  501. v-model="workForm.position"
  502. placeholder="请输入担任职务"
  503. :class="{'input-error': workErrors.position}"
  504. />
  505. <text v-if="workErrors.position" class="error-message">{{workErrors.position}}</text>
  506. </view>
  507. </view>
  508. <view class="form-row">
  509. <view class="form-item" >
  510. <text class="label required">月总收入</text>
  511. <input type="number" v-model="workForm.monthlySalary" placeholder="请输入月总收入" />
  512. <text v-if="workErrors.monthlySalary" class="error-message">{{workErrors.monthlySalary}}</text>
  513. </view>
  514. </view>
  515. <view class="form-row">
  516. <view class="form-item" >
  517. <text class="label required">直接领导</text>
  518. <input type="text" v-model="workForm.supervisor" placeholder="请输入直接领导姓名" />
  519. <text v-if="workErrors.supervisor" class="error-message">{{workErrors.supervisor}}</text>
  520. </view>
  521. <view class="form-item">
  522. <text class="label required">领导电话</text>
  523. <input type="number" v-model="workForm.supervisorPhone" placeholder="请输入领导电话" />
  524. <text v-if="workErrors.supervisorPhone" class="error-message">{{workErrors.supervisorPhone}}</text>
  525. </view>
  526. </view>
  527. <view class="form-row button-row">
  528. <view class="form-item button-container">
  529. <button class="circle-btn" @click="saveWork">
  530. <text class="btn-icon">{{ isEditingWork ? '✓' : '+' }}</text>
  531. </button>
  532. <text class="btn-text">{{ isEditingWork ? '保存修改' : '添加工作经历' }}</text>
  533. </view>
  534. </view>
  535. </view>
  536. </view>
  537. </view>
  538. <!-- 修改导航按钮逻辑 -->
  539. <view class="nav-buttons">
  540. <button
  541. v-if="showPrevButton"
  542. class="nav-btn prev-btn"
  543. @click="prevStep"
  544. >上一步</button>
  545. <button
  546. v-if="showNextButton"
  547. class="nav-btn next-btn"
  548. @click="nextStep"
  549. >下一步</button>
  550. <button
  551. v-if="showSubmitButton"
  552. class="submit-btn"
  553. @click="submitForm"
  554. >提交</button>
  555. </view>
  556. </view>
  557. </template>
  558. <script>
  559. import { apiBaseUrl } from '@/common/config.js';
  560. export default {
  561. data() {
  562. return {
  563. // 添加承诺书相关数据
  564. showPromiseModal: true,
  565. promiseChecked: false,
  566. formData: {
  567. name: '',
  568. gender: '',
  569. threePeriod: '',
  570. birthDate: '',
  571. idCard: '',
  572. political: '',
  573. ethnic: '',
  574. height: '',
  575. weight: '',
  576. nativePlace: '',
  577. residence: '',
  578. marriage: '',
  579. expectedSalary: '',
  580. phone: '',
  581. email: '',
  582. currentAddress: '',
  583. emergencyContact: '',
  584. emergencyPhone: '',
  585. hobby: '',
  586. motto: '',
  587. // 添加应聘来源相关字段
  588. sourceType: 'social', // 默认为社招
  589. socialSource: '', // 社招来源
  590. otherSocialSource: '', // 其他社招来源
  591. otherSchoolSource: '', // 其他学校来源
  592. // 添加技能和培训字段
  593. skills: '',
  594. training: '',
  595. },
  596. genderOptions: ['男', '女'],
  597. genderIndex: -1,
  598. threePeriodOptions: ['无', '孕期', '产期', '哺乳期'],
  599. threePeriodIndex: -1,
  600. politicalOptions: ['群众', '共青团员', '中共党员', '民主党派'],
  601. politicalIndex: -1,
  602. ethnicOptions: ['汉族', '蒙古族', '回族', '藏族', '维吾尔族', '其他'],
  603. ethnicIndex: -1,
  604. marriageOptions: ['未婚', '已婚', '离异', '丧偶'],
  605. marriageIndex: -1,
  606. familyMembers: [],
  607. familyMemberForm: {
  608. relation: '',
  609. name: '',
  610. workplaceOrAddress: '',
  611. position: '',
  612. phone: '',
  613. isEmergencyContact: false // 添加新字段
  614. },
  615. isEditing: false,
  616. editingIndex: -1,
  617. // 添加教育经历相关数据
  618. educationList: [],
  619. educationForm: {
  620. startTime: '',
  621. endTime: '',
  622. schoolName: '',
  623. major: '',
  624. degree: ''
  625. },
  626. isEditingEducation: false,
  627. editingEducationIndex: -1,
  628. degreeOptions: ['高中', '中专', '大专', '本科', '硕士', '博士'],
  629. degreeIndex: -1,
  630. // 添加工作经历相关数据
  631. workList: [],
  632. workForm: {
  633. startTime: '',
  634. endTime: '',
  635. companyName: '',
  636. department: '',
  637. employeeCount: '',
  638. position: '',
  639. monthlySalary: '',
  640. supervisor: '',
  641. supervisorPhone: ''
  642. },
  643. isEditingWork: false,
  644. editingWorkIndex: -1,
  645. // 添加步骤控制
  646. currentStep: 1,
  647. steps: [
  648. { id: 1, name: '基本信息' },
  649. { id: 3, name: '家庭成员' },
  650. { id: 5, name: '教育经历' },
  651. { id: 6, name: '专业技能' },
  652. { id: 8, name: '工作经历' }
  653. ],
  654. formErrors: {
  655. name: '',
  656. idCard: '',
  657. phone: '',
  658. gender: '',
  659. ethnic: '',
  660. currentAddress: '',
  661. height: '',
  662. weight: '',
  663. expectedSalary: '',
  664. skills: '',
  665. training: '',
  666. threePeriod: '' // 添加这一行
  667. },
  668. // Add loading state
  669. isLoading: true,
  670. familyMemberErrors: {
  671. relation: '',
  672. name: '',
  673. phone: '',
  674. workplaceOrAddress: '',
  675. position: ''
  676. },
  677. workErrors: {
  678. startTime: '',
  679. endTime: '',
  680. companyName: '',
  681. department: '',
  682. position: '',
  683. employeeCount: '',
  684. monthlySalary: '',
  685. supervisor: '',
  686. supervisorPhone: ''
  687. },
  688. // 在 data 中添加教育经历的错误提示对象
  689. educationErrors: {
  690. startTime: '',
  691. endTime: '',
  692. schoolName: '',
  693. major: '',
  694. degree: ''
  695. },
  696. // 添加统一的验证规则
  697. validationRules: {
  698. name: {
  699. required: true,
  700. message: '请输入姓名'
  701. },
  702. phone: {
  703. required: true,
  704. pattern: /^1[3-9]\d{9}$/,
  705. message: '请输入正确的手机号码'
  706. },
  707. idCard: {
  708. required: true,
  709. pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
  710. message: '请输入正确的身份证号码'
  711. },
  712. gender: {
  713. required: true,
  714. message: '请选择性别'
  715. },
  716. ethnic: {
  717. required: true,
  718. message: '请选择民族'
  719. },
  720. currentAddress: {
  721. required: true,
  722. message: '请输入现居住地址'
  723. },
  724. height: {
  725. pattern: /^\d+(\.\d{1,2})?$/,
  726. message: '请输入正确的身高(cm)'
  727. },
  728. weight: {
  729. pattern: /^\d+(\.\d{1,2})?$/,
  730. message: '请输入正确的体重(kg)'
  731. },
  732. expectedSalary: {
  733. pattern: /^\d+(\.\d{1,2})?$/,
  734. message: '请输入正确的期望薪资'
  735. }
  736. },
  737. // 获取配置信息
  738. configData: (() => {
  739. try {
  740. const configStr = uni.getStorageSync('configData');
  741. if (configStr && configStr.trim()) {
  742. return JSON.parse(configStr);
  743. }
  744. return {};
  745. } catch (error) {
  746. console.warn('解析配置数据失败:', error);
  747. return {};
  748. }
  749. })()
  750. }
  751. },
  752. onLoad() {
  753. // Fetch user data when component loads
  754. this.fetchUserData();
  755. console.log(this.configData)
  756. },
  757. computed: {
  758. // 添加计算属性来控制按钮显示
  759. showPrevButton() {
  760. return this.currentStep !== 1;
  761. },
  762. showNextButton() {
  763. return this.currentStep !== 8;
  764. },
  765. showSubmitButton() {
  766. return this.currentStep === 8;
  767. },
  768. // 获取当前步骤在数组中的索引
  769. currentStepIndex() {
  770. return this.steps.findIndex(step => step.id === this.currentStep);
  771. },
  772. // 添加安全的配置访问器
  773. safeConfigData() {
  774. return this.configData || {};
  775. },
  776. safeProfileFieldsConfig() {
  777. return this.safeConfigData.profile_fields_config || {};
  778. },
  779. safeFamilyFieldsConfig() {
  780. return this.safeConfigData.family_fields_config || {};
  781. },
  782. safeEducationFieldsConfig() {
  783. return this.safeConfigData.education_fields_config || {};
  784. },
  785. safeWorkFieldsConfig() {
  786. return this.safeConfigData.work_experience_fields_config || {};
  787. },
  788. // 字段显示控制方法
  789. showNameField() {
  790. return Object.keys(this.safeProfileFieldsConfig).length === 0 || this.safeProfileFieldsConfig.name?.visible !== false;
  791. },
  792. showGenderField() {
  793. return Object.keys(this.safeProfileFieldsConfig).length === 0 || this.safeProfileFieldsConfig.gender?.visible !== false;
  794. },
  795. showPhoneField() {
  796. return Object.keys(this.safeProfileFieldsConfig).length === 0 || this.safeProfileFieldsConfig.phone?.visible !== false;
  797. },
  798. showIdCardField() {
  799. return Object.keys(this.safeProfileFieldsConfig).length === 0 || this.safeProfileFieldsConfig.id_card?.visible !== false;
  800. },
  801. showEthnicField() {
  802. return Object.keys(this.safeProfileFieldsConfig).length === 0 || this.safeProfileFieldsConfig.ethnic?.visible !== false;
  803. },
  804. showHeightField() {
  805. return Object.keys(this.safeProfileFieldsConfig).length === 0 || this.safeProfileFieldsConfig.height?.visible !== false;
  806. },
  807. showWeightField() {
  808. return Object.keys(this.safeProfileFieldsConfig).length === 0 || this.safeProfileFieldsConfig.weight?.visible !== false;
  809. },
  810. // 家庭成员字段显示控制
  811. showFamilyRelationField() {
  812. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || this.safeFamilyFieldsConfig.relation?.visible !== false;
  813. },
  814. showFamilyNameField() {
  815. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || this.safeFamilyFieldsConfig.name?.visible !== false;
  816. },
  817. showFamilyWorkplaceField() {
  818. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || this.safeFamilyFieldsConfig.workplace_or_address?.visible !== false;
  819. },
  820. showFamilyPositionField() {
  821. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || this.safeFamilyFieldsConfig.position?.visible !== false;
  822. },
  823. showFamilyPhoneField() {
  824. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || this.safeFamilyFieldsConfig.phone?.visible !== false;
  825. },
  826. // 教育经历字段显示控制
  827. showEducationTimeField() {
  828. return Object.keys(this.safeEducationFieldsConfig).length === 0 || this.safeEducationFieldsConfig.start_time?.visible !== false;
  829. },
  830. showEducationSchoolField() {
  831. return Object.keys(this.safeEducationFieldsConfig).length === 0 || this.safeEducationFieldsConfig.school_name?.visible !== false;
  832. },
  833. showEducationMajorField() {
  834. return Object.keys(this.safeEducationFieldsConfig).length === 0 || this.safeEducationFieldsConfig.major?.visible !== false;
  835. },
  836. showEducationDegreeField() {
  837. return Object.keys(this.safeEducationFieldsConfig).length === 0 || this.safeEducationFieldsConfig.degree?.visible !== false;
  838. },
  839. // 工作经历字段显示控制
  840. showWorkTimeField() {
  841. return Object.keys(this.safeWorkFieldsConfig).length === 0 || this.safeWorkFieldsConfig.start_time?.visible !== false;
  842. },
  843. showWorkCompanyField() {
  844. return Object.keys(this.safeWorkFieldsConfig).length === 0 || this.safeWorkFieldsConfig.company_name?.visible !== false;
  845. },
  846. showWorkDepartmentField() {
  847. return Object.keys(this.safeWorkFieldsConfig).length === 0 || this.safeWorkFieldsConfig.department?.visible !== false;
  848. },
  849. showWorkEmployeeCountField() {
  850. return Object.keys(this.safeWorkFieldsConfig).length === 0 || this.safeWorkFieldsConfig.employee_count?.visible !== false;
  851. },
  852. showWorkPositionField() {
  853. return Object.keys(this.safeWorkFieldsConfig).length === 0 || this.safeWorkFieldsConfig.position?.visible !== false;
  854. },
  855. showRequireProfessionalSkillsField() {//受培训
  856. return this.safeConfigData.require_professional_skills
  857. },
  858. showRequireTrainingInfoField() {//专业技能
  859. return this.safeConfigData.require_training_info
  860. },
  861. shouldShowSkillsStep() {
  862. return this.showRequireTrainingInfoField || this.showRequireProfessionalSkillsField;
  863. },
  864. },
  865. methods: {
  866. // 添加承诺书相关方法
  867. togglePromiseChecked() {
  868. this.promiseChecked = !this.promiseChecked;
  869. },
  870. confirmPromise() {
  871. if (this.promiseChecked) {
  872. this.showPromiseModal = false;
  873. } else {
  874. uni.showToast({
  875. title: '请先阅读并同意承诺书内容',
  876. icon: 'none'
  877. });
  878. }
  879. },
  880. // 添加字段是否需要验证的判断方法
  881. shouldValidateField(fieldName, section) {
  882. section = section || 'profile';
  883. switch (section) {
  884. case 'profile':
  885. const fieldShowMap = {
  886. 'name': this.showNameField,
  887. 'gender': this.showGenderField,
  888. 'phone': this.showPhoneField,
  889. 'idCard': this.showIdCardField,
  890. 'ethnic': this.showEthnicField,
  891. 'height': this.showHeightField,
  892. 'weight': this.showWeightField,
  893. 'currentAddress': true, // 现居住地址总是显示和必填
  894. 'expectedSalary': true, // 期望薪资总是显示
  895. 'skills': this.showRequireTrainingInfoField, // 专业技能根据配置显示和必填
  896. 'training': this.showRequireProfessionalSkillsField, // 培训经历根据配置显示和必填
  897. 'threePeriod': this.formData.gender === '女' // 只有女性时才需要验证三期状态
  898. };
  899. return fieldShowMap[fieldName] !== false;
  900. case 'family':
  901. const familyFieldShowMap = {
  902. 'relation': this.showFamilyRelationField,
  903. 'name': this.showFamilyNameField,
  904. 'phone': this.showFamilyPhoneField,
  905. 'workplaceOrAddress': this.showFamilyWorkplaceField,
  906. 'position': this.showFamilyPositionField
  907. };
  908. return familyFieldShowMap[fieldName] !== false;
  909. case 'education':
  910. const educationFieldShowMap = {
  911. 'startTime': this.showEducationTimeField,
  912. 'endTime': this.showEducationTimeField,
  913. 'schoolName': this.showEducationSchoolField,
  914. 'major': this.showEducationMajorField,
  915. 'degree': this.showEducationDegreeField
  916. };
  917. return educationFieldShowMap[fieldName] !== false;
  918. case 'work':
  919. const workFieldShowMap = {
  920. 'startTime': this.showWorkTimeField,
  921. 'endTime': this.showWorkTimeField,
  922. 'companyName': this.showWorkCompanyField,
  923. 'department': this.showWorkDepartmentField,
  924. 'position': this.showWorkPositionField,
  925. 'employeeCount': this.showWorkEmployeeCountField,
  926. 'monthlySalary': true, // 月薪总是需要验证
  927. 'supervisor': true, // 直接领导总是需要验证
  928. 'supervisorPhone': true // 领导电话总是需要验证
  929. };
  930. return workFieldShowMap[fieldName] !== false;
  931. default:
  932. return true;
  933. }
  934. },
  935. bindGenderChange(e) {
  936. this.genderIndex = e.detail.value;
  937. this.formData.gender = this.genderOptions[this.genderIndex];
  938. // 清除性别的错误提示
  939. if (this.formErrors.gender) {
  940. this.formErrors.gender = '';
  941. }
  942. // 如果性别从女变为男,清空三期选择
  943. if (this.formData.gender !== '女') {
  944. this.formData.threePeriod = '';
  945. this.threePeriodIndex = -1;
  946. this.formErrors.threePeriod = ''; // 清除三期状态的错误提示
  947. }
  948. },
  949. bindThreePeriodChange(e) {
  950. this.threePeriodIndex = e.detail.value;
  951. this.formData.threePeriod = this.threePeriodOptions[this.threePeriodIndex];
  952. // 清除三期状态的错误提示
  953. if (this.formErrors.threePeriod) {
  954. this.formErrors.threePeriod = '';
  955. }
  956. },
  957. bindPoliticalChange(e) {
  958. this.politicalIndex = e.detail.value;
  959. this.formData.political = this.politicalOptions[this.politicalIndex];
  960. },
  961. bindEthnicChange(e) {
  962. this.ethnicIndex = e.detail.value;
  963. this.formData.ethnic = this.ethnicOptions[this.ethnicIndex];
  964. // 清除民族的错误提示
  965. if (this.formErrors.ethnic) {
  966. this.formErrors.ethnic = '';
  967. }
  968. },
  969. bindMarriageChange(e) {
  970. this.marriageIndex = e.detail.value;
  971. this.formData.marriage = this.marriageOptions[this.marriageIndex];
  972. },
  973. bindDateChange(e) {
  974. this.formData.birthDate = e.detail.value;
  975. },
  976. saveFamilyMember() {
  977. // 重置错误信息
  978. this.resetFamilyMemberErrors();
  979. // 验证必填字段
  980. let isValid = true;
  981. // 只验证显示的字段
  982. if (this.shouldValidateField('relation', 'family') && !this.familyMemberForm.relation) {
  983. this.familyMemberErrors.relation = '请输入称谓';
  984. isValid = false;
  985. }
  986. if (this.shouldValidateField('name', 'family') && !this.familyMemberForm.name) {
  987. this.familyMemberErrors.name = '请输入姓名';
  988. isValid = false;
  989. }
  990. if (this.shouldValidateField('workplaceOrAddress', 'family') && !this.familyMemberForm.workplaceOrAddress) {
  991. this.familyMemberErrors.workplaceOrAddress = '请输入工作单位/家庭地址';
  992. isValid = false;
  993. }
  994. if (this.shouldValidateField('position', 'family') && !this.familyMemberForm.position) {
  995. this.familyMemberErrors.position = '请输入职务';
  996. isValid = false;
  997. }
  998. if (this.shouldValidateField('phone', 'family') && !this.familyMemberForm.phone) {
  999. this.familyMemberErrors.phone = '请输入联系电话';
  1000. isValid = false;
  1001. } else if (this.shouldValidateField('phone', 'family') && this.familyMemberForm.phone && !/^1[3-9]\d{9}$/.test(this.familyMemberForm.phone)) {
  1002. this.familyMemberErrors.phone = '请输入正确的手机号';
  1003. isValid = false;
  1004. }
  1005. if (!isValid) {
  1006. uni.showToast({
  1007. title: '请完善家庭成员信息',
  1008. icon: 'none'
  1009. });
  1010. return;
  1011. }
  1012. // 原有的保存逻辑
  1013. if (this.isEditing) {
  1014. this.familyMembers[this.editingIndex] = {...this.familyMemberForm};
  1015. uni.showToast({
  1016. title: '修改成功',
  1017. icon: 'success'
  1018. });
  1019. this.isEditing = false;
  1020. this.editingIndex = -1;
  1021. } else {
  1022. this.familyMembers.push({...this.familyMemberForm});
  1023. uni.showToast({
  1024. title: '添加成功',
  1025. icon: 'success'
  1026. });
  1027. }
  1028. // 重置表单和错误信息
  1029. this.resetFamilyMemberForm();
  1030. },
  1031. // 添加重置错误信息的方法
  1032. resetFamilyMemberErrors() {
  1033. this.familyMemberErrors = {
  1034. relation: '',
  1035. name: '',
  1036. phone: '',
  1037. workplaceOrAddress: '',
  1038. position: ''
  1039. };
  1040. },
  1041. // 修改重置表单的方法
  1042. resetFamilyMemberForm() {
  1043. this.familyMemberForm = {
  1044. relation: '',
  1045. name: '',
  1046. workplaceOrAddress: '',
  1047. position: '',
  1048. phone: '',
  1049. isEmergencyContact: false
  1050. };
  1051. this.resetFamilyMemberErrors();
  1052. },
  1053. editFamilyMember(index) {
  1054. this.isEditing = true;
  1055. this.editingIndex = index;
  1056. this.familyMemberForm = {...this.familyMembers[index]};
  1057. uni.pageScrollTo({
  1058. selector: '.family-member-form',
  1059. duration: 300
  1060. });
  1061. },
  1062. cancelEdit() {
  1063. this.isEditing = false;
  1064. this.editingIndex = -1;
  1065. this.familyMemberForm = {
  1066. relation: '',
  1067. name: '',
  1068. workplaceOrAddress: '',
  1069. position: '',
  1070. phone: '',
  1071. isEmergencyContact: false
  1072. };
  1073. },
  1074. deleteFamilyMember(index) {
  1075. if (this.isEditing && this.editingIndex === index) {
  1076. this.cancelEdit();
  1077. }
  1078. this.familyMembers.splice(index, 1);
  1079. uni.showToast({
  1080. title: '已删除',
  1081. icon: 'none'
  1082. });
  1083. },
  1084. // 选择应聘来源类型
  1085. selectSourceType(type) {
  1086. this.formData.sourceType = type;
  1087. if (type === 'social') {
  1088. // 默认选择第一个社招来源
  1089. this.formData.socialSource = 'BOSS';
  1090. } else {
  1091. // 清空社招来源
  1092. this.formData.socialSource = '';
  1093. }
  1094. },
  1095. // 选择社招来源
  1096. selectSocialSource(source) {
  1097. this.formData.sourceType = 'social';
  1098. this.formData.socialSource = source;
  1099. },
  1100. // 教育经历相关方法
  1101. bindStartTimeChange(e) {
  1102. this.educationForm.startTime = e.detail.value;
  1103. },
  1104. bindEndTimeChange(e) {
  1105. this.educationForm.endTime = e.detail.value;
  1106. },
  1107. bindDegreeChange(e) {
  1108. this.degreeIndex = e.detail.value;
  1109. this.educationForm.degree = this.degreeOptions[this.degreeIndex];
  1110. },
  1111. saveEducation() {
  1112. // 重置错误信息
  1113. this.resetEducationErrors();
  1114. // 验证必填字段
  1115. let isValid = true;
  1116. // 只验证显示的字段
  1117. if (this.shouldValidateField('startTime', 'education') && !this.educationForm.startTime) {
  1118. this.educationErrors.startTime = '请选择开始时间';
  1119. isValid = false;
  1120. }
  1121. if (this.shouldValidateField('endTime', 'education') && !this.educationForm.endTime) {
  1122. this.educationErrors.endTime = '请选择结束时间';
  1123. isValid = false;
  1124. }
  1125. if (this.shouldValidateField('schoolName', 'education') && !this.educationForm.schoolName) {
  1126. this.educationErrors.schoolName = '请输入学校名称';
  1127. isValid = false;
  1128. }
  1129. if (this.shouldValidateField('major', 'education') && !this.educationForm.major) {
  1130. this.educationErrors.major = '请输入专业';
  1131. isValid = false;
  1132. }
  1133. if (this.shouldValidateField('degree', 'education') && !this.educationForm.degree) {
  1134. this.educationErrors.degree = '请选择学历';
  1135. isValid = false;
  1136. }
  1137. if (!isValid) {
  1138. uni.showToast({
  1139. title: '请完善教育经历信息',
  1140. icon: 'none'
  1141. });
  1142. return;
  1143. }
  1144. // 验证通过后的保存逻辑
  1145. if (this.isEditingEducation) {
  1146. this.educationList[this.editingEducationIndex] = {...this.educationForm};
  1147. uni.showToast({
  1148. title: '修改成功',
  1149. icon: 'success'
  1150. });
  1151. this.isEditingEducation = false;
  1152. this.editingEducationIndex = -1;
  1153. } else {
  1154. this.educationList.push({...this.educationForm});
  1155. uni.showToast({
  1156. title: '添加成功',
  1157. icon: 'success'
  1158. });
  1159. }
  1160. // 重置表单
  1161. this.educationForm = {
  1162. startTime: '',
  1163. endTime: '',
  1164. schoolName: '',
  1165. major: '',
  1166. degree: ''
  1167. };
  1168. this.degreeIndex = -1;
  1169. },
  1170. editEducation(index) {
  1171. this.isEditingEducation = true;
  1172. this.editingEducationIndex = index;
  1173. this.educationForm = {...this.educationList[index]};
  1174. // 设置学历索引
  1175. this.degreeIndex = this.degreeOptions.findIndex(item => item === this.educationForm.degree);
  1176. uni.pageScrollTo({
  1177. selector: '.education-form',
  1178. duration: 300
  1179. });
  1180. },
  1181. cancelEditEducation() {
  1182. this.isEditingEducation = false;
  1183. this.editingEducationIndex = -1;
  1184. this.educationForm = {
  1185. startTime: '',
  1186. endTime: '',
  1187. schoolName: '',
  1188. major: '',
  1189. degree: ''
  1190. };
  1191. this.degreeIndex = -1;
  1192. },
  1193. deleteEducation(index) {
  1194. if (this.isEditingEducation && this.editingEducationIndex === index) {
  1195. this.cancelEditEducation();
  1196. }
  1197. this.educationList.splice(index, 1);
  1198. uni.showToast({
  1199. title: '已删除',
  1200. icon: 'none'
  1201. });
  1202. },
  1203. // 工作经历相关方法
  1204. bindWorkStartTimeChange(e) {
  1205. this.workForm.startTime = e.detail.value;
  1206. },
  1207. bindWorkEndTimeChange(e) {
  1208. this.workForm.endTime = e.detail.value;
  1209. },
  1210. saveWork() {
  1211. // 重置所有工作经历相关的错误信息
  1212. this.workErrors = {
  1213. startTime: '',
  1214. endTime: '',
  1215. companyName: '',
  1216. department: '',
  1217. position: '',
  1218. employeeCount: '',
  1219. monthlySalary: '',
  1220. supervisor: '',
  1221. supervisorPhone: ''
  1222. };
  1223. // 验证必填字段
  1224. let isValid = true;
  1225. // 只验证显示的字段
  1226. if (this.shouldValidateField('startTime', 'work') && !this.workForm.startTime) {
  1227. this.workErrors.startTime = '请选择开始时间';
  1228. isValid = false;
  1229. }
  1230. if (this.shouldValidateField('endTime', 'work') && !this.workForm.endTime) {
  1231. this.workErrors.endTime = '请选择结束时间';
  1232. isValid = false;
  1233. }
  1234. if (this.shouldValidateField('companyName', 'work') && !this.workForm.companyName) {
  1235. this.workErrors.companyName = '请输入单位名称';
  1236. isValid = false;
  1237. }
  1238. if (this.shouldValidateField('department', 'work') && !this.workForm.department) {
  1239. this.workErrors.department = '请输入任职部门';
  1240. isValid = false;
  1241. }
  1242. if (this.shouldValidateField('position', 'work') && !this.workForm.position) {
  1243. this.workErrors.position = '请输入担任职务';
  1244. isValid = false;
  1245. }
  1246. if (this.shouldValidateField('employeeCount', 'work') && !this.workForm.employeeCount) {
  1247. this.workErrors.employeeCount = '请输入单位人数';
  1248. isValid = false;
  1249. }
  1250. if (this.shouldValidateField('monthlySalary', 'work') && !this.workForm.monthlySalary) {
  1251. this.workErrors.monthlySalary = '请输入月薪';
  1252. isValid = false;
  1253. }
  1254. if (this.shouldValidateField('supervisor', 'work') && !this.workForm.supervisor) {
  1255. this.workErrors.supervisor = '请输入直属上级';
  1256. isValid = false;
  1257. }
  1258. if (this.shouldValidateField('supervisorPhone', 'work') && !this.workForm.supervisorPhone) {
  1259. this.workErrors.supervisorPhone = '请输入直属上级电话';
  1260. isValid = false;
  1261. }
  1262. // 如果验证不通过,直接返回
  1263. if (!isValid) {
  1264. uni.showToast({
  1265. title: '请完善工作经历信息',
  1266. icon: 'none'
  1267. });
  1268. return;
  1269. }
  1270. // 验证通过后的保存逻辑
  1271. if (this.isEditingWork) {
  1272. this.workList[this.editingWorkIndex] = {...this.workForm};
  1273. uni.showToast({
  1274. title: '修改成功',
  1275. icon: 'success'
  1276. });
  1277. this.isEditingWork = false;
  1278. this.editingWorkIndex = -1;
  1279. } else {
  1280. this.workList.push({...this.workForm});
  1281. uni.showToast({
  1282. title: '添加成功',
  1283. icon: 'success'
  1284. });
  1285. }
  1286. // 重置表单
  1287. this.workForm = {
  1288. startTime: '',
  1289. endTime: '',
  1290. companyName: '',
  1291. department: '',
  1292. employeeCount: '',
  1293. position: '',
  1294. monthlySalary: '',
  1295. supervisor: '',
  1296. supervisorPhone: ''
  1297. };
  1298. },
  1299. editWork(index) {
  1300. this.isEditingWork = true;
  1301. this.editingWorkIndex = index;
  1302. this.workForm = {...this.workList[index]};
  1303. uni.pageScrollTo({
  1304. selector: '.work-form',
  1305. duration: 300
  1306. });
  1307. },
  1308. cancelEditWork() {
  1309. this.isEditingWork = false;
  1310. this.editingWorkIndex = -1;
  1311. this.workForm = {
  1312. startTime: '',
  1313. endTime: '',
  1314. companyName: '',
  1315. department: '',
  1316. employeeCount: '',
  1317. position: '',
  1318. monthlySalary: '',
  1319. supervisor: '',
  1320. supervisorPhone: ''
  1321. };
  1322. },
  1323. deleteWork(index) {
  1324. if (this.isEditingWork && this.editingWorkIndex === index) {
  1325. this.cancelEditWork();
  1326. }
  1327. this.workList.splice(index, 1);
  1328. uni.showToast({
  1329. title: '已删除',
  1330. icon: 'none'
  1331. });
  1332. },
  1333. submitForm() {
  1334. // 先验证当前步骤
  1335. if (!this.validateCurrentStep()) {
  1336. return;
  1337. }
  1338. // 验证所有必填字段
  1339. const allRequired = [
  1340. 'name', 'gender', 'phone', 'idCard', 'ethnic', 'currentAddress'
  1341. ];
  1342. let isValid = true;
  1343. allRequired.forEach(field => {
  1344. // 只验证显示的字段
  1345. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1346. isValid = false;
  1347. }
  1348. });
  1349. // 验证专业技能和培训
  1350. if (this.shouldValidateField('skills') && !this.formData.skills?.trim()) {
  1351. this.formErrors.skills = '请描述您的专业技能';
  1352. isValid = false;
  1353. }
  1354. if (this.shouldValidateField('training') && !this.formData.training?.trim()) {
  1355. this.formErrors.training = '请描述您的培训经历';
  1356. isValid = false;
  1357. }
  1358. if (!isValid) {
  1359. uni.showToast({
  1360. title: '请完善所有必填信息',
  1361. icon: 'none'
  1362. });
  1363. return;
  1364. }
  1365. // 检查必要的用户信息
  1366. const userInfo = uni.getStorageSync('userInfo');
  1367. if (!userInfo) {
  1368. uni.showToast({
  1369. title: '用户信息获取失败,请重新登录',
  1370. icon: 'none',
  1371. duration: 2000
  1372. });
  1373. return;
  1374. }
  1375. try {
  1376. const userData = JSON.parse(userInfo);
  1377. const submitData = {
  1378. tenant_id: 1,
  1379. user_id: userData.id,
  1380. personal_info: {
  1381. name: this.formData.name,
  1382. gender: this.formData.gender,
  1383. phone: this.formData.phone,
  1384. id_card: this.formData.idCard,
  1385. address: this.formData.currentAddress,
  1386. professional_skills: this.formData.skills ? this.formData.skills.split(',') : []
  1387. },
  1388. profile: {
  1389. female_status: this.getFemaleStatus(),
  1390. marital_status: this.getMaritalStatus(),
  1391. height: parseFloat(this.formData.height) || 0,
  1392. weight: parseFloat(this.formData.weight) || 0,
  1393. ethnicity: this.formData.ethnic,
  1394. current_address: this.formData.currentAddress,
  1395. expected_salary: parseFloat(this.formData.expectedSalary) || 0
  1396. },
  1397. educations: this.formatEducations(),
  1398. family_members: this.formatFamilyMembers(),
  1399. work_experiences: this.formatWorkExperiences()
  1400. };
  1401. // 数据检查
  1402. if (!submitData.personal_info.name || !submitData.personal_info.gender || !submitData.personal_info.phone) {
  1403. uni.showToast({
  1404. title: '基本信息不完整',
  1405. icon: 'none',
  1406. duration: 2000
  1407. });
  1408. return;
  1409. }
  1410. this.sendFormData(submitData);
  1411. } catch (error) {
  1412. console.error('数据处理错误:', error);
  1413. uni.showToast({
  1414. title: '数据处理错误,请重试',
  1415. icon: 'none',
  1416. duration: 2000
  1417. });
  1418. }
  1419. },
  1420. // 辅助方法:发送表单数据
  1421. sendFormData(submitData) {
  1422. uni.showLoading({ title: '提交中...' });
  1423. // 添加请求头和token
  1424. const token = uni.getStorageSync('token');
  1425. uni.request({
  1426. url: `${apiBaseUrl}/wechat/user/profile/update`,
  1427. method: 'POST',
  1428. data: submitData,
  1429. header: {
  1430. 'content-type': 'application/json',
  1431. 'Authorization': token ? `Bearer ${token}` : ''
  1432. },
  1433. success: (res) => {
  1434. uni.hideLoading();
  1435. if (res.statusCode === 200) {
  1436. if (res.data.code === 2000) {
  1437. uni.showToast({
  1438. title: '提交成功',
  1439. icon: 'success',
  1440. duration: 2000
  1441. });
  1442. setTimeout(() => {
  1443. uni.navigateTo({
  1444. url: '/pages/interview-notice/interview-notice'
  1445. });
  1446. }, 2000);
  1447. } else {
  1448. uni.showToast({
  1449. title: res.data.msg || '提交失败',
  1450. icon: 'none',
  1451. duration: 2000
  1452. });
  1453. }
  1454. } else {
  1455. uni.showToast({
  1456. title: '服务器响应错误',
  1457. icon: 'none',
  1458. duration: 2000
  1459. });
  1460. }
  1461. },
  1462. fail: (err) => {
  1463. console.error('提交失败:', err);
  1464. uni.hideLoading();
  1465. // 检查具体错误类型
  1466. if (err.errMsg.includes('timeout')) {
  1467. uni.showToast({
  1468. title: '请求超时,请检查网络后重试',
  1469. icon: 'none',
  1470. duration: 2000
  1471. });
  1472. } else if (err.errMsg.includes('fail')) {
  1473. uni.showToast({
  1474. title: '网络连接失败,请检查网络设置',
  1475. icon: 'none',
  1476. duration: 2000
  1477. });
  1478. } else {
  1479. uni.showToast({
  1480. title: '提交失败,请稍后重试',
  1481. icon: 'none',
  1482. duration: 2000
  1483. });
  1484. }
  1485. },
  1486. complete: () => {
  1487. // 可以在这里添加完成后的处理逻辑
  1488. }
  1489. });
  1490. },
  1491. // 数据格式化方法
  1492. getFemaleStatus() {
  1493. if (this.formData.gender !== '女') return 0;
  1494. const statusMap = { '孕期': 1, '产期': 2, '哺乳期': 3 };
  1495. return statusMap[this.formData.threePeriod] || 0;
  1496. },
  1497. getMaritalStatus() {
  1498. const statusMap = { '未婚': 0, '已婚': 1, '离异': 2, '丧偶': 3 };
  1499. return statusMap[this.formData.marriage] || 0;
  1500. },
  1501. formatEducations() {
  1502. return this.educationList.map((edu, index) => ({
  1503. education_type: index === 0 ? 1 : 2,
  1504. degree: this.mapDegreeToNumber(edu.degree),
  1505. start_date: edu.startTime,
  1506. end_date: edu.endTime,
  1507. school_name: edu.schoolName,
  1508. major: edu.major
  1509. }));
  1510. },
  1511. formatFamilyMembers() {
  1512. return this.familyMembers.map(member => ({
  1513. relation: member.relation,
  1514. name: member.name,
  1515. workplace: member.workplaceOrAddress,
  1516. position: member.position,
  1517. phone: member.phone,
  1518. //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
  1519. }));
  1520. },
  1521. formatWorkExperiences() {
  1522. return this.workList.map(work => ({
  1523. start_date: work.startTime,
  1524. end_date: work.endTime,
  1525. company_name: work.companyName,
  1526. department: work.department,
  1527. company_size: work.employeeCount,
  1528. position: work.position,
  1529. monthly_salary: work.monthlySalary,
  1530. supervisor_name: work.supervisor,
  1531. supervisor_phone: work.supervisorPhone
  1532. }));
  1533. },
  1534. // 学历映射辅助方法
  1535. mapDegreeToNumber(degreeText) {
  1536. const degreeMap = {
  1537. '高中': 1,
  1538. '中专': 1,
  1539. '大专': 2,
  1540. '本科': 3,
  1541. '硕士': 4,
  1542. '博士': 5
  1543. };
  1544. return degreeMap[degreeText] || 6; // 默认为其他
  1545. },
  1546. prevStep() {
  1547. const prevIndex = this.currentStepIndex - 1;
  1548. if (prevIndex >= 0) {
  1549. this.currentStep = this.steps[prevIndex].id;
  1550. // 滚动到页面顶部
  1551. uni.pageScrollTo({
  1552. scrollTop: 0,
  1553. duration: 300
  1554. });
  1555. }
  1556. },
  1557. nextStep() {
  1558. // 验证当前步骤
  1559. if (!this.validateCurrentStep()) {
  1560. return;
  1561. }
  1562. // 如果是第一步,需要进行身份验证
  1563. if (this.currentStep === 1) {
  1564. this.verifyIdentity();
  1565. return;
  1566. }
  1567. const nextIndex = this.currentStepIndex + 1;
  1568. if (nextIndex < this.steps.length) {
  1569. // 如果下一步是专业技能步骤(第四步,currentStep === 6),且不需要显示,则跳过
  1570. if (this.steps[nextIndex].id === 6 && !this.shouldShowSkillsStep) {
  1571. // 跳到下下一步
  1572. const skipIndex = nextIndex + 1;
  1573. if (skipIndex < this.steps.length) {
  1574. this.currentStep = this.steps[skipIndex].id;
  1575. }
  1576. } else {
  1577. this.currentStep = this.steps[nextIndex].id;
  1578. }
  1579. // 滚动到页面顶部
  1580. uni.pageScrollTo({
  1581. scrollTop: 0,
  1582. duration: 300
  1583. });
  1584. }
  1585. },
  1586. // 身份验证方法
  1587. verifyIdentity() {
  1588. // 清空错误信息
  1589. this.formErrors = {
  1590. name: '',
  1591. idCard: '',
  1592. phone: ''
  1593. };
  1594. uni.showLoading({
  1595. title: '身份验证中...'
  1596. });
  1597. uni.request({
  1598. url: `${apiBaseUrl}/wechat/identity/verify`,
  1599. method: 'POST',
  1600. data: {
  1601. name: this.formData.name,
  1602. id_number: this.formData.idCard,
  1603. mobile: this.formData.phone
  1604. },
  1605. header: {
  1606. 'content-type': 'application/x-www-form-urlencoded'
  1607. },
  1608. success: (res) => {
  1609. uni.hideLoading();
  1610. console.log(res);
  1611. if (res.data.code === 200) {
  1612. // 验证通过,进入下一步
  1613. const nextIndex = this.currentStepIndex + 1;
  1614. if (nextIndex < this.steps.length) {
  1615. this.currentStep = this.steps[nextIndex].id;
  1616. uni.pageScrollTo({
  1617. scrollTop: 0,
  1618. duration: 300
  1619. });
  1620. }
  1621. /* 保存姓名 */
  1622. this.setUserInfo(this.formData);
  1623. } else {
  1624. // 验证失败,显示错误信息
  1625. this.handleVerificationError(res.data);
  1626. }
  1627. },
  1628. fail: (err) => {
  1629. this.handleRequestError(err);
  1630. }
  1631. });
  1632. },
  1633. setUserInfo(data) {
  1634. uni.request({
  1635. url: `${apiBaseUrl}/wechat/updateUserInfo`,
  1636. method: 'POST',
  1637. data: {
  1638. openid: JSON.parse(uni.getStorageSync('userInfo')).openid,
  1639. name: data.name,
  1640. id_card: data.idCard,
  1641. purePhoneNumber: data.phone,
  1642. tenant_id: 1,
  1643. examine:0
  1644. },
  1645. header: {
  1646. 'content-type': 'application/x-www-form-urlencoded'
  1647. },
  1648. success: (res) => {
  1649. console.log(res);
  1650. }
  1651. });
  1652. },
  1653. // 处理验证错误
  1654. handleVerificationError(data) {
  1655. this.formErrors.name = '姓名验证失败,请检查姓名是否正确';
  1656. this.formErrors.idCard = '身份证号验证失败,请检查身份证号是否正确';
  1657. this.formErrors.phone = '手机号验证失败,请检查手机号是否正确';
  1658. uni.showToast({
  1659. title: data.msg || '身份验证失败',
  1660. icon: 'none'
  1661. });
  1662. },
  1663. // 处理请求错误
  1664. handleRequestError(err) {
  1665. uni.hideLoading();
  1666. uni.showToast({
  1667. title: '网络错误,请检查网络连接',
  1668. icon: 'none',
  1669. duration: 2000
  1670. });
  1671. console.error('请求失败:', err);
  1672. },
  1673. // 验证当前步骤的必填项
  1674. validateCurrentStep() {
  1675. let isValid = true;
  1676. switch (this.currentStep) {
  1677. case 1: // 基本信息
  1678. const basicFields = ['name', 'gender', 'phone', 'idCard', 'ethnic', 'currentAddress'];
  1679. basicFields.forEach(field => {
  1680. // 只验证显示的字段
  1681. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1682. isValid = false;
  1683. }
  1684. });
  1685. // 特殊验证:女性三期状态
  1686. if (this.shouldValidateField('threePeriod') && this.formData.gender === '女' && this.threePeriodIndex === -1) {
  1687. this.formErrors.threePeriod = '请选择三期状态';
  1688. isValid = false;
  1689. }
  1690. // 可选字段验证(如果有值则验证格式)
  1691. if (this.shouldValidateField('height') && this.formData.height) {
  1692. isValid = this.validateField('height', this.formData.height) && isValid;
  1693. }
  1694. if (this.shouldValidateField('weight') && this.formData.weight) {
  1695. isValid = this.validateField('weight', this.formData.weight) && isValid;
  1696. }
  1697. if (this.shouldValidateField('expectedSalary') && this.formData.expectedSalary) {
  1698. isValid = this.validateField('expectedSalary', this.formData.expectedSalary) && isValid;
  1699. }
  1700. break;
  1701. case 3: // 家庭成员
  1702. console.log(this.familyMembers.length);
  1703. if (this.familyMembers.length == 0) {
  1704. uni.showToast({
  1705. title: '请至少添加一位家庭成员',
  1706. icon: 'none'
  1707. });
  1708. isValid = false;
  1709. }
  1710. break;
  1711. case 5: // 教育经历
  1712. if (this.educationList.length === 0) {
  1713. uni.showToast({
  1714. title: '请至少添加一项教育经历',
  1715. icon: 'none'
  1716. });
  1717. isValid = false;
  1718. }
  1719. break;
  1720. case 6: // 专业技能
  1721. if (this.shouldValidateField('skills') && !this.formData.skills?.trim()) {
  1722. this.formErrors.skills = '请描述您的专业技能';
  1723. isValid = false;
  1724. }
  1725. if (this.shouldValidateField('training') && !this.formData.training?.trim()) {
  1726. this.formErrors.training = '请描述您的培训经历';
  1727. isValid = false;
  1728. }
  1729. break;
  1730. case 8: // 工作经历
  1731. if (this.workList.length === 0) {
  1732. uni.showToast({
  1733. title: '请至少添加一项工作经历',
  1734. icon: 'none'
  1735. });
  1736. isValid = false;
  1737. }
  1738. break;
  1739. }
  1740. /* if (!isValid) {
  1741. uni.showToast({
  1742. title: '请完善所有必填信息',
  1743. icon: 'none'
  1744. });
  1745. } */
  1746. return isValid;
  1747. },
  1748. // Add method to fetch user data
  1749. fetchUserData() {
  1750. this.isLoading = true;
  1751. // Get openid from storage
  1752. const userInfo = uni.getStorageSync('userInfo') ? JSON.parse(uni.getStorageSync('userInfo')) : {};
  1753. const openid = userInfo.openid;
  1754. if (!openid) {
  1755. uni.showToast({
  1756. title: '用户信息获取失败,请重新登录',
  1757. icon: 'none'
  1758. });
  1759. this.isLoading = false;
  1760. return;
  1761. }
  1762. uni.request({
  1763. url: `${apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=1&openid=${openid}`,
  1764. method: 'GET',
  1765. success: (res) => {
  1766. // 无论结果如何,都保持承诺书显示状态
  1767. this.showPromiseModal = true;
  1768. /* if (res.data.code === 2000) { */
  1769. // Successfully fetched data
  1770. this.populateFormData(res.data.data);
  1771. /* } else {
  1772. uni.showToast({
  1773. title: res.data.msg || '获取用户信息失败',
  1774. icon: 'none'
  1775. });
  1776. } */
  1777. },
  1778. fail: (err) => {
  1779. /* console.error('获取用户信息失败:', err);
  1780. uni.showToast({
  1781. title: '网络错误,请检查网络连接',
  1782. icon: 'none'
  1783. }); */
  1784. },
  1785. complete: () => {
  1786. this.isLoading = false;
  1787. }
  1788. });
  1789. },
  1790. // Add method to populate form data with fetched data
  1791. populateFormData(data) {
  1792. const { user_info, profile, educations, work_experiences, family_members } = data;
  1793. // Populate basic user info
  1794. if (user_info) {
  1795. this.formData.name = user_info.name || '';
  1796. this.formData.gender = user_info.gender_text || '';
  1797. this.genderIndex = this.genderOptions.findIndex(item => item === this.formData.gender);
  1798. this.formData.idCard = user_info.id_card || '';
  1799. this.formData.phone = user_info.phone || '';
  1800. this.formData.email = user_info.email || '';
  1801. }
  1802. // Populate profile data
  1803. if (profile) {
  1804. // Set political status
  1805. this.formData.political = profile.political_status || '';
  1806. this.politicalIndex = this.politicalOptions.findIndex(item => item === this.formData.political);
  1807. // Set ethnic
  1808. this.formData.ethnic = profile.ethnicity || '';
  1809. this.ethnicIndex = this.ethnicOptions.findIndex(item => item === this.formData.ethnic);
  1810. // Set height and weight
  1811. this.formData.height = profile.height || '';
  1812. this.formData.weight = profile.weight || '';
  1813. // Set native place and residence
  1814. this.formData.nativePlace = profile.native_place || '';
  1815. this.formData.residence = profile.household_location || '';
  1816. // Set current address
  1817. this.formData.currentAddress = profile.current_address || '';
  1818. // Set marriage status
  1819. this.formData.marriage = profile.marital_status_text || '';
  1820. this.marriageIndex = this.marriageOptions.findIndex(item => item === this.formData.marriage);
  1821. // Set three period status for female
  1822. if (this.formData.gender === '女' && profile.female_status !== undefined) {
  1823. const femaleStatusMap = {0: '无', 1: '孕期', 2: '产期', 3: '哺乳期'};
  1824. this.formData.threePeriod = femaleStatusMap[profile.female_status] || '无';
  1825. this.threePeriodIndex = this.threePeriodOptions.findIndex(item => item === this.formData.threePeriod);
  1826. }
  1827. // Set expected salary
  1828. this.formData.expectedSalary = profile.expected_salary || '';
  1829. // Set emergency contact
  1830. this.formData.emergencyContact = profile.emergency_contact || '';
  1831. this.formData.emergencyPhone = profile.emergency_phone || '';
  1832. // Set hobby and motto
  1833. this.formData.hobby = profile.specialties || '';
  1834. this.formData.motto = profile.life_motto || '';
  1835. // Set recruitment source
  1836. const sourceTypeMap = {
  1837. 1: 'school',
  1838. 2: 'social',
  1839. 3: 'social',
  1840. 4: 'social',
  1841. 5: 'social'
  1842. };
  1843. const socialSourceMap = {
  1844. 2: 'BOSS',
  1845. 3: 'zhilian',
  1846. 4: 'liepin',
  1847. 5: 'other'
  1848. };
  1849. this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || 'social';
  1850. if (this.formData.sourceType === 'social') {
  1851. this.formData.socialSource = socialSourceMap[profile.recruitment_source] || '';
  1852. if (this.formData.socialSource === 'other') {
  1853. this.formData.otherSocialSource = profile.recruitment_source_detail || '';
  1854. }
  1855. } else if (this.formData.sourceType === 'school') {
  1856. this.formData.otherSchoolSource = profile.recruitment_source_detail || '';
  1857. }
  1858. }
  1859. // Populate educations data
  1860. if (educations && educations.length > 0) {
  1861. this.educationList = educations.map(edu => {
  1862. const degreeMap = {
  1863. 1: '高中',
  1864. 2: '大专',
  1865. 3: '本科',
  1866. 4: '硕士',
  1867. 5: '博士'
  1868. };
  1869. return {
  1870. startTime: edu.start_date || '',
  1871. endTime: edu.end_date || '',
  1872. schoolName: edu.school_name || '',
  1873. major: edu.major || '',
  1874. degree: degreeMap[edu.degree] || ''
  1875. };
  1876. });
  1877. }
  1878. // Populate work experience data
  1879. if (work_experiences && work_experiences.length > 0) {
  1880. this.workList = work_experiences.map(work => {
  1881. return {
  1882. startTime: work.start_date || '',
  1883. endTime: work.end_date || '',
  1884. companyName: work.company_name || '',
  1885. department: work.department || '',
  1886. employeeCount: work.company_size || '',
  1887. position: work.position || '',
  1888. monthlySalary: work.monthly_salary || '',
  1889. supervisor: work.supervisor_name || '',
  1890. supervisorPhone: work.supervisor_phone || ''
  1891. };
  1892. });
  1893. }
  1894. // Populate family members data
  1895. if (family_members && family_members.length > 0) {
  1896. this.familyMembers = family_members.map(member => {
  1897. return {
  1898. relation: member.relation || '',
  1899. name: member.name || '',
  1900. workplaceOrAddress: member.workplace || '',
  1901. position: member.position || '',
  1902. phone: member.phone || '',
  1903. isEmergencyContact: member.isEmergencyContact || false
  1904. };
  1905. });
  1906. }
  1907. // 移除这段代码,确保承诺书始终显示
  1908. // if (user_info && user_info.is_profile_complete) {
  1909. // this.showPromiseModal = false;
  1910. // }
  1911. },
  1912. // 处理紧急联系人开关变化
  1913. handleEmergencyContactChange(e) {
  1914. this.familyMemberForm.isEmergencyContact = e.detail.value;
  1915. // 如果设置为紧急联系人,自动填充到紧急联系人字段
  1916. if (e.detail.value) {
  1917. this.formData.emergencyContact = this.familyMemberForm.name;
  1918. this.formData.emergencyPhone = this.familyMemberForm.phone;
  1919. }
  1920. },
  1921. // 添加重置教育经历错误信息的方法
  1922. resetEducationErrors() {
  1923. this.educationErrors = {
  1924. startTime: '',
  1925. endTime: '',
  1926. schoolName: '',
  1927. major: '',
  1928. degree: ''
  1929. };
  1930. },
  1931. // 添加通用验证方法
  1932. validateField(fieldName, value) {
  1933. const rule = this.validationRules[fieldName];
  1934. if (!rule) return true;
  1935. // 如果字段被隐藏,不进行验证
  1936. if (!this.shouldValidateField(fieldName)) {
  1937. return true;
  1938. }
  1939. // 重置该字段的错误信息
  1940. this.formErrors[fieldName] = '';
  1941. // 必填验证
  1942. if (rule.required && !value) {
  1943. this.formErrors[fieldName] = rule.message;
  1944. return false;
  1945. }
  1946. // 正则验证
  1947. if (rule.pattern && value && !rule.pattern.test(value)) {
  1948. this.formErrors[fieldName] = rule.message;
  1949. return false;
  1950. }
  1951. return true;
  1952. },
  1953. },
  1954. // 添加监听器来清除错误信息
  1955. watch: {
  1956. 'formData.name': function(newVal) {
  1957. if (newVal && this.formErrors.name) {
  1958. this.formErrors.name = '';
  1959. }
  1960. },
  1961. 'formData.idCard': function(newVal) {
  1962. if (newVal && this.formErrors.idCard) {
  1963. this.formErrors.idCard = '';
  1964. }
  1965. },
  1966. 'formData.phone': function(newVal) {
  1967. if (newVal && this.formErrors.phone) {
  1968. this.formErrors.phone = '';
  1969. }
  1970. },
  1971. 'formData.gender': function(newVal) {
  1972. if (newVal && this.formErrors.gender) {
  1973. this.formErrors.gender = '';
  1974. }
  1975. },
  1976. 'formData.ethnic': function(newVal) {
  1977. if (newVal && this.formErrors.ethnic) {
  1978. this.formErrors.ethnic = '';
  1979. }
  1980. },
  1981. 'formData.currentAddress': function(newVal) {
  1982. if (newVal && this.formErrors.currentAddress) {
  1983. this.formErrors.currentAddress = '';
  1984. }
  1985. },
  1986. 'formData.height': function(newVal) {
  1987. if (newVal && this.formErrors.height) {
  1988. this.formErrors.height = '';
  1989. }
  1990. },
  1991. 'formData.weight': function(newVal) {
  1992. if (newVal && this.formErrors.weight) {
  1993. this.formErrors.weight = '';
  1994. }
  1995. },
  1996. 'formData.expectedSalary': function(newVal) {
  1997. if (newVal && this.formErrors.expectedSalary) {
  1998. this.formErrors.expectedSalary = '';
  1999. }
  2000. },
  2001. 'familyMemberForm.relation': function(newVal) {
  2002. if (newVal) this.familyMemberErrors.relation = '';
  2003. },
  2004. 'familyMemberForm.name': function(newVal) {
  2005. if (newVal) this.familyMemberErrors.name = '';
  2006. },
  2007. 'familyMemberForm.phone': function(newVal) {
  2008. if (newVal) this.familyMemberErrors.phone = '';
  2009. },
  2010. /* 'familyMemberForm.workplaceOrAddress': function(newVal) {
  2011. if (newVal) this.familyMemberErrors.workplaceOrAddress = '';
  2012. },
  2013. 'familyMemberForm.position': function(newVal) {
  2014. if (newVal) this.familyMemberErrors.position = '';
  2015. }, */
  2016. 'workForm.companyName': function(newVal) {
  2017. if (newVal && this.workErrors.companyName) {
  2018. this.workErrors.companyName = '';
  2019. }
  2020. },
  2021. 'workForm.department': function(newVal) {
  2022. if (newVal && this.workErrors.department) {
  2023. this.workErrors.department = '';
  2024. }
  2025. },
  2026. 'workForm.position': function(newVal) {
  2027. if (newVal && this.workErrors.position) {
  2028. this.workErrors.position = '';
  2029. }
  2030. },
  2031. 'workForm.employeeCount': function(newVal) {
  2032. if (newVal && this.workErrors.employeeCount) {
  2033. this.workErrors.employeeCount = '';
  2034. }
  2035. },
  2036. 'workForm.monthlySalary': function(newVal) {
  2037. if (newVal && this.workErrors.monthlySalary) {
  2038. this.workErrors.monthlySalary = '';
  2039. }
  2040. },
  2041. 'workForm.supervisor': function(newVal) {
  2042. if (newVal && this.workErrors.supervisor) {
  2043. this.workErrors.supervisor = '';
  2044. }
  2045. },
  2046. 'workForm.supervisorPhone': function(newVal) {
  2047. if (newVal && this.workErrors.supervisorPhone) {
  2048. this.workErrors.supervisorPhone = '';
  2049. }
  2050. },
  2051. 'formData.training': function(newVal) {
  2052. if (newVal && this.formErrors.training) {
  2053. this.formErrors.training = '';
  2054. }
  2055. },
  2056. 'educationForm.startTime': function(newVal) {
  2057. if (newVal) this.educationErrors.startTime = '';
  2058. },
  2059. 'educationForm.endTime': function(newVal) {
  2060. if (newVal) this.educationErrors.endTime = '';
  2061. },
  2062. 'educationForm.schoolName': function(newVal) {
  2063. if (newVal) this.educationErrors.schoolName = '';
  2064. },
  2065. 'educationForm.major': function(newVal) {
  2066. if (newVal) this.educationErrors.major = '';
  2067. },
  2068. 'educationForm.degree': function(newVal) {
  2069. if (newVal) this.educationErrors.degree = '';
  2070. },
  2071. // 添加对表单字段的实时验证
  2072. 'formData': {
  2073. handler(newVal) {
  2074. // 只验证当前步骤的字段
  2075. const currentStepFields = {
  2076. 1: ['name', 'gender', 'phone', 'idCard', 'ethnic', 'currentAddress', 'height', 'weight', 'expectedSalary'],
  2077. 6: ['skills', 'training']
  2078. }[this.currentStep];
  2079. if (currentStepFields) {
  2080. currentStepFields.forEach(field => {
  2081. if (newVal[field] !== undefined && this.shouldValidateField(field)) {
  2082. this.validateField(field, newVal[field]);
  2083. }
  2084. });
  2085. }
  2086. },
  2087. deep: true
  2088. }
  2089. },
  2090. }
  2091. </script>
  2092. <style>
  2093. .personal-container {
  2094. padding: 20rpx;
  2095. }
  2096. .form-title {
  2097. font-size: 36rpx;
  2098. font-weight: bold;
  2099. text-align: center;
  2100. margin-bottom: 30rpx;
  2101. }
  2102. .form-container {
  2103. background-color: #fff;
  2104. border-radius: 10rpx;
  2105. padding: 20rpx;
  2106. }
  2107. .section-title {
  2108. font-size: 32rpx;
  2109. font-weight: bold;
  2110. margin: 30rpx 0 20rpx 10rpx;
  2111. color: #333;
  2112. border-left: 4rpx solid #0039b3;
  2113. padding-left: 15rpx;
  2114. }
  2115. .form-row {
  2116. display: flex;
  2117. flex-direction: row;
  2118. margin-bottom: 20rpx;
  2119. flex-wrap: wrap;
  2120. }
  2121. .form-item {
  2122. flex: 1;
  2123. min-width: 300rpx;
  2124. margin: 10rpx;
  2125. border-bottom: 1px solid #eee;
  2126. padding-bottom: 10rpx;
  2127. }
  2128. .label {
  2129. font-size: 28rpx;
  2130. color: #333;
  2131. margin-right: 10rpx;
  2132. display: block;
  2133. margin-bottom: 10rpx;
  2134. position: relative;
  2135. padding-left: 14rpx; /* 为星号预留空间 */
  2136. }
  2137. input {
  2138. font-size: 28rpx;
  2139. height: 60rpx;
  2140. }
  2141. .picker-text {
  2142. font-size: 28rpx;
  2143. height: 60rpx;
  2144. line-height: 60rpx;
  2145. color: #666;
  2146. }
  2147. .submit-btn {
  2148. margin-top: 40rpx;
  2149. background-color: #0039b3;
  2150. color: #fff;
  2151. }
  2152. .family-members-list {
  2153. margin-top: 20rpx;
  2154. }
  2155. .family-member-item {
  2156. background-color: #f8f8f8;
  2157. border-radius: 8rpx;
  2158. padding: 20rpx;
  2159. margin-bottom: 20rpx;
  2160. }
  2161. .family-member-header {
  2162. display: flex;
  2163. justify-content: space-between;
  2164. align-items: center;
  2165. margin-bottom: 15rpx;
  2166. border-bottom: 1px solid #eee;
  2167. padding-bottom: 10rpx;
  2168. }
  2169. .family-member-title {
  2170. font-size: 30rpx;
  2171. font-weight: bold;
  2172. color: #333;
  2173. }
  2174. .family-member-actions {
  2175. display: flex;
  2176. gap: 20rpx;
  2177. }
  2178. .family-member-edit {
  2179. font-size: 26rpx;
  2180. color: #1890ff;
  2181. }
  2182. .family-member-delete {
  2183. font-size: 26rpx;
  2184. color: #ff4d4f;
  2185. }
  2186. .form-subtitle {
  2187. font-size: 28rpx;
  2188. font-weight: bold;
  2189. margin-bottom: 20rpx;
  2190. display: flex;
  2191. justify-content: space-between;
  2192. align-items: center;
  2193. }
  2194. .cancel-edit {
  2195. font-size: 26rpx;
  2196. color: #999;
  2197. font-weight: normal;
  2198. }
  2199. .family-member-content {
  2200. padding: 10rpx 0;
  2201. }
  2202. .family-member-row {
  2203. display: flex;
  2204. margin-bottom: 10rpx;
  2205. }
  2206. .family-member-label {
  2207. font-size: 26rpx;
  2208. color: #666;
  2209. width: 200rpx;
  2210. }
  2211. .family-member-value {
  2212. font-size: 26rpx;
  2213. color: #333;
  2214. flex: 1;
  2215. }
  2216. .family-member-form {
  2217. background-color: #fff;
  2218. border-radius: 8rpx;
  2219. padding: 20rpx;
  2220. margin-top: 20rpx;
  2221. }
  2222. .form-row button-row {
  2223. display: flex;
  2224. justify-content: center;
  2225. margin-top: 20rpx;
  2226. }
  2227. .form-item button-container {
  2228. display: flex;
  2229. flex-direction: column;
  2230. align-items: center;
  2231. }
  2232. .circle-btn {
  2233. width: 40rpx;
  2234. height: 40rpx;
  2235. border-radius: 50%;
  2236. background-color: #0039b3;
  2237. display: flex;
  2238. justify-content: center;
  2239. align-items: center;
  2240. margin-bottom: 10rpx;
  2241. }
  2242. .btn-icon {
  2243. font-size: 32rpx;
  2244. color: #fff;
  2245. }
  2246. .btn-text {
  2247. font-size: 28rpx;
  2248. color: #333;
  2249. }
  2250. /* 添加圆形按钮相关样式 */
  2251. .button-row {
  2252. justify-content: center;
  2253. margin-top: 30rpx;
  2254. }
  2255. .button-container {
  2256. display: flex;
  2257. flex-direction: column;
  2258. align-items: center;
  2259. border-bottom: none;
  2260. min-width: auto;
  2261. }
  2262. .circle-btn {
  2263. width: 100rpx;
  2264. height: 100rpx;
  2265. border-radius: 50%;
  2266. padding: 0;
  2267. display: flex;
  2268. align-items: center;
  2269. justify-content: center;
  2270. background-color: #0039b3;
  2271. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.1);
  2272. margin: 0;
  2273. }
  2274. .btn-icon {
  2275. font-size: 50rpx;
  2276. color: #fff;
  2277. line-height: 1;
  2278. }
  2279. .btn-text {
  2280. font-size: 24rpx;
  2281. color: #666;
  2282. margin-top: 10rpx;
  2283. }
  2284. /* 编辑状态下的按钮颜色 */
  2285. .circle-btn.editing {
  2286. background-color: #1890ff;
  2287. }
  2288. /* 移除原来的添加按钮样式 */
  2289. .add-member-btn {
  2290. display: none;
  2291. }
  2292. /* 应聘来源样式 */
  2293. .source-container {
  2294. background-color: #fff;
  2295. border-radius: 10rpx;
  2296. padding: 20rpx;
  2297. margin-bottom: 30rpx;
  2298. }
  2299. .source-row {
  2300. display: flex;
  2301. margin-bottom: 20rpx;
  2302. align-items: flex-start;
  2303. }
  2304. .source-label {
  2305. width: 120rpx;
  2306. font-size: 28rpx;
  2307. color: #333;
  2308. padding-top: 6rpx;
  2309. }
  2310. .source-options {
  2311. flex: 1;
  2312. display: flex;
  2313. flex-wrap: wrap;
  2314. }
  2315. .source-option {
  2316. display: flex;
  2317. align-items: center;
  2318. margin-right: 30rpx;
  2319. margin-bottom: 15rpx;
  2320. }
  2321. .source-option text {
  2322. font-size: 28rpx;
  2323. margin-left: 8rpx;
  2324. }
  2325. .other-option {
  2326. flex-basis: 100%;
  2327. margin-top: 10rpx;
  2328. }
  2329. .other-option input {
  2330. border-bottom: 1px solid #eee;
  2331. width: 300rpx;
  2332. margin-left: 10rpx;
  2333. font-size: 28rpx;
  2334. }
  2335. /* 教育经历样式 */
  2336. .education-list {
  2337. margin-top: 20rpx;
  2338. }
  2339. .education-item {
  2340. background-color: #f8f8f8;
  2341. border-radius: 8rpx;
  2342. padding: 20rpx;
  2343. margin-bottom: 20rpx;
  2344. }
  2345. .education-header {
  2346. display: flex;
  2347. justify-content: space-between;
  2348. align-items: center;
  2349. margin-bottom: 15rpx;
  2350. border-bottom: 1px solid #eee;
  2351. padding-bottom: 10rpx;
  2352. }
  2353. .education-title {
  2354. font-size: 30rpx;
  2355. font-weight: bold;
  2356. color: #333;
  2357. }
  2358. .education-actions {
  2359. display: flex;
  2360. gap: 20rpx;
  2361. }
  2362. .education-edit {
  2363. font-size: 26rpx;
  2364. color: #1890ff;
  2365. }
  2366. .education-delete {
  2367. font-size: 26rpx;
  2368. color: #ff4d4f;
  2369. }
  2370. .education-content {
  2371. padding: 10rpx 0;
  2372. }
  2373. .education-row {
  2374. display: flex;
  2375. margin-bottom: 10rpx;
  2376. }
  2377. .education-label {
  2378. font-size: 26rpx;
  2379. color: #666;
  2380. width: 150rpx;
  2381. }
  2382. .education-value {
  2383. font-size: 26rpx;
  2384. color: #333;
  2385. flex: 1;
  2386. }
  2387. .education-form {
  2388. background-color: #fff;
  2389. border-radius: 8rpx;
  2390. padding: 20rpx;
  2391. margin-top: 20rpx;
  2392. }
  2393. .date-range {
  2394. display: flex;
  2395. align-items: center;
  2396. justify-content: space-around;
  2397. }
  2398. .date-separator {
  2399. margin: 0 10rpx;
  2400. color: #666;
  2401. }
  2402. /* 专业技能和培训样式 */
  2403. .skills-container, .training-container {
  2404. background-color: #fff;
  2405. border-radius: 10rpx;
  2406. padding: 20rpx;
  2407. margin-bottom: 20rpx;
  2408. }
  2409. .skills-textarea, .training-textarea {
  2410. width: 100%;
  2411. height: 200rpx;
  2412. font-size: 28rpx;
  2413. line-height: 1.5;
  2414. padding: 10rpx;
  2415. box-sizing: border-box;
  2416. border: 1px solid #eee;
  2417. border-radius: 6rpx;
  2418. }
  2419. /* 工作经历样式 */
  2420. .work-list {
  2421. margin-top: 20rpx;
  2422. }
  2423. .work-item {
  2424. background-color: #f8f8f8;
  2425. border-radius: 8rpx;
  2426. padding: 20rpx;
  2427. margin-bottom: 20rpx;
  2428. }
  2429. .work-header {
  2430. display: flex;
  2431. justify-content: space-between;
  2432. align-items: center;
  2433. margin-bottom: 15rpx;
  2434. border-bottom: 1px solid #eee;
  2435. padding-bottom: 10rpx;
  2436. }
  2437. .work-title {
  2438. font-size: 30rpx;
  2439. font-weight: bold;
  2440. color: #333;
  2441. }
  2442. .work-actions {
  2443. display: flex;
  2444. gap: 20rpx;
  2445. }
  2446. .work-edit {
  2447. font-size: 26rpx;
  2448. color: #1890ff;
  2449. }
  2450. .work-delete {
  2451. font-size: 26rpx;
  2452. color: #ff4d4f;
  2453. }
  2454. .work-content {
  2455. padding: 10rpx 0;
  2456. }
  2457. .work-row {
  2458. display: flex;
  2459. margin-bottom: 10rpx;
  2460. }
  2461. .work-label {
  2462. font-size: 26rpx;
  2463. color: #666;
  2464. width: 150rpx;
  2465. }
  2466. .work-value {
  2467. font-size: 26rpx;
  2468. color: #333;
  2469. flex: 1;
  2470. }
  2471. .work-form {
  2472. background-color: #fff;
  2473. border-radius: 8rpx;
  2474. padding: 20rpx;
  2475. margin-top: 20rpx;
  2476. }
  2477. /* 步骤指示器样式 */
  2478. .steps-indicator {
  2479. display: flex;
  2480. justify-content: space-between;
  2481. margin-bottom: 30rpx;
  2482. padding: 20rpx;
  2483. background-color: #fff;
  2484. border-radius: 10rpx;
  2485. overflow-x: auto;
  2486. }
  2487. .step-item {
  2488. display: flex;
  2489. flex-direction: column;
  2490. align-items: center;
  2491. position: relative;
  2492. min-width: 120rpx;
  2493. }
  2494. .step-item:not(:last-child)::after {
  2495. content: '';
  2496. position: absolute;
  2497. top: 20rpx;
  2498. right: -50%;
  2499. width: 100%;
  2500. height: 2rpx;
  2501. background-color: #ddd;
  2502. z-index: 1;
  2503. }
  2504. .step-item.active:not(:last-child)::after {
  2505. background-color: #0039b3;
  2506. }
  2507. .step-number {
  2508. width: 40rpx;
  2509. height: 40rpx;
  2510. border-radius: 50%;
  2511. background-color: #ddd;
  2512. color: #fff;
  2513. display: flex;
  2514. justify-content: center;
  2515. align-items: center;
  2516. font-size: 24rpx;
  2517. margin-bottom: 10rpx;
  2518. position: relative;
  2519. z-index: 2;
  2520. }
  2521. .step-item.active .step-number {
  2522. background-color: #0039b3;
  2523. }
  2524. .step-item.current .step-number {
  2525. background-color: #0039b3;
  2526. box-shadow: 0 0 0 4rpx rgba(0, 122, 255, 0.2);
  2527. }
  2528. .step-name {
  2529. font-size: 22rpx;
  2530. color: #999;
  2531. text-align: center;
  2532. }
  2533. .step-item.active .step-name {
  2534. color: #333;
  2535. }
  2536. .step-item.current .step-name {
  2537. color: #0039b3;
  2538. font-weight: bold;
  2539. }
  2540. /* 导航按钮样式 */
  2541. .nav-buttons {
  2542. display: flex;
  2543. justify-content: space-between;
  2544. margin-top: 40rpx;
  2545. padding: 0 20rpx;
  2546. }
  2547. .nav-btn {
  2548. flex: 1;
  2549. margin: 0 10rpx;
  2550. height: 80rpx;
  2551. line-height: 80rpx;
  2552. text-align: center;
  2553. border-radius: 40rpx;
  2554. font-size: 28rpx;
  2555. }
  2556. .prev-btn {
  2557. background-color: #f0f0f0;
  2558. color: #666;
  2559. }
  2560. .next-btn {
  2561. background-color: #0039b3;
  2562. color: #fff;
  2563. }
  2564. .submit-btn {
  2565. flex: 1;
  2566. margin: 0 10rpx;
  2567. height: 80rpx;
  2568. line-height: 80rpx;
  2569. text-align: center;
  2570. border-radius: 40rpx;
  2571. font-size: 28rpx;
  2572. background-color: #0039b3;
  2573. color: #fff;
  2574. }
  2575. /* 确认提交页样式 */
  2576. .confirm-container {
  2577. background-color: #fff;
  2578. border-radius: 10rpx;
  2579. padding: 20rpx;
  2580. margin-bottom: 30rpx;
  2581. }
  2582. .confirm-message {
  2583. padding: 20rpx;
  2584. background-color: #f6f6f6;
  2585. border-radius: 8rpx;
  2586. margin-bottom: 20rpx;
  2587. }
  2588. .info-summary {
  2589. padding: 20rpx;
  2590. }
  2591. .summary-item {
  2592. display: flex;
  2593. margin-bottom: 15rpx;
  2594. }
  2595. .summary-label {
  2596. width: 150rpx;
  2597. font-size: 28rpx;
  2598. color: #666;
  2599. }
  2600. .summary-value {
  2601. flex: 1;
  2602. font-size: 28rpx;
  2603. color: #333;
  2604. }
  2605. .input-error {
  2606. border-bottom: 1px solid #ff4d4f !important;
  2607. }
  2608. .error-message {
  2609. color: #ff4d4f;
  2610. font-size: 24rpx;
  2611. margin-top: 6rpx;
  2612. display: block;
  2613. }
  2614. /* 添加承诺书弹框样式 */
  2615. .promise-modal {
  2616. position: fixed;
  2617. top: 0;
  2618. left: 0;
  2619. right: 0;
  2620. bottom: 0;
  2621. background-color: rgba(0, 0, 0, 0.5);
  2622. z-index: 999;
  2623. display: flex;
  2624. justify-content: center;
  2625. align-items: center;
  2626. }
  2627. .promise-content {
  2628. width: 80%;
  2629. max-width: 600rpx;
  2630. background-color: #fff;
  2631. border-radius: 12rpx;
  2632. padding: 30rpx;
  2633. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
  2634. }
  2635. .promise-title {
  2636. font-size: 34rpx;
  2637. font-weight: bold;
  2638. text-align: center;
  2639. margin-bottom: 20rpx;
  2640. color: #333;
  2641. }
  2642. .promise-text {
  2643. height: 600rpx;
  2644. margin-bottom: 20rpx;
  2645. /* padding: 20rpx; */
  2646. background-color: #f8f8f8;
  2647. border-radius: 8rpx;
  2648. font-size: 28rpx;
  2649. line-height: 1.6;
  2650. color: #333;
  2651. }
  2652. .promise-checkbox {
  2653. display: flex;
  2654. align-items: center;
  2655. margin-bottom: 30rpx;
  2656. padding: 0 10rpx;
  2657. }
  2658. .promise-checkbox text {
  2659. font-size: 28rpx;
  2660. margin-left: 10rpx;
  2661. color: #333;
  2662. }
  2663. .promise-buttons {
  2664. display: flex;
  2665. justify-content: center;
  2666. }
  2667. .promise-btn {
  2668. width: 200rpx;
  2669. height: 80rpx;
  2670. line-height: 80rpx;
  2671. text-align: center;
  2672. border-radius: 40rpx;
  2673. font-size: 28rpx;
  2674. }
  2675. .confirm-btn {
  2676. background-color: #0039b3;
  2677. color: #fff;
  2678. }
  2679. .confirm-btn[disabled] {
  2680. background-color: #cccccc;
  2681. color: #ffffff;
  2682. }
  2683. /* Loading indicator styles */
  2684. .loading-container {
  2685. position: fixed;
  2686. top: 0;
  2687. left: 0;
  2688. right: 0;
  2689. bottom: 0;
  2690. background-color: rgba(255, 255, 255, 0.8);
  2691. display: flex;
  2692. flex-direction: column;
  2693. justify-content: center;
  2694. align-items: center;
  2695. z-index: 1000;
  2696. }
  2697. .loading-spinner {
  2698. width: 60rpx;
  2699. height: 60rpx;
  2700. border: 6rpx solid #f3f3f3;
  2701. border-top: 6rpx solid #0039b3;
  2702. border-radius: 50%;
  2703. animation: spin 1s linear infinite;
  2704. margin-bottom: 20rpx;
  2705. }
  2706. .loading-text {
  2707. font-size: 28rpx;
  2708. color: #666;
  2709. }
  2710. @keyframes spin {
  2711. 0% { transform: rotate(0deg); }
  2712. 100% { transform: rotate(360deg); }
  2713. }
  2714. /* 添加开关样式 */
  2715. .form-item switch {
  2716. margin-top: 10rpx;
  2717. }
  2718. /* 修改必填项标签的样式 */
  2719. .label.required::before {
  2720. content: '*';
  2721. color: #ff4d4f;
  2722. margin-right: 4rpx;
  2723. position: absolute;
  2724. left: 0;
  2725. top: -4rpx;
  2726. }
  2727. /* 修改必填项标签的样式 */
  2728. /* .label.required::after {
  2729. content: '*';
  2730. color: #ff4d4f;
  2731. margin-left: 4rpx;
  2732. } */
  2733. </style>