Personal.vue 88 KB

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