Personal.vue 83 KB

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