Personal.vue 83 KB

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