Personal.vue 84 KB

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