Personal.vue 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145
  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. const startTime = e.detail.value;
  1127. if (this.educationForm.endTime && startTime > this.educationForm.endTime) {
  1128. uni.showToast({
  1129. title: '开始时间不能大于结束时间',
  1130. icon: 'none'
  1131. });
  1132. return;
  1133. }
  1134. this.educationForm.startTime = startTime;
  1135. this.educationErrors.startTime = false;
  1136. },
  1137. bindEndTimeChange(e) {
  1138. const endTime = e.detail.value;
  1139. if (this.educationForm.startTime && endTime < this.educationForm.startTime) {
  1140. uni.showToast({
  1141. title: '结束时间不能小于开始时间',
  1142. icon: 'none'
  1143. });
  1144. return;
  1145. }
  1146. this.educationForm.endTime = endTime;
  1147. this.educationErrors.endTime = false;
  1148. },
  1149. bindDegreeChange(e) {
  1150. this.degreeIndex = e.detail.value;
  1151. this.educationForm.degree = this.degreeOptions[this.degreeIndex];
  1152. },
  1153. saveEducation() {
  1154. // 重置错误信息
  1155. this.resetEducationErrors();
  1156. // 验证必填字段
  1157. let isValid = true;
  1158. // 只验证显示的字段
  1159. if (this.shouldValidateField('startTime', 'education') && !this.educationForm.startTime) {
  1160. this.educationErrors.startTime = '请选择开始时间';
  1161. isValid = false;
  1162. }
  1163. if (this.shouldValidateField('endTime', 'education') && !this.educationForm.endTime) {
  1164. this.educationErrors.endTime = '请选择结束时间';
  1165. isValid = false;
  1166. }
  1167. if (this.shouldValidateField('schoolName', 'education') && !this.educationForm.schoolName) {
  1168. this.educationErrors.schoolName = '请输入学校名称';
  1169. isValid = false;
  1170. }
  1171. if (this.shouldValidateField('major', 'education') && !this.educationForm.major) {
  1172. this.educationErrors.major = '请输入专业';
  1173. isValid = false;
  1174. }
  1175. if (this.shouldValidateField('degree', 'education') && !this.educationForm.degree) {
  1176. this.educationErrors.degree = '请选择学历';
  1177. isValid = false;
  1178. }
  1179. if (!isValid) {
  1180. uni.showToast({
  1181. title: '请完善教育经历信息',
  1182. icon: 'none'
  1183. });
  1184. return;
  1185. }
  1186. // 验证通过后的保存逻辑
  1187. if (this.isEditingEducation) {
  1188. this.educationList[this.editingEducationIndex] = {...this.educationForm};
  1189. uni.showToast({
  1190. title: '修改成功',
  1191. icon: 'success'
  1192. });
  1193. this.isEditingEducation = false;
  1194. this.editingEducationIndex = -1;
  1195. } else {
  1196. this.educationList.push({...this.educationForm});
  1197. uni.showToast({
  1198. title: '添加成功',
  1199. icon: 'success'
  1200. });
  1201. }
  1202. // 重置表单
  1203. this.educationForm = {
  1204. startTime: '',
  1205. endTime: '',
  1206. schoolName: '',
  1207. major: '',
  1208. degree: ''
  1209. };
  1210. this.degreeIndex = -1;
  1211. },
  1212. editEducation(index) {
  1213. this.isEditingEducation = true;
  1214. this.editingEducationIndex = index;
  1215. this.educationForm = {...this.educationList[index]};
  1216. // 设置学历索引
  1217. this.degreeIndex = this.degreeOptions.findIndex(item => item === this.educationForm.degree);
  1218. uni.pageScrollTo({
  1219. selector: '.education-form',
  1220. duration: 300
  1221. });
  1222. },
  1223. cancelEditEducation() {
  1224. this.isEditingEducation = false;
  1225. this.editingEducationIndex = -1;
  1226. this.educationForm = {
  1227. startTime: '',
  1228. endTime: '',
  1229. schoolName: '',
  1230. major: '',
  1231. degree: ''
  1232. };
  1233. this.degreeIndex = -1;
  1234. },
  1235. deleteEducation(index) {
  1236. if (this.isEditingEducation && this.editingEducationIndex === index) {
  1237. this.cancelEditEducation();
  1238. }
  1239. this.educationList.splice(index, 1);
  1240. uni.showToast({
  1241. title: '已删除',
  1242. icon: 'none'
  1243. });
  1244. },
  1245. // 工作经历相关方法
  1246. bindWorkStartTimeChange(e) {
  1247. const startTime = e.detail.value;
  1248. if (this.workForm.endTime && startTime > this.workForm.endTime) {
  1249. uni.showToast({
  1250. title: '开始时间不能大于结束时间',
  1251. icon: 'none'
  1252. });
  1253. return;
  1254. }
  1255. this.workForm.startTime = startTime;
  1256. this.workErrors.startTime = false;
  1257. },
  1258. bindWorkEndTimeChange(e) {
  1259. const endTime = e.detail.value;
  1260. if (this.workForm.startTime && endTime < this.workForm.startTime) {
  1261. uni.showToast({
  1262. title: '结束时间不能小于开始时间',
  1263. icon: 'none'
  1264. });
  1265. return;
  1266. }
  1267. this.workForm.endTime = endTime;
  1268. this.workErrors.endTime = false;
  1269. },
  1270. saveWork() {
  1271. // 重置所有工作经历相关的错误信息
  1272. this.workErrors = {
  1273. startTime: '',
  1274. endTime: '',
  1275. companyName: '',
  1276. department: '',
  1277. position: '',
  1278. employeeCount: '',
  1279. monthlySalary: '',
  1280. supervisor: '',
  1281. supervisorPhone: ''
  1282. };
  1283. // 验证必填字段
  1284. let isValid = true;
  1285. // 只验证显示的字段
  1286. if (this.shouldValidateField('startTime', 'work') && !this.workForm.startTime) {
  1287. this.workErrors.startTime = '请选择开始时间';
  1288. isValid = false;
  1289. }
  1290. if (this.shouldValidateField('endTime', 'work') && !this.workForm.endTime) {
  1291. this.workErrors.endTime = '请选择结束时间';
  1292. isValid = false;
  1293. }
  1294. if (this.shouldValidateField('companyName', 'work') && !this.workForm.companyName) {
  1295. this.workErrors.companyName = '请输入单位名称';
  1296. isValid = false;
  1297. }
  1298. if (this.shouldValidateField('department', 'work') && !this.workForm.department) {
  1299. this.workErrors.department = '请输入任职部门';
  1300. isValid = false;
  1301. }
  1302. if (this.shouldValidateField('position', 'work') && !this.workForm.position) {
  1303. this.workErrors.position = '请输入担任职务';
  1304. isValid = false;
  1305. }
  1306. if (this.shouldValidateField('employeeCount', 'work') && !this.workForm.employeeCount) {
  1307. this.workErrors.employeeCount = '请输入单位人数';
  1308. isValid = false;
  1309. }
  1310. if (this.shouldValidateField('monthlySalary', 'work') && !this.workForm.monthlySalary) {
  1311. this.workErrors.monthlySalary = '请输入月薪';
  1312. isValid = false;
  1313. }
  1314. if (this.shouldValidateField('supervisor', 'work') && !this.workForm.supervisor) {
  1315. this.workErrors.supervisor = '请输入直属上级';
  1316. isValid = false;
  1317. }
  1318. if (this.shouldValidateField('supervisorPhone', 'work') && !this.workForm.supervisorPhone) {
  1319. this.workErrors.supervisorPhone = '请输入直属上级电话';
  1320. isValid = false;
  1321. }
  1322. // 如果验证不通过,直接返回
  1323. if (!isValid) {
  1324. uni.showToast({
  1325. title: '请完善工作经历信息',
  1326. icon: 'none'
  1327. });
  1328. return;
  1329. }
  1330. // 验证通过后的保存逻辑
  1331. if (this.isEditingWork) {
  1332. this.workList[this.editingWorkIndex] = {...this.workForm};
  1333. uni.showToast({
  1334. title: '修改成功',
  1335. icon: 'success'
  1336. });
  1337. this.isEditingWork = false;
  1338. this.editingWorkIndex = -1;
  1339. } else {
  1340. this.workList.push({...this.workForm});
  1341. uni.showToast({
  1342. title: '添加成功',
  1343. icon: 'success'
  1344. });
  1345. }
  1346. // 重置表单
  1347. this.workForm = {
  1348. startTime: '',
  1349. endTime: '',
  1350. companyName: '',
  1351. department: '',
  1352. employeeCount: '',
  1353. position: '',
  1354. monthlySalary: '',
  1355. supervisor: '',
  1356. supervisorPhone: ''
  1357. };
  1358. },
  1359. editWork(index) {
  1360. this.isEditingWork = true;
  1361. this.editingWorkIndex = index;
  1362. this.workForm = {...this.workList[index]};
  1363. uni.pageScrollTo({
  1364. selector: '.work-form',
  1365. duration: 300
  1366. });
  1367. },
  1368. cancelEditWork() {
  1369. this.isEditingWork = false;
  1370. this.editingWorkIndex = -1;
  1371. this.workForm = {
  1372. startTime: '',
  1373. endTime: '',
  1374. companyName: '',
  1375. department: '',
  1376. employeeCount: '',
  1377. position: '',
  1378. monthlySalary: '',
  1379. supervisor: '',
  1380. supervisorPhone: ''
  1381. };
  1382. },
  1383. deleteWork(index) {
  1384. if (this.isEditingWork && this.editingWorkIndex === index) {
  1385. this.cancelEditWork();
  1386. }
  1387. this.workList.splice(index, 1);
  1388. uni.showToast({
  1389. title: '已删除',
  1390. icon: 'none'
  1391. });
  1392. },
  1393. submitForm() {
  1394. // 先验证当前步骤
  1395. if (!this.validateCurrentStep()) {
  1396. return;
  1397. }
  1398. // 验证所有必填字段
  1399. const allRequired = [
  1400. 'name', 'gender', 'phone', 'idCard', 'ethnic', 'currentAddress'
  1401. ];
  1402. let isValid = true;
  1403. allRequired.forEach(field => {
  1404. // 只验证显示的字段
  1405. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1406. isValid = false;
  1407. }
  1408. });
  1409. // 验证专业技能和培训
  1410. if (this.shouldValidateField('skills') && !this.formData.skills?.trim()) {
  1411. this.formErrors.skills = '请描述您的专业技能';
  1412. isValid = false;
  1413. }
  1414. if (this.shouldValidateField('training') && !this.formData.training?.trim()) {
  1415. this.formErrors.training = '请描述您的培训经历';
  1416. isValid = false;
  1417. }
  1418. if (!isValid) {
  1419. uni.showToast({
  1420. title: '请完善所有必填信息',
  1421. icon: 'none'
  1422. });
  1423. return;
  1424. }
  1425. // 检查必要的用户信息
  1426. const userInfo = uni.getStorageSync('userInfo');
  1427. if (!userInfo) {
  1428. uni.showToast({
  1429. title: '用户信息获取失败,请重新登录',
  1430. icon: 'none',
  1431. duration: 2000
  1432. });
  1433. return;
  1434. }
  1435. try {
  1436. const userData = JSON.parse(userInfo);
  1437. const submitData = {
  1438. tenant_id: 1,
  1439. user_id: userData.id,
  1440. personal_info: {
  1441. name: this.formData.name,
  1442. gender: this.formData.gender,
  1443. phone: this.formData.phone,
  1444. id_card: this.formData.idCard,
  1445. address: this.formData.currentAddress,
  1446. professional_skills: this.formData.skills ? this.formData.skills.split(',') : []
  1447. },
  1448. profile: {
  1449. female_status: this.getFemaleStatus(),
  1450. marital_status: this.getMaritalStatus(),
  1451. height: parseFloat(this.formData.height) || 0,
  1452. weight: parseFloat(this.formData.weight) || 0,
  1453. ethnicity: this.formData.ethnic,
  1454. current_address: this.formData.currentAddress,
  1455. expected_salary: parseFloat(this.formData.expectedSalary) || 0
  1456. },
  1457. educations: this.formatEducations(),
  1458. family_members: this.formatFamilyMembers(),
  1459. work_experiences: this.formatWorkExperiences()
  1460. };
  1461. // 数据检查
  1462. if (!submitData.personal_info.name || !submitData.personal_info.gender || !submitData.personal_info.phone) {
  1463. uni.showToast({
  1464. title: '基本信息不完整',
  1465. icon: 'none',
  1466. duration: 2000
  1467. });
  1468. return;
  1469. }
  1470. this.sendFormData(submitData);
  1471. } catch (error) {
  1472. console.error('数据处理错误:', error);
  1473. uni.showToast({
  1474. title: '数据处理错误,请重试',
  1475. icon: 'none',
  1476. duration: 2000
  1477. });
  1478. }
  1479. },
  1480. // 辅助方法:发送表单数据
  1481. sendFormData(submitData) {
  1482. uni.showLoading({ title: '提交中...' });
  1483. // 添加请求头和token
  1484. const token = uni.getStorageSync('token');
  1485. uni.request({
  1486. url: `${apiBaseUrl}/wechat/user/profile/update`,
  1487. method: 'POST',
  1488. data: submitData,
  1489. header: {
  1490. 'content-type': 'application/json',
  1491. 'Authorization': token ? `Bearer ${token}` : ''
  1492. },
  1493. success: (res) => {
  1494. uni.hideLoading();
  1495. if (res.statusCode === 200) {
  1496. if (res.data.code === 2000) {
  1497. uni.showToast({
  1498. title: '提交成功',
  1499. icon: 'success',
  1500. duration: 2000
  1501. });
  1502. setTimeout(() => {
  1503. uni.navigateTo({
  1504. url: '/pages/interview-notice/interview-notice'
  1505. });
  1506. }, 2000);
  1507. } else {
  1508. uni.showToast({
  1509. title: res.data.msg || '提交失败',
  1510. icon: 'none',
  1511. duration: 2000
  1512. });
  1513. }
  1514. } else {
  1515. uni.showToast({
  1516. title: '服务器响应错误',
  1517. icon: 'none',
  1518. duration: 2000
  1519. });
  1520. }
  1521. },
  1522. fail: (err) => {
  1523. console.error('提交失败:', err);
  1524. uni.hideLoading();
  1525. // 检查具体错误类型
  1526. if (err.errMsg.includes('timeout')) {
  1527. uni.showToast({
  1528. title: '请求超时,请检查网络后重试',
  1529. icon: 'none',
  1530. duration: 2000
  1531. });
  1532. } else if (err.errMsg.includes('fail')) {
  1533. uni.showToast({
  1534. title: '网络连接失败,请检查网络设置',
  1535. icon: 'none',
  1536. duration: 2000
  1537. });
  1538. } else {
  1539. uni.showToast({
  1540. title: '提交失败,请稍后重试',
  1541. icon: 'none',
  1542. duration: 2000
  1543. });
  1544. }
  1545. },
  1546. complete: () => {
  1547. // 可以在这里添加完成后的处理逻辑
  1548. }
  1549. });
  1550. },
  1551. // 数据格式化方法
  1552. getFemaleStatus() {
  1553. if (this.formData.gender !== '女') return 0;
  1554. const statusMap = { '孕期': 1, '产期': 2, '哺乳期': 3 };
  1555. return statusMap[this.formData.threePeriod] || 0;
  1556. },
  1557. getMaritalStatus() {
  1558. const statusMap = { '未婚': 0, '已婚': 1, '离异': 2, '丧偶': 3 };
  1559. return statusMap[this.formData.marriage] || 0;
  1560. },
  1561. formatEducations() {
  1562. return this.educationList.map((edu, index) => ({
  1563. education_type: index === 0 ? 1 : 2,
  1564. degree: this.mapDegreeToNumber(edu.degree),
  1565. start_date: edu.startTime,
  1566. end_date: edu.endTime,
  1567. school_name: edu.schoolName,
  1568. major: edu.major
  1569. }));
  1570. },
  1571. formatFamilyMembers() {
  1572. return this.familyMembers.map(member => ({
  1573. relation: member.relation,
  1574. name: member.name,
  1575. workplace: member.workplaceOrAddress,
  1576. position: member.position,
  1577. phone: member.phone,
  1578. //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
  1579. }));
  1580. },
  1581. formatWorkExperiences() {
  1582. return this.workList.map(work => ({
  1583. start_date: work.startTime,
  1584. end_date: work.endTime,
  1585. company_name: work.companyName,
  1586. department: work.department,
  1587. company_size: work.employeeCount,
  1588. position: work.position,
  1589. monthly_salary: work.monthlySalary,
  1590. supervisor_name: work.supervisor,
  1591. supervisor_phone: work.supervisorPhone
  1592. }));
  1593. },
  1594. // 学历映射辅助方法
  1595. mapDegreeToNumber(degreeText) {
  1596. const degreeMap = {
  1597. '高中': 1,
  1598. '中专': 1,
  1599. '大专': 2,
  1600. '本科': 3,
  1601. '硕士': 4,
  1602. '博士': 5
  1603. };
  1604. return degreeMap[degreeText] || 6; // 默认为其他
  1605. },
  1606. prevStep() {
  1607. const prevIndex = this.currentStepIndex - 1;
  1608. if (prevIndex >= 0) {
  1609. this.currentStep = this.steps[prevIndex].id;
  1610. // 滚动到页面顶部
  1611. uni.pageScrollTo({
  1612. scrollTop: 0,
  1613. duration: 300
  1614. });
  1615. }
  1616. },
  1617. nextStep() {
  1618. // 验证当前步骤
  1619. if (!this.validateCurrentStep()) {
  1620. return;
  1621. }
  1622. // 如果是第一步,需要进行身份验证
  1623. if (this.currentStep === 1) {
  1624. this.verifyIdentity();
  1625. return;
  1626. }
  1627. const nextIndex = this.currentStepIndex + 1;
  1628. if (nextIndex < this.steps.length) {
  1629. // 如果下一步是专业技能步骤(第四步,currentStep === 6),且不需要显示,则跳过
  1630. if (this.steps[nextIndex].id === 6 && !this.shouldShowSkillsStep) {
  1631. // 跳到下下一步
  1632. const skipIndex = nextIndex + 1;
  1633. if (skipIndex < this.steps.length) {
  1634. this.currentStep = this.steps[skipIndex].id;
  1635. }
  1636. } else {
  1637. this.currentStep = this.steps[nextIndex].id;
  1638. }
  1639. // 滚动到页面顶部
  1640. uni.pageScrollTo({
  1641. scrollTop: 0,
  1642. duration: 300
  1643. });
  1644. }
  1645. },
  1646. // 身份验证方法
  1647. verifyIdentity() {
  1648. // 清空错误信息
  1649. this.formErrors = {
  1650. name: '',
  1651. idCard: '',
  1652. phone: ''
  1653. };
  1654. uni.showLoading({
  1655. title: '身份验证中...'
  1656. });
  1657. uni.request({
  1658. url: `${apiBaseUrl}/wechat/identity/verify`,
  1659. method: 'POST',
  1660. data: {
  1661. name: this.formData.name,
  1662. id_number: this.formData.idCard,
  1663. mobile: this.formData.phone
  1664. },
  1665. header: {
  1666. 'content-type': 'application/x-www-form-urlencoded'
  1667. },
  1668. success: (res) => {
  1669. uni.hideLoading();
  1670. console.log(res);
  1671. if (res.data.code === 200) {
  1672. // 验证通过,进入下一步
  1673. const nextIndex = this.currentStepIndex + 1;
  1674. if (nextIndex < this.steps.length) {
  1675. this.currentStep = this.steps[nextIndex].id;
  1676. uni.pageScrollTo({
  1677. scrollTop: 0,
  1678. duration: 300
  1679. });
  1680. }
  1681. /* 保存姓名 */
  1682. this.setUserInfo(this.formData);
  1683. } else {
  1684. // 验证失败,显示错误信息
  1685. this.handleVerificationError(res.data);
  1686. }
  1687. },
  1688. fail: (err) => {
  1689. this.handleRequestError(err);
  1690. }
  1691. });
  1692. },
  1693. setUserInfo(data) {
  1694. uni.request({
  1695. url: `${apiBaseUrl}/wechat/updateUserInfo`,
  1696. method: 'POST',
  1697. data: {
  1698. openid: JSON.parse(uni.getStorageSync('userInfo')).openid,
  1699. name: data.name,
  1700. id_card: data.idCard,
  1701. purePhoneNumber: data.phone,
  1702. tenant_id: 1,
  1703. examine:0
  1704. },
  1705. header: {
  1706. 'content-type': 'application/x-www-form-urlencoded'
  1707. },
  1708. success: (res) => {
  1709. console.log(res);
  1710. }
  1711. });
  1712. },
  1713. // 处理验证错误
  1714. handleVerificationError(data) {
  1715. this.formErrors.name = '姓名验证失败,请检查姓名是否正确';
  1716. this.formErrors.idCard = '身份证号验证失败,请检查身份证号是否正确';
  1717. this.formErrors.phone = '手机号验证失败,请检查手机号是否正确';
  1718. uni.showToast({
  1719. title: data.msg || '身份验证失败',
  1720. icon: 'none'
  1721. });
  1722. },
  1723. // 处理请求错误
  1724. handleRequestError(err) {
  1725. uni.hideLoading();
  1726. uni.showToast({
  1727. title: '网络错误,请检查网络连接',
  1728. icon: 'none',
  1729. duration: 2000
  1730. });
  1731. console.error('请求失败:', err);
  1732. },
  1733. // 验证当前步骤的必填项
  1734. validateCurrentStep() {
  1735. let isValid = true;
  1736. switch (this.currentStep) {
  1737. case 1: // 基本信息
  1738. const basicFields = ['name', 'gender', 'phone', 'idCard', 'ethnic', 'currentAddress'];
  1739. basicFields.forEach(field => {
  1740. // 只验证显示的字段
  1741. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1742. isValid = false;
  1743. }
  1744. });
  1745. // 特殊验证:女性三期状态
  1746. if (this.shouldValidateField('threePeriod') && this.formData.gender === '女' && this.threePeriodIndex === -1) {
  1747. this.formErrors.threePeriod = '请选择三期状态';
  1748. isValid = false;
  1749. }
  1750. // 可选字段验证(如果有值则验证格式)
  1751. if (this.shouldValidateField('height') && this.formData.height) {
  1752. isValid = this.validateField('height', this.formData.height) && isValid;
  1753. }
  1754. if (this.shouldValidateField('weight') && this.formData.weight) {
  1755. isValid = this.validateField('weight', this.formData.weight) && isValid;
  1756. }
  1757. if (this.shouldValidateField('expectedSalary') && this.formData.expectedSalary) {
  1758. isValid = this.validateField('expectedSalary', this.formData.expectedSalary) && isValid;
  1759. }
  1760. break;
  1761. case 3: // 家庭成员
  1762. console.log(this.familyMembers.length);
  1763. if (this.familyMembers.length == 0) {
  1764. uni.showToast({
  1765. title: '请至少添加一位家庭成员',
  1766. icon: 'none'
  1767. });
  1768. isValid = false;
  1769. }
  1770. break;
  1771. case 5: // 教育经历
  1772. if (this.educationList.length === 0) {
  1773. uni.showToast({
  1774. title: '请至少添加一项教育经历',
  1775. icon: 'none'
  1776. });
  1777. isValid = false;
  1778. }
  1779. break;
  1780. case 6: // 专业技能
  1781. if (this.shouldValidateField('skills') && !this.formData.skills?.trim()) {
  1782. this.formErrors.skills = '请描述您的专业技能';
  1783. isValid = false;
  1784. }
  1785. if (this.shouldValidateField('training') && !this.formData.training?.trim()) {
  1786. this.formErrors.training = '请描述您的培训经历';
  1787. isValid = false;
  1788. }
  1789. break;
  1790. case 8: // 工作经历
  1791. if (this.workList.length === 0) {
  1792. uni.showToast({
  1793. title: '请至少添加一项工作经历',
  1794. icon: 'none'
  1795. });
  1796. isValid = false;
  1797. }
  1798. break;
  1799. }
  1800. /* if (!isValid) {
  1801. uni.showToast({
  1802. title: '请完善所有必填信息',
  1803. icon: 'none'
  1804. });
  1805. } */
  1806. return isValid;
  1807. },
  1808. // Add method to fetch user data
  1809. fetchUserData() {
  1810. this.isLoading = true;
  1811. // Get openid from storage
  1812. const userInfo = uni.getStorageSync('userInfo') ? JSON.parse(uni.getStorageSync('userInfo')) : {};
  1813. const openid = userInfo.openid;
  1814. if (!openid) {
  1815. uni.showToast({
  1816. title: '用户信息获取失败,请重新登录',
  1817. icon: 'none'
  1818. });
  1819. this.isLoading = false;
  1820. return;
  1821. }
  1822. uni.request({
  1823. url: `${apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=1&openid=${openid}`,
  1824. method: 'GET',
  1825. success: (res) => {
  1826. // 无论结果如何,都保持承诺书显示状态
  1827. this.showPromiseModal = true;
  1828. /* if (res.data.code === 2000) { */
  1829. // Successfully fetched data
  1830. this.populateFormData(res.data.data);
  1831. /* } else {
  1832. uni.showToast({
  1833. title: res.data.msg || '获取用户信息失败',
  1834. icon: 'none'
  1835. });
  1836. } */
  1837. },
  1838. fail: (err) => {
  1839. /* console.error('获取用户信息失败:', err);
  1840. uni.showToast({
  1841. title: '网络错误,请检查网络连接',
  1842. icon: 'none'
  1843. }); */
  1844. },
  1845. complete: () => {
  1846. this.isLoading = false;
  1847. }
  1848. });
  1849. },
  1850. // Add method to populate form data with fetched data
  1851. populateFormData(data) {
  1852. const { user_info, profile, educations, work_experiences, family_members } = data;
  1853. // Populate basic user info
  1854. if (user_info) {
  1855. this.formData.name = user_info.name || '';
  1856. this.formData.gender = user_info.gender_text || '';
  1857. this.genderIndex = this.genderOptions.findIndex(item => item === this.formData.gender);
  1858. this.formData.idCard = user_info.id_card || '';
  1859. this.formData.phone = user_info.phone || '';
  1860. this.formData.email = user_info.email || '';
  1861. }
  1862. // Populate profile data
  1863. if (profile) {
  1864. // Set political status
  1865. this.formData.political = profile.political_status || '';
  1866. this.politicalIndex = this.politicalOptions.findIndex(item => item === this.formData.political);
  1867. // Set ethnic
  1868. this.formData.ethnic = profile.ethnicity || '';
  1869. this.ethnicIndex = this.ethnicOptions.findIndex(item => item === this.formData.ethnic);
  1870. // Set height and weight
  1871. this.formData.height = profile.height || '';
  1872. this.formData.weight = profile.weight || '';
  1873. // Set native place and residence
  1874. this.formData.nativePlace = profile.native_place || '';
  1875. this.formData.residence = profile.household_location || '';
  1876. // Set current address
  1877. this.formData.currentAddress = profile.current_address || '';
  1878. // Set marriage status
  1879. this.formData.marriage = profile.marital_status_text || '';
  1880. this.marriageIndex = this.marriageOptions.findIndex(item => item === this.formData.marriage);
  1881. // Set three period status for female
  1882. if (this.formData.gender === '女' && profile.female_status !== undefined) {
  1883. const femaleStatusMap = {0: '无', 1: '孕期', 2: '产期', 3: '哺乳期'};
  1884. this.formData.threePeriod = femaleStatusMap[profile.female_status] || '无';
  1885. this.threePeriodIndex = this.threePeriodOptions.findIndex(item => item === this.formData.threePeriod);
  1886. }
  1887. // Set expected salary
  1888. this.formData.expectedSalary = profile.expected_salary || '';
  1889. // Set emergency contact
  1890. this.formData.emergencyContact = profile.emergency_contact || '';
  1891. this.formData.emergencyPhone = profile.emergency_phone || '';
  1892. // Set hobby and motto
  1893. this.formData.hobby = profile.specialties || '';
  1894. this.formData.motto = profile.life_motto || '';
  1895. // Set recruitment source
  1896. const sourceTypeMap = {
  1897. 1: 'school',
  1898. 2: 'social',
  1899. 3: 'social',
  1900. 4: 'social',
  1901. 5: 'social'
  1902. };
  1903. const socialSourceMap = {
  1904. 2: 'BOSS',
  1905. 3: 'zhilian',
  1906. 4: 'liepin',
  1907. 5: 'other'
  1908. };
  1909. this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || 'social';
  1910. if (this.formData.sourceType === 'social') {
  1911. this.formData.socialSource = socialSourceMap[profile.recruitment_source] || '';
  1912. if (this.formData.socialSource === 'other') {
  1913. this.formData.otherSocialSource = profile.recruitment_source_detail || '';
  1914. }
  1915. } else if (this.formData.sourceType === 'school') {
  1916. this.formData.otherSchoolSource = profile.recruitment_source_detail || '';
  1917. }
  1918. }
  1919. // Populate educations data
  1920. if (educations && educations.length > 0) {
  1921. this.educationList = educations.map(edu => {
  1922. const degreeMap = {
  1923. 1: '高中',
  1924. 2: '大专',
  1925. 3: '本科',
  1926. 4: '硕士',
  1927. 5: '博士'
  1928. };
  1929. return {
  1930. startTime: edu.start_date || '',
  1931. endTime: edu.end_date || '',
  1932. schoolName: edu.school_name || '',
  1933. major: edu.major || '',
  1934. degree: degreeMap[edu.degree] || ''
  1935. };
  1936. });
  1937. }
  1938. // Populate work experience data
  1939. if (work_experiences && work_experiences.length > 0) {
  1940. this.workList = work_experiences.map(work => {
  1941. return {
  1942. startTime: work.start_date || '',
  1943. endTime: work.end_date || '',
  1944. companyName: work.company_name || '',
  1945. department: work.department || '',
  1946. employeeCount: work.company_size || '',
  1947. position: work.position || '',
  1948. monthlySalary: work.monthly_salary || '',
  1949. supervisor: work.supervisor_name || '',
  1950. supervisorPhone: work.supervisor_phone || ''
  1951. };
  1952. });
  1953. }
  1954. // Populate family members data
  1955. if (family_members && family_members.length > 0) {
  1956. this.familyMembers = family_members.map(member => {
  1957. return {
  1958. relation: member.relation || '',
  1959. name: member.name || '',
  1960. workplaceOrAddress: member.workplace || '',
  1961. position: member.position || '',
  1962. phone: member.phone || '',
  1963. isEmergencyContact: member.isEmergencyContact || false
  1964. };
  1965. });
  1966. }
  1967. // 移除这段代码,确保承诺书始终显示
  1968. // if (user_info && user_info.is_profile_complete) {
  1969. // this.showPromiseModal = false;
  1970. // }
  1971. },
  1972. // 处理紧急联系人开关变化
  1973. handleEmergencyContactChange(e) {
  1974. this.familyMemberForm.isEmergencyContact = e.detail.value;
  1975. // 如果设置为紧急联系人,自动填充到紧急联系人字段
  1976. if (e.detail.value) {
  1977. this.formData.emergencyContact = this.familyMemberForm.name;
  1978. this.formData.emergencyPhone = this.familyMemberForm.phone;
  1979. }
  1980. },
  1981. // 添加重置教育经历错误信息的方法
  1982. resetEducationErrors() {
  1983. this.educationErrors = {
  1984. startTime: '',
  1985. endTime: '',
  1986. schoolName: '',
  1987. major: '',
  1988. degree: ''
  1989. };
  1990. },
  1991. // 添加通用验证方法
  1992. validateField(fieldName, value) {
  1993. const rule = this.validationRules[fieldName];
  1994. if (!rule) return true;
  1995. // 如果字段被隐藏,不进行验证
  1996. if (!this.shouldValidateField(fieldName)) {
  1997. return true;
  1998. }
  1999. // 重置该字段的错误信息
  2000. this.formErrors[fieldName] = '';
  2001. // 必填验证
  2002. if (rule.required && !value) {
  2003. this.formErrors[fieldName] = rule.message;
  2004. return false;
  2005. }
  2006. // 正则验证
  2007. if (rule.pattern && value && !rule.pattern.test(value)) {
  2008. this.formErrors[fieldName] = rule.message;
  2009. return false;
  2010. }
  2011. return true;
  2012. },
  2013. validateExpectedSalary(e) {
  2014. const value = e.detail.value;
  2015. console.log(value);
  2016. if (value === '') {
  2017. this.formData.expectedSalary = '';
  2018. this.formErrors.expectedSalary = '';
  2019. return;
  2020. }
  2021. let num = parseFloat(value);
  2022. if (isNaN(num)) {
  2023. this.formErrors.expectedSalary = '请输入有效的数字';
  2024. return;
  2025. }
  2026. if (num < 0) {
  2027. num = 0;
  2028. this.formErrors.expectedSalary = '薪资不能小于0';
  2029. } else if (num > 100000) {
  2030. num = 100000;
  2031. this.formErrors.expectedSalary = '薪资不能超过100000';
  2032. }
  2033. this.formData.expectedSalary = num.toString();
  2034. },
  2035. validateEmployeeCount(e) {
  2036. const value = e.detail.value;
  2037. if (value === '') {
  2038. this.workForm.employeeCount = '';
  2039. this.workErrors.employeeCount = '';
  2040. return;
  2041. }
  2042. let num = parseInt(value);
  2043. if (isNaN(num)) {
  2044. this.workErrors.employeeCount = '请输入有效的数字';
  2045. return;
  2046. }
  2047. if (num < 0) {
  2048. num = 0;
  2049. this.workErrors.employeeCount = '人数不能小于0';
  2050. } else if (num > 10000) {
  2051. num = 10000;
  2052. this.workErrors.employeeCount = '人数不能超过10000';
  2053. }
  2054. this.workForm.employeeCount = num.toString();
  2055. },
  2056. validateMonthlySalary(e) {
  2057. const value = e.detail.value;
  2058. if (value === '') {
  2059. this.workForm.monthlySalary = '';
  2060. this.workErrors.monthlySalary = '';
  2061. return;
  2062. }
  2063. let num = parseInt(value);
  2064. if (isNaN(num)) {
  2065. this.workErrors.monthlySalary = '请输入有效的数字';
  2066. return;
  2067. }
  2068. if (num < 0) {
  2069. num = 0;
  2070. this.workErrors.monthlySalary = '月总收入不能小于0';
  2071. } else if (num > 100000) {
  2072. num = 100000;
  2073. this.workErrors.monthlySalary = '月总收入不能超过100000';
  2074. } else {
  2075. this.workErrors.monthlySalary = '';
  2076. }
  2077. this.workForm.monthlySalary = num.toString();
  2078. }
  2079. },
  2080. // 添加监听器来清除错误信息
  2081. watch: {
  2082. 'formData.name': function(newVal) {
  2083. if (newVal && this.formErrors.name) {
  2084. this.formErrors.name = '';
  2085. }
  2086. },
  2087. 'formData.idCard': function(newVal) {
  2088. if (newVal && this.formErrors.idCard) {
  2089. this.formErrors.idCard = '';
  2090. }
  2091. },
  2092. 'formData.phone': function(newVal) {
  2093. if (newVal && this.formErrors.phone) {
  2094. this.formErrors.phone = '';
  2095. }
  2096. },
  2097. 'formData.gender': function(newVal) {
  2098. if (newVal && this.formErrors.gender) {
  2099. this.formErrors.gender = '';
  2100. }
  2101. },
  2102. 'formData.ethnic': function(newVal) {
  2103. if (newVal && this.formErrors.ethnic) {
  2104. this.formErrors.ethnic = '';
  2105. }
  2106. },
  2107. 'formData.currentAddress': function(newVal) {
  2108. if (newVal && this.formErrors.currentAddress) {
  2109. this.formErrors.currentAddress = '';
  2110. }
  2111. },
  2112. 'formData.height': function(newVal) {
  2113. if (newVal && this.formErrors.height) {
  2114. this.formErrors.height = '';
  2115. }
  2116. },
  2117. 'formData.weight': function(newVal) {
  2118. if (newVal && this.formErrors.weight) {
  2119. this.formErrors.weight = '';
  2120. }
  2121. },
  2122. 'formData.expectedSalary': function(newVal) {
  2123. if (newVal && this.formErrors.expectedSalary) {
  2124. this.formErrors.expectedSalary = '';
  2125. }
  2126. },
  2127. 'familyMemberForm.relation': function(newVal) {
  2128. if (newVal) this.familyMemberErrors.relation = '';
  2129. },
  2130. 'familyMemberForm.name': function(newVal) {
  2131. if (newVal) this.familyMemberErrors.name = '';
  2132. },
  2133. 'familyMemberForm.phone': function(newVal) {
  2134. if (newVal) this.familyMemberErrors.phone = '';
  2135. },
  2136. /* 'familyMemberForm.workplaceOrAddress': function(newVal) {
  2137. if (newVal) this.familyMemberErrors.workplaceOrAddress = '';
  2138. },
  2139. 'familyMemberForm.position': function(newVal) {
  2140. if (newVal) this.familyMemberErrors.position = '';
  2141. }, */
  2142. 'workForm.companyName': function(newVal) {
  2143. if (newVal && this.workErrors.companyName) {
  2144. this.workErrors.companyName = '';
  2145. }
  2146. },
  2147. 'workForm.department': function(newVal) {
  2148. if (newVal && this.workErrors.department) {
  2149. this.workErrors.department = '';
  2150. }
  2151. },
  2152. 'workForm.position': function(newVal) {
  2153. if (newVal && this.workErrors.position) {
  2154. this.workErrors.position = '';
  2155. }
  2156. },
  2157. 'workForm.employeeCount': function(newVal) {
  2158. if (newVal && this.workErrors.employeeCount) {
  2159. this.workErrors.employeeCount = '';
  2160. }
  2161. },
  2162. 'workForm.monthlySalary': function(newVal) {
  2163. if (newVal && this.workErrors.monthlySalary) {
  2164. this.workErrors.monthlySalary = '';
  2165. }
  2166. },
  2167. 'workForm.supervisor': function(newVal) {
  2168. if (newVal && this.workErrors.supervisor) {
  2169. this.workErrors.supervisor = '';
  2170. }
  2171. },
  2172. 'workForm.supervisorPhone': function(newVal) {
  2173. if (newVal && this.workErrors.supervisorPhone) {
  2174. this.workErrors.supervisorPhone = '';
  2175. }
  2176. },
  2177. 'formData.training': function(newVal) {
  2178. if (newVal && this.formErrors.training) {
  2179. this.formErrors.training = '';
  2180. }
  2181. },
  2182. 'educationForm.startTime': function(newVal) {
  2183. if (newVal) this.educationErrors.startTime = '';
  2184. },
  2185. 'educationForm.endTime': function(newVal) {
  2186. if (newVal) this.educationErrors.endTime = '';
  2187. },
  2188. 'educationForm.schoolName': function(newVal) {
  2189. if (newVal) this.educationErrors.schoolName = '';
  2190. },
  2191. 'educationForm.major': function(newVal) {
  2192. if (newVal) this.educationErrors.major = '';
  2193. },
  2194. 'educationForm.degree': function(newVal) {
  2195. if (newVal) this.educationErrors.degree = '';
  2196. },
  2197. // 添加对表单字段的实时验证
  2198. 'formData': {
  2199. handler(newVal) {
  2200. // 只验证当前步骤的字段
  2201. const currentStepFields = {
  2202. 1: ['name', 'gender', 'phone', 'idCard', 'ethnic', 'currentAddress', 'height', 'weight', 'expectedSalary'],
  2203. 6: ['skills', 'training']
  2204. }[this.currentStep];
  2205. if (currentStepFields) {
  2206. currentStepFields.forEach(field => {
  2207. if (newVal[field] !== undefined && this.shouldValidateField(field)) {
  2208. this.validateField(field, newVal[field]);
  2209. }
  2210. });
  2211. }
  2212. },
  2213. deep: true
  2214. }
  2215. },
  2216. }
  2217. </script>
  2218. <style>
  2219. .personal-container {
  2220. padding: 20rpx;
  2221. }
  2222. .form-title {
  2223. font-size: 36rpx;
  2224. font-weight: bold;
  2225. text-align: center;
  2226. margin-bottom: 30rpx;
  2227. }
  2228. .form-container {
  2229. background-color: #fff;
  2230. border-radius: 10rpx;
  2231. padding: 20rpx;
  2232. }
  2233. .section-title {
  2234. font-size: 32rpx;
  2235. font-weight: bold;
  2236. margin: 30rpx 0 20rpx 10rpx;
  2237. color: #333;
  2238. border-left: 4rpx solid #0039b3;
  2239. padding-left: 15rpx;
  2240. }
  2241. .form-row {
  2242. display: flex;
  2243. flex-direction: row;
  2244. margin-bottom: 20rpx;
  2245. flex-wrap: wrap;
  2246. }
  2247. .form-item {
  2248. flex: 1;
  2249. min-width: 300rpx;
  2250. margin: 10rpx;
  2251. border-bottom: 1px solid #eee;
  2252. padding-bottom: 10rpx;
  2253. }
  2254. .label {
  2255. font-size: 28rpx;
  2256. color: #333;
  2257. margin-right: 10rpx;
  2258. display: block;
  2259. margin-bottom: 10rpx;
  2260. position: relative;
  2261. padding-left: 14rpx; /* 为星号预留空间 */
  2262. }
  2263. input {
  2264. font-size: 28rpx;
  2265. height: 60rpx;
  2266. }
  2267. .picker-text {
  2268. font-size: 28rpx;
  2269. height: 60rpx;
  2270. line-height: 60rpx;
  2271. color: #666;
  2272. }
  2273. .submit-btn {
  2274. margin-top: 40rpx;
  2275. background-color: #0039b3;
  2276. color: #fff;
  2277. }
  2278. .family-members-list {
  2279. margin-top: 20rpx;
  2280. }
  2281. .family-member-item {
  2282. background-color: #f8f8f8;
  2283. border-radius: 8rpx;
  2284. padding: 20rpx;
  2285. margin-bottom: 20rpx;
  2286. }
  2287. .family-member-header {
  2288. display: flex;
  2289. justify-content: space-between;
  2290. align-items: center;
  2291. margin-bottom: 15rpx;
  2292. border-bottom: 1px solid #eee;
  2293. padding-bottom: 10rpx;
  2294. }
  2295. .family-member-title {
  2296. font-size: 30rpx;
  2297. font-weight: bold;
  2298. color: #333;
  2299. }
  2300. .family-member-actions {
  2301. display: flex;
  2302. gap: 20rpx;
  2303. }
  2304. .family-member-edit {
  2305. font-size: 26rpx;
  2306. color: #1890ff;
  2307. }
  2308. .family-member-delete {
  2309. font-size: 26rpx;
  2310. color: #ff4d4f;
  2311. }
  2312. .form-subtitle {
  2313. font-size: 28rpx;
  2314. font-weight: bold;
  2315. margin-bottom: 20rpx;
  2316. display: flex;
  2317. justify-content: space-between;
  2318. align-items: center;
  2319. }
  2320. .cancel-edit {
  2321. font-size: 26rpx;
  2322. color: #999;
  2323. font-weight: normal;
  2324. }
  2325. .family-member-content {
  2326. padding: 10rpx 0;
  2327. }
  2328. .family-member-row {
  2329. display: flex;
  2330. margin-bottom: 10rpx;
  2331. }
  2332. .family-member-label {
  2333. font-size: 26rpx;
  2334. color: #666;
  2335. width: 200rpx;
  2336. }
  2337. .family-member-value {
  2338. font-size: 26rpx;
  2339. color: #333;
  2340. flex: 1;
  2341. }
  2342. .family-member-form {
  2343. background-color: #fff;
  2344. border-radius: 8rpx;
  2345. padding: 20rpx;
  2346. margin-top: 20rpx;
  2347. }
  2348. .form-row button-row {
  2349. display: flex;
  2350. justify-content: center;
  2351. margin-top: 20rpx;
  2352. }
  2353. .form-item button-container {
  2354. display: flex;
  2355. flex-direction: column;
  2356. align-items: center;
  2357. }
  2358. .circle-btn {
  2359. width: 40rpx;
  2360. height: 40rpx;
  2361. border-radius: 50%;
  2362. background-color: #0039b3;
  2363. display: flex;
  2364. justify-content: center;
  2365. align-items: center;
  2366. margin-bottom: 10rpx;
  2367. }
  2368. .btn-icon {
  2369. font-size: 32rpx;
  2370. color: #fff;
  2371. }
  2372. .btn-text {
  2373. font-size: 28rpx;
  2374. color: #333;
  2375. }
  2376. /* 添加圆形按钮相关样式 */
  2377. .button-row {
  2378. justify-content: center;
  2379. margin-top: 30rpx;
  2380. }
  2381. .button-container {
  2382. display: flex;
  2383. flex-direction: column;
  2384. align-items: center;
  2385. border-bottom: none;
  2386. min-width: auto;
  2387. }
  2388. .circle-btn {
  2389. width: 100rpx;
  2390. height: 100rpx;
  2391. border-radius: 50%;
  2392. padding: 0;
  2393. display: flex;
  2394. align-items: center;
  2395. justify-content: center;
  2396. background-color: #0039b3;
  2397. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.1);
  2398. margin: 0;
  2399. }
  2400. .btn-icon {
  2401. font-size: 50rpx;
  2402. color: #fff;
  2403. line-height: 1;
  2404. }
  2405. .btn-text {
  2406. font-size: 24rpx;
  2407. color: #666;
  2408. margin-top: 10rpx;
  2409. }
  2410. /* 编辑状态下的按钮颜色 */
  2411. .circle-btn.editing {
  2412. background-color: #1890ff;
  2413. }
  2414. /* 移除原来的添加按钮样式 */
  2415. .add-member-btn {
  2416. display: none;
  2417. }
  2418. /* 应聘来源样式 */
  2419. .source-container {
  2420. background-color: #fff;
  2421. border-radius: 10rpx;
  2422. padding: 20rpx;
  2423. margin-bottom: 30rpx;
  2424. }
  2425. .source-row {
  2426. display: flex;
  2427. margin-bottom: 20rpx;
  2428. align-items: flex-start;
  2429. }
  2430. .source-label {
  2431. width: 120rpx;
  2432. font-size: 28rpx;
  2433. color: #333;
  2434. padding-top: 6rpx;
  2435. }
  2436. .source-options {
  2437. flex: 1;
  2438. display: flex;
  2439. flex-wrap: wrap;
  2440. }
  2441. .source-option {
  2442. display: flex;
  2443. align-items: center;
  2444. margin-right: 30rpx;
  2445. margin-bottom: 15rpx;
  2446. }
  2447. .source-option text {
  2448. font-size: 28rpx;
  2449. margin-left: 8rpx;
  2450. }
  2451. .other-option {
  2452. flex-basis: 100%;
  2453. margin-top: 10rpx;
  2454. }
  2455. .other-option input {
  2456. border-bottom: 1px solid #eee;
  2457. width: 300rpx;
  2458. margin-left: 10rpx;
  2459. font-size: 28rpx;
  2460. }
  2461. /* 教育经历样式 */
  2462. .education-list {
  2463. margin-top: 20rpx;
  2464. }
  2465. .education-item {
  2466. background-color: #f8f8f8;
  2467. border-radius: 8rpx;
  2468. padding: 20rpx;
  2469. margin-bottom: 20rpx;
  2470. }
  2471. .education-header {
  2472. display: flex;
  2473. justify-content: space-between;
  2474. align-items: center;
  2475. margin-bottom: 15rpx;
  2476. border-bottom: 1px solid #eee;
  2477. padding-bottom: 10rpx;
  2478. }
  2479. .education-title {
  2480. font-size: 30rpx;
  2481. font-weight: bold;
  2482. color: #333;
  2483. }
  2484. .education-actions {
  2485. display: flex;
  2486. gap: 20rpx;
  2487. }
  2488. .education-edit {
  2489. font-size: 26rpx;
  2490. color: #1890ff;
  2491. }
  2492. .education-delete {
  2493. font-size: 26rpx;
  2494. color: #ff4d4f;
  2495. }
  2496. .education-content {
  2497. padding: 10rpx 0;
  2498. }
  2499. .education-row {
  2500. display: flex;
  2501. margin-bottom: 10rpx;
  2502. }
  2503. .education-label {
  2504. font-size: 26rpx;
  2505. color: #666;
  2506. width: 150rpx;
  2507. }
  2508. .education-value {
  2509. font-size: 26rpx;
  2510. color: #333;
  2511. flex: 1;
  2512. }
  2513. .education-form {
  2514. background-color: #fff;
  2515. border-radius: 8rpx;
  2516. padding: 20rpx;
  2517. margin-top: 20rpx;
  2518. }
  2519. .date-range {
  2520. display: flex;
  2521. align-items: center;
  2522. justify-content: space-around;
  2523. }
  2524. .date-separator {
  2525. margin: 0 10rpx;
  2526. color: #666;
  2527. }
  2528. /* 专业技能和培训样式 */
  2529. .skills-container, .training-container {
  2530. background-color: #fff;
  2531. border-radius: 10rpx;
  2532. padding: 20rpx;
  2533. margin-bottom: 20rpx;
  2534. }
  2535. .skills-textarea, .training-textarea {
  2536. width: 100%;
  2537. height: 200rpx;
  2538. font-size: 28rpx;
  2539. line-height: 1.5;
  2540. padding: 10rpx;
  2541. box-sizing: border-box;
  2542. border: 1px solid #eee;
  2543. border-radius: 6rpx;
  2544. }
  2545. /* 工作经历样式 */
  2546. .work-list {
  2547. margin-top: 20rpx;
  2548. }
  2549. .work-item {
  2550. background-color: #f8f8f8;
  2551. border-radius: 8rpx;
  2552. padding: 20rpx;
  2553. margin-bottom: 20rpx;
  2554. }
  2555. .work-header {
  2556. display: flex;
  2557. justify-content: space-between;
  2558. align-items: center;
  2559. margin-bottom: 15rpx;
  2560. border-bottom: 1px solid #eee;
  2561. padding-bottom: 10rpx;
  2562. }
  2563. .work-title {
  2564. font-size: 30rpx;
  2565. font-weight: bold;
  2566. color: #333;
  2567. }
  2568. .work-actions {
  2569. display: flex;
  2570. gap: 20rpx;
  2571. }
  2572. .work-edit {
  2573. font-size: 26rpx;
  2574. color: #1890ff;
  2575. }
  2576. .work-delete {
  2577. font-size: 26rpx;
  2578. color: #ff4d4f;
  2579. }
  2580. .work-content {
  2581. padding: 10rpx 0;
  2582. }
  2583. .work-row {
  2584. display: flex;
  2585. margin-bottom: 10rpx;
  2586. }
  2587. .work-label {
  2588. font-size: 26rpx;
  2589. color: #666;
  2590. width: 150rpx;
  2591. }
  2592. .work-value {
  2593. font-size: 26rpx;
  2594. color: #333;
  2595. flex: 1;
  2596. }
  2597. .work-form {
  2598. background-color: #fff;
  2599. border-radius: 8rpx;
  2600. padding: 20rpx;
  2601. margin-top: 20rpx;
  2602. }
  2603. /* 步骤指示器样式 */
  2604. .steps-indicator {
  2605. display: flex;
  2606. justify-content: space-between;
  2607. margin-bottom: 30rpx;
  2608. padding: 20rpx;
  2609. background-color: #fff;
  2610. border-radius: 10rpx;
  2611. overflow-x: auto;
  2612. }
  2613. .step-item {
  2614. display: flex;
  2615. flex-direction: column;
  2616. align-items: center;
  2617. position: relative;
  2618. min-width: 120rpx;
  2619. }
  2620. .step-item:not(:last-child)::after {
  2621. content: '';
  2622. position: absolute;
  2623. top: 20rpx;
  2624. right: -50%;
  2625. width: 100%;
  2626. height: 2rpx;
  2627. background-color: #ddd;
  2628. z-index: 1;
  2629. }
  2630. .step-item.active:not(:last-child)::after {
  2631. background-color: #0039b3;
  2632. }
  2633. .step-number {
  2634. width: 40rpx;
  2635. height: 40rpx;
  2636. border-radius: 50%;
  2637. background-color: #ddd;
  2638. color: #fff;
  2639. display: flex;
  2640. justify-content: center;
  2641. align-items: center;
  2642. font-size: 24rpx;
  2643. margin-bottom: 10rpx;
  2644. position: relative;
  2645. z-index: 2;
  2646. }
  2647. .step-item.active .step-number {
  2648. background-color: #0039b3;
  2649. }
  2650. .step-item.current .step-number {
  2651. background-color: #0039b3;
  2652. box-shadow: 0 0 0 4rpx rgba(0, 122, 255, 0.2);
  2653. }
  2654. .step-name {
  2655. font-size: 22rpx;
  2656. color: #999;
  2657. text-align: center;
  2658. }
  2659. .step-item.active .step-name {
  2660. color: #333;
  2661. }
  2662. .step-item.current .step-name {
  2663. color: #0039b3;
  2664. font-weight: bold;
  2665. }
  2666. /* 导航按钮样式 */
  2667. .nav-buttons {
  2668. display: flex;
  2669. justify-content: space-between;
  2670. margin-top: 40rpx;
  2671. padding: 0 20rpx;
  2672. }
  2673. .nav-btn {
  2674. flex: 1;
  2675. margin: 0 10rpx;
  2676. height: 80rpx;
  2677. line-height: 80rpx;
  2678. text-align: center;
  2679. border-radius: 40rpx;
  2680. font-size: 28rpx;
  2681. }
  2682. .prev-btn {
  2683. background-color: #f0f0f0;
  2684. color: #666;
  2685. }
  2686. .next-btn {
  2687. background-color: #0039b3;
  2688. color: #fff;
  2689. }
  2690. .submit-btn {
  2691. flex: 1;
  2692. margin: 0 10rpx;
  2693. height: 80rpx;
  2694. line-height: 80rpx;
  2695. text-align: center;
  2696. border-radius: 40rpx;
  2697. font-size: 28rpx;
  2698. background-color: #0039b3;
  2699. color: #fff;
  2700. }
  2701. /* 确认提交页样式 */
  2702. .confirm-container {
  2703. background-color: #fff;
  2704. border-radius: 10rpx;
  2705. padding: 20rpx;
  2706. margin-bottom: 30rpx;
  2707. }
  2708. .confirm-message {
  2709. padding: 20rpx;
  2710. background-color: #f6f6f6;
  2711. border-radius: 8rpx;
  2712. margin-bottom: 20rpx;
  2713. }
  2714. .info-summary {
  2715. padding: 20rpx;
  2716. }
  2717. .summary-item {
  2718. display: flex;
  2719. margin-bottom: 15rpx;
  2720. }
  2721. .summary-label {
  2722. width: 150rpx;
  2723. font-size: 28rpx;
  2724. color: #666;
  2725. }
  2726. .summary-value {
  2727. flex: 1;
  2728. font-size: 28rpx;
  2729. color: #333;
  2730. }
  2731. .input-error {
  2732. border-bottom: 1px solid #ff4d4f !important;
  2733. }
  2734. .error-message {
  2735. color: #ff4d4f;
  2736. font-size: 24rpx;
  2737. margin-top: 6rpx;
  2738. display: block;
  2739. }
  2740. /* 添加承诺书弹框样式 */
  2741. .promise-modal {
  2742. position: fixed;
  2743. top: 0;
  2744. left: 0;
  2745. right: 0;
  2746. bottom: 0;
  2747. background-color: rgba(0, 0, 0, 0.5);
  2748. z-index: 999;
  2749. display: flex;
  2750. justify-content: center;
  2751. align-items: center;
  2752. }
  2753. .promise-content {
  2754. width: 80%;
  2755. max-width: 600rpx;
  2756. background-color: #fff;
  2757. border-radius: 12rpx;
  2758. padding: 30rpx;
  2759. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
  2760. }
  2761. .promise-title {
  2762. font-size: 34rpx;
  2763. font-weight: bold;
  2764. text-align: center;
  2765. margin-bottom: 20rpx;
  2766. color: #333;
  2767. }
  2768. .promise-text {
  2769. height: 600rpx;
  2770. margin-bottom: 20rpx;
  2771. /* padding: 20rpx; */
  2772. background-color: #f8f8f8;
  2773. border-radius: 8rpx;
  2774. font-size: 28rpx;
  2775. line-height: 1.6;
  2776. color: #333;
  2777. }
  2778. .promise-checkbox {
  2779. display: flex;
  2780. align-items: center;
  2781. margin-bottom: 30rpx;
  2782. padding: 0 10rpx;
  2783. }
  2784. .promise-checkbox text {
  2785. font-size: 28rpx;
  2786. margin-left: 10rpx;
  2787. color: #333;
  2788. }
  2789. .promise-buttons {
  2790. display: flex;
  2791. justify-content: center;
  2792. }
  2793. .promise-btn {
  2794. width: 200rpx;
  2795. height: 80rpx;
  2796. line-height: 80rpx;
  2797. text-align: center;
  2798. border-radius: 40rpx;
  2799. font-size: 28rpx;
  2800. }
  2801. .confirm-btn {
  2802. background-color: #0039b3;
  2803. color: #fff;
  2804. }
  2805. .confirm-btn[disabled] {
  2806. background-color: #cccccc;
  2807. color: #ffffff;
  2808. }
  2809. /* Loading indicator styles */
  2810. .loading-container {
  2811. position: fixed;
  2812. top: 0;
  2813. left: 0;
  2814. right: 0;
  2815. bottom: 0;
  2816. background-color: rgba(255, 255, 255, 0.8);
  2817. display: flex;
  2818. flex-direction: column;
  2819. justify-content: center;
  2820. align-items: center;
  2821. z-index: 1000;
  2822. }
  2823. .loading-spinner {
  2824. width: 60rpx;
  2825. height: 60rpx;
  2826. border: 6rpx solid #f3f3f3;
  2827. border-top: 6rpx solid #0039b3;
  2828. border-radius: 50%;
  2829. animation: spin 1s linear infinite;
  2830. margin-bottom: 20rpx;
  2831. }
  2832. .loading-text {
  2833. font-size: 28rpx;
  2834. color: #666;
  2835. }
  2836. @keyframes spin {
  2837. 0% { transform: rotate(0deg); }
  2838. 100% { transform: rotate(360deg); }
  2839. }
  2840. /* 添加开关样式 */
  2841. .form-item switch {
  2842. margin-top: 10rpx;
  2843. }
  2844. /* 修改必填项标签的样式 */
  2845. .label.required::before {
  2846. content: '*';
  2847. color: #ff4d4f;
  2848. margin-right: 4rpx;
  2849. position: absolute;
  2850. left: 0;
  2851. top: -4rpx;
  2852. }
  2853. /* 修改必填项标签的样式 */
  2854. /* .label.required::after {
  2855. content: '*';
  2856. color: #ff4d4f;
  2857. margin-left: 4rpx;
  2858. } */
  2859. </style>