Personal.vue 87 KB

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