Personal.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363
  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">
  51. <text class="label">姓名</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">
  56. <text class="label">性别</text>
  57. <picker @change="bindGenderChange" :value="genderIndex" :range="genderOptions">
  58. <view class="picker-text">{{ genderOptions[genderIndex] || '请选择性别' }}</view>
  59. </picker>
  60. </view>
  61. <!-- 当性别为女时显示三期选择 -->
  62. <view class="form-item" v-if="formData.gender === '女'">
  63. <text class="label">是否为三期</text>
  64. <picker @change="bindThreePeriodChange" :value="threePeriodIndex" :range="threePeriodOptions">
  65. <view class="picker-text">{{ threePeriodOptions[threePeriodIndex] || '请选择' }}</view>
  66. </picker>
  67. </view>
  68. <view class="form-row">
  69. <view class="form-item">
  70. <text class="label">手机号</text>
  71. <input type="number" v-model="formData.phone" placeholder="请输入手机号" :class="{'input-error': formErrors.phone}" />
  72. <text v-if="formErrors.phone" class="error-message">{{formErrors.phone}}</text>
  73. </view>
  74. </view>
  75. <!-- <view class="form-item">
  76. <text class="label">出生日期</text>
  77. <picker mode="date" :value="formData.birthDate" @change="bindDateChange">
  78. <view class="picker-text">{{ formData.birthDate || '请选择日期' }}</view>
  79. </picker>
  80. </view> -->
  81. </view>
  82. <view class="form-item">
  83. <text class="label">身份证号</text>
  84. <input type="idcard" v-model="formData.idCard" placeholder="请输入身份证号" :class="{'input-error': formErrors.idCard}" />
  85. <text v-if="formErrors.idCard" class="error-message">{{formErrors.idCard}}</text>
  86. </view>
  87. <!-- <view class="form-item">
  88. <text class="label">政治面貌</text>
  89. <picker @change="bindPoliticalChange" :value="politicalIndex" :range="politicalOptions">
  90. <view class="picker-text">{{ politicalOptions[politicalIndex] || '请选择政治面貌' }}</view>
  91. </picker>
  92. </view> -->
  93. <view class="form-item">
  94. <text class="label">民族</text>
  95. <picker @change="bindEthnicChange" :value="ethnicIndex" :range="ethnicOptions">
  96. <view class="picker-text">{{ ethnicOptions[ethnicIndex] || '请选择民族' }}</view>
  97. </picker>
  98. </view>
  99. <!-- 第三行 -->
  100. <view class="form-row">
  101. <view class="form-item">
  102. <text class="label">身高(cm)</text>
  103. <input type="digit" v-model="formData.height" placeholder="请输入身高" />
  104. </view>
  105. <view class="form-item">
  106. <text class="label">体重(kg)</text>
  107. <input type="digit" v-model="formData.weight" placeholder="请输入体重" />
  108. </view>
  109. <view class="form-item">
  110. <text class="label">现居住地址</text>
  111. <input type="text" v-model="formData.currentAddress" placeholder="请输入现居住地址" />
  112. </view>
  113. <!-- <view class="form-item">
  114. <text class="label">籍贯</text>
  115. <input type="text" v-model="formData.nativePlace" placeholder="请输入籍贯" />
  116. </view> -->
  117. </view>
  118. <!-- 第四行 -->
  119. <view class="form-row">
  120. <view class="form-item">
  121. <text class="label">户口所在地</text>
  122. <input type="text" v-model="formData.residence" placeholder="请输入户口所在地" />
  123. </view>
  124. <view class="form-item">
  125. <text class="label">婚育状况</text>
  126. <picker @change="bindMarriageChange" :value="marriageIndex" :range="marriageOptions">
  127. <view class="picker-text">{{ marriageOptions[marriageIndex] || '请选择婚育状况' }}</view>
  128. </picker>
  129. </view>
  130. <view class="form-item">
  131. <text class="label">期望薪资(元/月)</text>
  132. <input type="digit" v-model="formData.expectedSalary" placeholder="请输入期望薪资" />
  133. </view>
  134. </view>
  135. </view>
  136. <!-- 第二步:家庭成员 -->
  137. <view v-if="currentStep === 3" class="form-container">
  138. <view class="section-title">家庭主要成员信息</view>
  139. <!-- 已添加的家庭成员列表 -->
  140. <view class="family-members-list" v-if="familyMembers.length > 0">
  141. <view class="family-member-item" v-for="(member, index) in familyMembers" :key="index">
  142. <view class="family-member-header">
  143. <text class="family-member-title">成员 {{index + 1}}</text>
  144. <view class="family-member-actions">
  145. <text class="family-member-edit" @click="editFamilyMember(index)">编辑</text>
  146. <text class="family-member-delete" @click="deleteFamilyMember(index)">删除</text>
  147. </view>
  148. </view>
  149. <view class="family-member-content">
  150. <view class="family-member-row">
  151. <text class="family-member-label">称谓:</text>
  152. <text class="family-member-value">{{member.relation}}</text>
  153. </view>
  154. <view class="family-member-row">
  155. <text class="family-member-label">姓名:</text>
  156. <text class="family-member-value">{{member.name}}</text>
  157. </view>
  158. <view class="family-member-row">
  159. <text class="family-member-label">工作单位/家庭地址:</text>
  160. <text class="family-member-value">{{member.workplaceOrAddress}}</text>
  161. </view>
  162. <view class="family-member-row">
  163. <text class="family-member-label">职务:</text>
  164. <text class="family-member-value">{{member.position}}</text>
  165. </view>
  166. <view class="family-member-row">
  167. <text class="family-member-label">联系电话:</text>
  168. <text class="family-member-value">{{member.phone}}</text>
  169. </view>
  170. <view class="family-member-row">
  171. <text class="family-member-label">是否为紧急联系人:</text>
  172. <text class="family-member-value">{{member.isEmergencyContact ? '是' : '否'}}</text>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. <!-- 家庭成员信息表单 -->
  178. <view class="family-member-form">
  179. <view class="form-subtitle">
  180. {{ isEditing ? '编辑家庭成员' : '添加家庭成员' }}
  181. <text v-if="isEditing" class="cancel-edit" @click="cancelEdit">取消编辑</text>
  182. </view>
  183. <view class="form-row">
  184. <view class="form-item">
  185. <text class="label">称谓</text>
  186. <input type="text" v-model="familyMemberForm.relation" placeholder="如:父亲、母亲、配偶等" />
  187. </view>
  188. <view class="form-item">
  189. <text class="label">姓名</text>
  190. <input type="text" v-model="familyMemberForm.name" placeholder="请输入姓名" />
  191. </view>
  192. </view>
  193. <view class="form-row">
  194. <view class="form-item">
  195. <text class="label">工作单位/家庭地址</text>
  196. <input type="text" v-model="familyMemberForm.workplaceOrAddress" placeholder="请输入工作单位或家庭地址" />
  197. </view>
  198. <view class="form-item">
  199. <text class="label">职务</text>
  200. <input type="text" v-model="familyMemberForm.position" placeholder="请输入职务" />
  201. </view>
  202. </view>
  203. <view class="form-row">
  204. <view class="form-item">
  205. <text class="label">联系电话</text>
  206. <input type="number" v-model="familyMemberForm.phone" placeholder="请输入联系电话" />
  207. </view>
  208. </view>
  209. <view class="form-row">
  210. <view class="form-item">
  211. <text class="label">是否为紧急联系人</text>
  212. <switch :checked="familyMemberForm.isEmergencyContact" @change="handleEmergencyContactChange" />
  213. </view>
  214. </view>
  215. <view class="form-row button-row">
  216. <view class="form-item button-container">
  217. <button class="circle-btn" @click="saveFamilyMember">
  218. <text class="btn-icon">{{ isEditing ? '✓' : '+' }}</text>
  219. </button>
  220. <text class="btn-text">{{ isEditing ? '保存修改' : '添加成员' }}</text>
  221. </view>
  222. </view>
  223. </view>
  224. </view>
  225. <!-- 第三步:教育经历 -->
  226. <view v-if="currentStep === 5" class="form-container">
  227. <view class="section-title">教育经历</view>
  228. <!-- 已添加的教育经历列表 -->
  229. <view class="education-list" v-if="educationList.length > 0">
  230. <view class="education-item" v-for="(edu, index) in educationList" :key="index">
  231. <view class="education-header">
  232. <text class="education-title">{{ index === 0 ? '第一学历' : '最高学历' }}</text>
  233. <view class="education-actions">
  234. <text class="education-edit" @click="editEducation(index)">编辑</text>
  235. <text class="education-delete" @click="deleteEducation(index)">删除</text>
  236. </view>
  237. </view>
  238. <view class="education-content">
  239. <view class="education-row">
  240. <text class="education-label">起止时间:</text>
  241. <text class="education-value">{{edu.startTime}} 至 {{edu.endTime}}</text>
  242. </view>
  243. <view class="education-row">
  244. <text class="education-label">学校名称:</text>
  245. <text class="education-value">{{edu.schoolName}}</text>
  246. </view>
  247. <view class="education-row">
  248. <text class="education-label">专业:</text>
  249. <text class="education-value">{{edu.major}}</text>
  250. </view>
  251. <view class="education-row">
  252. <text class="education-label">学历:</text>
  253. <text class="education-value">{{edu.degree}}</text>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <!-- 教育经历表单 -->
  259. <view class="education-form" v-if="educationList.length < 2 || isEditingEducation">
  260. <view class="form-subtitle">
  261. {{ isEditingEducation ? '编辑教育经历' : (educationList.length === 0 ? '添加第一学历' : '添加最高学历') }}
  262. <text v-if="isEditingEducation" class="cancel-edit" @click="cancelEditEducation">取消编辑</text>
  263. </view>
  264. <view class="form-row">
  265. <view class="form-item">
  266. <text class="label">起止时间</text>
  267. <view class="date-range">
  268. <picker mode="date" :value="educationForm.startTime" @change="bindStartTimeChange">
  269. <view class="picker-text">{{ educationForm.startTime || '开始时间' }}</view>
  270. </picker>
  271. <text class="date-separator">至</text>
  272. <picker mode="date" :value="educationForm.endTime" @change="bindEndTimeChange">
  273. <view class="picker-text">{{ educationForm.endTime || '结束时间' }}</view>
  274. </picker>
  275. </view>
  276. </view>
  277. </view>
  278. <view class="form-row">
  279. <view class="form-item">
  280. <text class="label">学校名称</text>
  281. <input type="text" v-model="educationForm.schoolName" placeholder="请输入学校名称" />
  282. </view>
  283. <view class="form-item">
  284. <text class="label">专业</text>
  285. <input type="text" v-model="educationForm.major" placeholder="请输入专业" />
  286. </view>
  287. </view>
  288. <view class="form-row">
  289. <view class="form-item">
  290. <text class="label">学历</text>
  291. <picker @change="bindDegreeChange" :value="degreeIndex" :range="degreeOptions">
  292. <view class="picker-text">{{ degreeOptions[degreeIndex] || '请选择学历' }}</view>
  293. </picker>
  294. </view>
  295. </view>
  296. <view class="form-row button-row">
  297. <view class="form-item button-container">
  298. <button class="circle-btn" @click="saveEducation">
  299. <text class="btn-icon">{{ isEditingEducation ? '✓' : '+' }}</text>
  300. </button>
  301. <text class="btn-text">{{ isEditingEducation ? '保存修改' : '添加学历' }}</text>
  302. </view>
  303. </view>
  304. </view>
  305. </view>
  306. <!-- 第四步:专业技能 -->
  307. <view v-if="currentStep === 6" class="form-container">
  308. <view class="section-title">专业技能</view>
  309. <view class="skills-container">
  310. <textarea v-model="formData.skills" placeholder="请描述您的专业技能" class="skills-textarea"></textarea>
  311. </view>
  312. <view class="section-title">受过的培训</view>
  313. <view class="training-container">
  314. <textarea v-model="formData.training" placeholder="请描述您接受过的培训经历" class="training-textarea"></textarea>
  315. </view>
  316. </view>
  317. <!-- 第五步:工作经历 -->
  318. <view v-if="currentStep === 8" class="form-container">
  319. <view class="section-title">工作经历</view>
  320. <!-- 已添加的工作经历列表 -->
  321. <view class="work-list" v-if="workList.length > 0">
  322. <view class="work-item" v-for="(work, index) in workList" :key="index">
  323. <view class="work-header">
  324. <text class="work-title">单位{{ index + 1 }}</text>
  325. <view class="work-actions">
  326. <text class="work-edit" @click="editWork(index)">编辑</text>
  327. <text class="work-delete" @click="deleteWork(index)">删除</text>
  328. </view>
  329. </view>
  330. <view class="work-content">
  331. <view class="work-row">
  332. <text class="work-label">起止时间:</text>
  333. <text class="work-value">{{work.startTime}} 至 {{work.endTime}}</text>
  334. </view>
  335. <view class="work-row">
  336. <text class="work-label">单位名称:</text>
  337. <text class="work-value">{{work.companyName}}</text>
  338. </view>
  339. <view class="work-row">
  340. <text class="work-label">任职部门:</text>
  341. <text class="work-value">{{work.department}}</text>
  342. </view>
  343. <view class="work-row">
  344. <text class="work-label">单位人数:</text>
  345. <text class="work-value">{{work.employeeCount}}</text>
  346. </view>
  347. <view class="work-row">
  348. <text class="work-label">担任职务:</text>
  349. <text class="work-value">{{work.position}}</text>
  350. </view>
  351. <view class="work-row">
  352. <text class="work-label">月总收入:</text>
  353. <text class="work-value">{{work.monthlySalary}}</text>
  354. </view>
  355. <view class="work-row">
  356. <text class="work-label">直接领导:</text>
  357. <text class="work-value">{{work.supervisor}}</text>
  358. </view>
  359. <view class="work-row">
  360. <text class="work-label">领导电话:</text>
  361. <text class="work-value">{{work.supervisorPhone}}</text>
  362. </view>
  363. </view>
  364. </view>
  365. </view>
  366. <!-- 工作经历表单 -->
  367. <view class="work-form" v-if="workList.length < 2 || isEditingWork">
  368. <view class="form-subtitle">
  369. {{ isEditingWork ? '编辑工作经历' : '添加工作经历' }}
  370. <text v-if="isEditingWork" class="cancel-edit" @click="cancelEditWork">取消编辑</text>
  371. </view>
  372. <view class="form-row">
  373. <view class="form-item">
  374. <text class="label">起止时间</text>
  375. <view class="date-range">
  376. <picker mode="date" :value="workForm.startTime" @change="bindWorkStartTimeChange">
  377. <view class="picker-text">{{ workForm.startTime || '开始时间' }}</view>
  378. </picker>
  379. <text class="date-separator">至</text>
  380. <picker mode="date" :value="workForm.endTime" @change="bindWorkEndTimeChange">
  381. <view class="picker-text">{{ workForm.endTime || '结束时间' }}</view>
  382. </picker>
  383. </view>
  384. </view>
  385. </view>
  386. <view class="form-row">
  387. <view class="form-item">
  388. <text class="label">单位名称</text>
  389. <input type="text" v-model="workForm.companyName" placeholder="请输入单位名称" />
  390. </view>
  391. <view class="form-item">
  392. <text class="label">单位人数</text>
  393. <input type="number" v-model="workForm.employeeCount" placeholder="请输入单位人数" />
  394. </view>
  395. </view>
  396. <view class="form-row">
  397. <view class="form-item">
  398. <text class="label">任职部门</text>
  399. <input type="text" v-model="workForm.department" placeholder="请输入任职部门" />
  400. </view>
  401. <view class="form-item">
  402. <text class="label">担任职务</text>
  403. <input type="text" v-model="workForm.position" placeholder="请输入担任职务" />
  404. </view>
  405. </view>
  406. <view class="form-row">
  407. <view class="form-item">
  408. <text class="label">月总收入</text>
  409. <input type="digit" v-model="workForm.monthlySalary" placeholder="请输入月总收入" />
  410. </view>
  411. </view>
  412. <view class="form-row">
  413. <view class="form-item">
  414. <text class="label">直接领导</text>
  415. <input type="text" v-model="workForm.supervisor" placeholder="请输入直接领导姓名" />
  416. </view>
  417. <view class="form-item">
  418. <text class="label">领导电话</text>
  419. <input type="number" v-model="workForm.supervisorPhone" placeholder="请输入领导电话" />
  420. </view>
  421. </view>
  422. <view class="form-row button-row">
  423. <view class="form-item button-container">
  424. <button class="circle-btn" @click="saveWork">
  425. <text class="btn-icon">{{ isEditingWork ? '✓' : '+' }}</text>
  426. </button>
  427. <text class="btn-text">{{ isEditingWork ? '保存修改' : '添加工作经历' }}</text>
  428. </view>
  429. </view>
  430. </view>
  431. </view>
  432. </view>
  433. <!-- 修改导航按钮逻辑 -->
  434. <view class="nav-buttons">
  435. <button
  436. v-if="showPrevButton"
  437. class="nav-btn prev-btn"
  438. @click="prevStep"
  439. >上一步</button>
  440. <button
  441. v-if="showNextButton"
  442. class="nav-btn next-btn"
  443. @click="nextStep"
  444. >下一步</button>
  445. <button
  446. v-if="showSubmitButton"
  447. class="submit-btn"
  448. @click="submitForm"
  449. >提交</button>
  450. </view>
  451. </view>
  452. </template>
  453. <script>
  454. import { apiBaseUrl } from '@/common/config.js';
  455. export default {
  456. data() {
  457. return {
  458. // 添加承诺书相关数据
  459. showPromiseModal: true,
  460. promiseChecked: false,
  461. formData: {
  462. name: '',
  463. gender: '',
  464. threePeriod: '',
  465. birthDate: '',
  466. idCard: '',
  467. political: '',
  468. ethnic: '',
  469. height: '',
  470. weight: '',
  471. nativePlace: '',
  472. residence: '',
  473. marriage: '',
  474. expectedSalary: '',
  475. phone: '',
  476. email: '',
  477. currentAddress: '',
  478. emergencyContact: '',
  479. emergencyPhone: '',
  480. hobby: '',
  481. motto: '',
  482. // 添加应聘来源相关字段
  483. sourceType: 'social', // 默认为社招
  484. socialSource: '', // 社招来源
  485. otherSocialSource: '', // 其他社招来源
  486. otherSchoolSource: '', // 其他学校来源
  487. // 添加技能和培训字段
  488. skills: '',
  489. training: '',
  490. },
  491. genderOptions: ['男', '女'],
  492. genderIndex: -1,
  493. threePeriodOptions: ['无', '孕期', '产期', '哺乳期'],
  494. threePeriodIndex: -1,
  495. politicalOptions: ['群众', '共青团员', '中共党员', '民主党派'],
  496. politicalIndex: -1,
  497. ethnicOptions: ['汉族', '蒙古族', '回族', '藏族', '维吾尔族', '其他'],
  498. ethnicIndex: -1,
  499. marriageOptions: ['未婚', '已婚', '离异', '丧偶'],
  500. marriageIndex: -1,
  501. familyMembers: [],
  502. familyMemberForm: {
  503. relation: '',
  504. name: '',
  505. workplaceOrAddress: '',
  506. position: '',
  507. phone: '',
  508. isEmergencyContact: false // 添加新字段
  509. },
  510. isEditing: false,
  511. editingIndex: -1,
  512. // 添加教育经历相关数据
  513. educationList: [],
  514. educationForm: {
  515. startTime: '',
  516. endTime: '',
  517. schoolName: '',
  518. major: '',
  519. degree: ''
  520. },
  521. isEditingEducation: false,
  522. editingEducationIndex: -1,
  523. degreeOptions: ['高中', '中专', '大专', '本科', '硕士', '博士'],
  524. degreeIndex: -1,
  525. // 添加工作经历相关数据
  526. workList: [],
  527. workForm: {
  528. startTime: '',
  529. endTime: '',
  530. companyName: '',
  531. department: '',
  532. employeeCount: '',
  533. position: '',
  534. monthlySalary: '',
  535. supervisor: '',
  536. supervisorPhone: ''
  537. },
  538. isEditingWork: false,
  539. editingWorkIndex: -1,
  540. // 添加步骤控制
  541. currentStep: 1,
  542. steps: [
  543. { id: 1, name: '基本信息' },
  544. { id: 3, name: '家庭成员' },
  545. { id: 5, name: '教育经历' },
  546. { id: 6, name: '专业技能' },
  547. { id: 8, name: '工作经历' }
  548. ],
  549. formErrors: {
  550. name: '',
  551. idCard: '',
  552. phone: ''
  553. },
  554. // Add loading state
  555. isLoading: true,
  556. }
  557. },
  558. onLoad() {
  559. // Fetch user data when component loads
  560. this.fetchUserData();
  561. },
  562. computed: {
  563. // 添加计算属性来控制按钮显示
  564. showPrevButton() {
  565. return this.currentStep !== 1;
  566. },
  567. showNextButton() {
  568. return this.currentStep !== 8;
  569. },
  570. showSubmitButton() {
  571. return this.currentStep === 8;
  572. },
  573. // 获取当前步骤在数组中的索引
  574. currentStepIndex() {
  575. return this.steps.findIndex(step => step.id === this.currentStep);
  576. }
  577. },
  578. methods: {
  579. // 添加承诺书相关方法
  580. togglePromiseChecked() {
  581. this.promiseChecked = !this.promiseChecked;
  582. },
  583. confirmPromise() {
  584. if (this.promiseChecked) {
  585. this.showPromiseModal = false;
  586. } else {
  587. uni.showToast({
  588. title: '请先阅读并同意承诺书内容',
  589. icon: 'none'
  590. });
  591. }
  592. },
  593. bindGenderChange(e) {
  594. this.genderIndex = e.detail.value;
  595. this.formData.gender = this.genderOptions[this.genderIndex];
  596. // 如果性别从女变为男,清空三期选择
  597. if (this.formData.gender !== '女') {
  598. this.formData.threePeriod = '';
  599. this.threePeriodIndex = -1;
  600. }
  601. },
  602. bindThreePeriodChange(e) {
  603. this.threePeriodIndex = e.detail.value;
  604. this.formData.threePeriod = this.threePeriodOptions[this.threePeriodIndex];
  605. },
  606. bindPoliticalChange(e) {
  607. this.politicalIndex = e.detail.value;
  608. this.formData.political = this.politicalOptions[this.politicalIndex];
  609. },
  610. bindEthnicChange(e) {
  611. this.ethnicIndex = e.detail.value;
  612. this.formData.ethnic = this.ethnicOptions[this.ethnicIndex];
  613. },
  614. bindMarriageChange(e) {
  615. this.marriageIndex = e.detail.value;
  616. this.formData.marriage = this.marriageOptions[this.marriageIndex];
  617. },
  618. bindDateChange(e) {
  619. this.formData.birthDate = e.detail.value;
  620. },
  621. saveFamilyMember() {
  622. if (!this.familyMemberForm.relation) {
  623. uni.showToast({
  624. title: '请输入称谓',
  625. icon: 'none'
  626. });
  627. return;
  628. }
  629. if (!this.familyMemberForm.name) {
  630. uni.showToast({
  631. title: '请输入姓名',
  632. icon: 'none'
  633. });
  634. return;
  635. }
  636. if (!this.familyMemberForm.phone) {
  637. uni.showToast({
  638. title: '请输入联系电话',
  639. icon: 'none'
  640. });
  641. return;
  642. }
  643. if (this.isEditing) {
  644. // 如果取消了紧急联系人身份,且该成员原本是紧急联系人,清空紧急联系人信息
  645. if (!this.familyMemberForm.isEmergencyContact &&
  646. this.familyMembers[this.editingIndex].isEmergencyContact) {
  647. this.formData.emergencyContact = '';
  648. this.formData.emergencyPhone = '';
  649. }
  650. this.familyMembers[this.editingIndex] = {...this.familyMemberForm};
  651. uni.showToast({
  652. title: '修改成功',
  653. icon: 'success'
  654. });
  655. this.isEditing = false;
  656. this.editingIndex = -1;
  657. } else {
  658. this.familyMembers.push({...this.familyMemberForm});
  659. uni.showToast({
  660. title: '添加成功',
  661. icon: 'success'
  662. });
  663. }
  664. // 重置表单
  665. this.familyMemberForm = {
  666. relation: '',
  667. name: '',
  668. workplaceOrAddress: '',
  669. position: '',
  670. phone: '',
  671. isEmergencyContact: false
  672. };
  673. },
  674. editFamilyMember(index) {
  675. this.isEditing = true;
  676. this.editingIndex = index;
  677. this.familyMemberForm = {...this.familyMembers[index]};
  678. uni.pageScrollTo({
  679. selector: '.family-member-form',
  680. duration: 300
  681. });
  682. },
  683. cancelEdit() {
  684. this.isEditing = false;
  685. this.editingIndex = -1;
  686. this.familyMemberForm = {
  687. relation: '',
  688. name: '',
  689. workplaceOrAddress: '',
  690. position: '',
  691. phone: '',
  692. isEmergencyContact: false
  693. };
  694. },
  695. deleteFamilyMember(index) {
  696. if (this.isEditing && this.editingIndex === index) {
  697. this.cancelEdit();
  698. }
  699. this.familyMembers.splice(index, 1);
  700. uni.showToast({
  701. title: '已删除',
  702. icon: 'none'
  703. });
  704. },
  705. // 选择应聘来源类型
  706. selectSourceType(type) {
  707. this.formData.sourceType = type;
  708. if (type === 'social') {
  709. // 默认选择第一个社招来源
  710. this.formData.socialSource = 'BOSS';
  711. } else {
  712. // 清空社招来源
  713. this.formData.socialSource = '';
  714. }
  715. },
  716. // 选择社招来源
  717. selectSocialSource(source) {
  718. this.formData.sourceType = 'social';
  719. this.formData.socialSource = source;
  720. },
  721. // 教育经历相关方法
  722. bindStartTimeChange(e) {
  723. this.educationForm.startTime = e.detail.value;
  724. },
  725. bindEndTimeChange(e) {
  726. this.educationForm.endTime = e.detail.value;
  727. },
  728. bindDegreeChange(e) {
  729. this.degreeIndex = e.detail.value;
  730. this.educationForm.degree = this.degreeOptions[this.degreeIndex];
  731. },
  732. saveEducation() {
  733. if (!this.educationForm.startTime) {
  734. uni.showToast({
  735. title: '请选择开始时间',
  736. icon: 'none'
  737. });
  738. return;
  739. }
  740. if (!this.educationForm.endTime) {
  741. uni.showToast({
  742. title: '请选择结束时间',
  743. icon: 'none'
  744. });
  745. return;
  746. }
  747. if (!this.educationForm.schoolName) {
  748. uni.showToast({
  749. title: '请输入学校名称',
  750. icon: 'none'
  751. });
  752. return;
  753. }
  754. if (!this.educationForm.major) {
  755. uni.showToast({
  756. title: '请输入专业',
  757. icon: 'none'
  758. });
  759. return;
  760. }
  761. if (!this.educationForm.degree) {
  762. uni.showToast({
  763. title: '请选择学历',
  764. icon: 'none'
  765. });
  766. return;
  767. }
  768. if (this.isEditingEducation) {
  769. this.educationList[this.editingEducationIndex] = {...this.educationForm};
  770. uni.showToast({
  771. title: '修改成功',
  772. icon: 'success'
  773. });
  774. this.isEditingEducation = false;
  775. this.editingEducationIndex = -1;
  776. } else {
  777. this.educationList.push({...this.educationForm});
  778. uni.showToast({
  779. title: '添加成功',
  780. icon: 'success'
  781. });
  782. }
  783. this.educationForm = {
  784. startTime: '',
  785. endTime: '',
  786. schoolName: '',
  787. major: '',
  788. degree: ''
  789. };
  790. this.degreeIndex = -1;
  791. },
  792. editEducation(index) {
  793. this.isEditingEducation = true;
  794. this.editingEducationIndex = index;
  795. this.educationForm = {...this.educationList[index]};
  796. // 设置学历索引
  797. this.degreeIndex = this.degreeOptions.findIndex(item => item === this.educationForm.degree);
  798. uni.pageScrollTo({
  799. selector: '.education-form',
  800. duration: 300
  801. });
  802. },
  803. cancelEditEducation() {
  804. this.isEditingEducation = false;
  805. this.editingEducationIndex = -1;
  806. this.educationForm = {
  807. startTime: '',
  808. endTime: '',
  809. schoolName: '',
  810. major: '',
  811. degree: ''
  812. };
  813. this.degreeIndex = -1;
  814. },
  815. deleteEducation(index) {
  816. if (this.isEditingEducation && this.editingEducationIndex === index) {
  817. this.cancelEditEducation();
  818. }
  819. this.educationList.splice(index, 1);
  820. uni.showToast({
  821. title: '已删除',
  822. icon: 'none'
  823. });
  824. },
  825. // 工作经历相关方法
  826. bindWorkStartTimeChange(e) {
  827. this.workForm.startTime = e.detail.value;
  828. },
  829. bindWorkEndTimeChange(e) {
  830. this.workForm.endTime = e.detail.value;
  831. },
  832. saveWork() {
  833. if (!this.workForm.startTime) {
  834. uni.showToast({
  835. title: '请选择开始时间',
  836. icon: 'none'
  837. });
  838. return;
  839. }
  840. if (!this.workForm.endTime) {
  841. uni.showToast({
  842. title: '请选择结束时间',
  843. icon: 'none'
  844. });
  845. return;
  846. }
  847. if (!this.workForm.companyName) {
  848. uni.showToast({
  849. title: '请输入单位名称',
  850. icon: 'none'
  851. });
  852. return;
  853. }
  854. if (!this.workForm.department) {
  855. uni.showToast({
  856. title: '请输入任职部门',
  857. icon: 'none'
  858. });
  859. return;
  860. }
  861. if (!this.workForm.position) {
  862. uni.showToast({
  863. title: '请输入担任职务',
  864. icon: 'none'
  865. });
  866. return;
  867. }
  868. if (this.isEditingWork) {
  869. this.workList[this.editingWorkIndex] = {...this.workForm};
  870. uni.showToast({
  871. title: '修改成功',
  872. icon: 'success'
  873. });
  874. this.isEditingWork = false;
  875. this.editingWorkIndex = -1;
  876. } else {
  877. this.workList.push({...this.workForm});
  878. uni.showToast({
  879. title: '添加成功',
  880. icon: 'success'
  881. });
  882. }
  883. this.workForm = {
  884. startTime: '',
  885. endTime: '',
  886. companyName: '',
  887. department: '',
  888. employeeCount: '',
  889. position: '',
  890. monthlySalary: '',
  891. supervisor: '',
  892. supervisorPhone: ''
  893. };
  894. },
  895. editWork(index) {
  896. this.isEditingWork = true;
  897. this.editingWorkIndex = index;
  898. this.workForm = {...this.workList[index]};
  899. uni.pageScrollTo({
  900. selector: '.work-form',
  901. duration: 300
  902. });
  903. },
  904. cancelEditWork() {
  905. this.isEditingWork = false;
  906. this.editingWorkIndex = -1;
  907. this.workForm = {
  908. startTime: '',
  909. endTime: '',
  910. companyName: '',
  911. department: '',
  912. employeeCount: '',
  913. position: '',
  914. monthlySalary: '',
  915. supervisor: '',
  916. supervisorPhone: ''
  917. };
  918. },
  919. deleteWork(index) {
  920. if (this.isEditingWork && this.editingWorkIndex === index) {
  921. this.cancelEditWork();
  922. }
  923. this.workList.splice(index, 1);
  924. uni.showToast({
  925. title: '已删除',
  926. icon: 'none'
  927. });
  928. },
  929. submitForm() {
  930. // 验证当前步骤
  931. if (!this.validateCurrentStep()) {
  932. return;
  933. }
  934. // 检查必要的用户信息
  935. const userInfo = uni.getStorageSync('userInfo');
  936. if (!userInfo) {
  937. uni.showToast({
  938. title: '用户信息获取失败,请重新登录',
  939. icon: 'none',
  940. duration: 2000
  941. });
  942. return;
  943. }
  944. try {
  945. const userData = JSON.parse(userInfo);
  946. const submitData = {
  947. tenant_id: 1,
  948. user_id: userData.id,
  949. personal_info: {
  950. name: this.formData.name,
  951. gender: this.formData.gender,
  952. phone: this.formData.phone,
  953. id_card: this.formData.idCard,
  954. address: this.formData.currentAddress,
  955. professional_skills: this.formData.skills ? this.formData.skills.split(',') : []
  956. },
  957. profile: {
  958. female_status: this.getFemaleStatus(),
  959. marital_status: this.getMaritalStatus(),
  960. height: parseFloat(this.formData.height) || 0,
  961. weight: parseFloat(this.formData.weight) || 0,
  962. ethnicity: this.formData.ethnic,
  963. current_address: this.formData.currentAddress,
  964. expected_salary: parseFloat(this.formData.expectedSalary) || 0
  965. },
  966. educations: this.formatEducations(),
  967. family_members: this.formatFamilyMembers(),
  968. work_experiences: this.formatWorkExperiences()
  969. };
  970. // 数据检查
  971. if (!submitData.personal_info.name || !submitData.personal_info.gender || !submitData.personal_info.phone) {
  972. uni.showToast({
  973. title: '基本信息不完整',
  974. icon: 'none',
  975. duration: 2000
  976. });
  977. return;
  978. }
  979. this.sendFormData(submitData);
  980. } catch (error) {
  981. console.error('数据处理错误:', error);
  982. uni.showToast({
  983. title: '数据处理错误,请重试',
  984. icon: 'none',
  985. duration: 2000
  986. });
  987. }
  988. },
  989. // 辅助方法:发送表单数据
  990. sendFormData(submitData) {
  991. uni.showLoading({ title: '提交中...' });
  992. // 添加请求头和token
  993. const token = uni.getStorageSync('token');
  994. uni.request({
  995. url: `${apiBaseUrl}/wechat/user/profile/update`,
  996. method: 'POST',
  997. data: submitData,
  998. header: {
  999. 'content-type': 'application/json',
  1000. 'Authorization': token ? `Bearer ${token}` : ''
  1001. },
  1002. success: (res) => {
  1003. uni.hideLoading();
  1004. if (res.statusCode === 200) {
  1005. if (res.data.code === 2000) {
  1006. uni.showToast({
  1007. title: '提交成功',
  1008. icon: 'success',
  1009. duration: 2000
  1010. });
  1011. setTimeout(() => {
  1012. uni.navigateTo({
  1013. url: '/pages/interview-notice/interview-notice'
  1014. });
  1015. }, 2000);
  1016. } else {
  1017. uni.showToast({
  1018. title: res.data.msg || '提交失败',
  1019. icon: 'none',
  1020. duration: 2000
  1021. });
  1022. }
  1023. } else {
  1024. uni.showToast({
  1025. title: '服务器响应错误',
  1026. icon: 'none',
  1027. duration: 2000
  1028. });
  1029. }
  1030. },
  1031. fail: (err) => {
  1032. console.error('提交失败:', err);
  1033. uni.hideLoading();
  1034. // 检查具体错误类型
  1035. if (err.errMsg.includes('timeout')) {
  1036. uni.showToast({
  1037. title: '请求超时,请检查网络后重试',
  1038. icon: 'none',
  1039. duration: 2000
  1040. });
  1041. } else if (err.errMsg.includes('fail')) {
  1042. uni.showToast({
  1043. title: '网络连接失败,请检查网络设置',
  1044. icon: 'none',
  1045. duration: 2000
  1046. });
  1047. } else {
  1048. uni.showToast({
  1049. title: '提交失败,请稍后重试',
  1050. icon: 'none',
  1051. duration: 2000
  1052. });
  1053. }
  1054. },
  1055. complete: () => {
  1056. // 可以在这里添加完成后的处理逻辑
  1057. }
  1058. });
  1059. },
  1060. // 数据格式化方法
  1061. getFemaleStatus() {
  1062. if (this.formData.gender !== '女') return 0;
  1063. const statusMap = { '孕期': 1, '产期': 2, '哺乳期': 3 };
  1064. return statusMap[this.formData.threePeriod] || 0;
  1065. },
  1066. getMaritalStatus() {
  1067. const statusMap = { '未婚': 0, '已婚': 1, '离异': 2, '丧偶': 3 };
  1068. return statusMap[this.formData.marriage] || 0;
  1069. },
  1070. formatEducations() {
  1071. return this.educationList.map((edu, index) => ({
  1072. education_type: index === 0 ? 1 : 2,
  1073. degree: this.mapDegreeToNumber(edu.degree),
  1074. start_date: edu.startTime,
  1075. end_date: edu.endTime,
  1076. school_name: edu.schoolName,
  1077. major: edu.major
  1078. }));
  1079. },
  1080. formatFamilyMembers() {
  1081. return this.familyMembers.map(member => ({
  1082. relation: member.relation,
  1083. name: member.name,
  1084. workplace: member.workplaceOrAddress,
  1085. position: member.position,
  1086. phone: member.phone,
  1087. //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
  1088. }));
  1089. },
  1090. formatWorkExperiences() {
  1091. return this.workList.map(work => ({
  1092. start_date: work.startTime,
  1093. end_date: work.endTime,
  1094. company_name: work.companyName,
  1095. department: work.department,
  1096. company_size: work.employeeCount,
  1097. position: work.position,
  1098. monthly_salary: work.monthlySalary,
  1099. supervisor_name: work.supervisor,
  1100. supervisor_phone: work.supervisorPhone
  1101. }));
  1102. },
  1103. // 学历映射辅助方法
  1104. mapDegreeToNumber(degreeText) {
  1105. const degreeMap = {
  1106. '高中': 1,
  1107. '中专': 1,
  1108. '大专': 2,
  1109. '本科': 3,
  1110. '硕士': 4,
  1111. '博士': 5
  1112. };
  1113. return degreeMap[degreeText] || 6; // 默认为其他
  1114. },
  1115. prevStep() {
  1116. const prevIndex = this.currentStepIndex - 1;
  1117. if (prevIndex >= 0) {
  1118. this.currentStep = this.steps[prevIndex].id;
  1119. // 滚动到页面顶部
  1120. uni.pageScrollTo({
  1121. scrollTop: 0,
  1122. duration: 300
  1123. });
  1124. }
  1125. },
  1126. nextStep() {
  1127. // 验证当前步骤
  1128. if (!this.validateCurrentStep()) {
  1129. return;
  1130. }
  1131. // 如果是第一步,需要进行身份验证
  1132. if (this.currentStep === 1) {
  1133. this.verifyIdentity();
  1134. return;
  1135. }
  1136. const nextIndex = this.currentStepIndex + 1;
  1137. if (nextIndex < this.steps.length) {
  1138. this.currentStep = this.steps[nextIndex].id;
  1139. // 滚动到页面顶部
  1140. uni.pageScrollTo({
  1141. scrollTop: 0,
  1142. duration: 300
  1143. });
  1144. }
  1145. },
  1146. // 身份验证方法
  1147. verifyIdentity() {
  1148. // 清空错误信息
  1149. this.formErrors = {
  1150. name: '',
  1151. idCard: '',
  1152. phone: ''
  1153. };
  1154. uni.showLoading({
  1155. title: '身份验证中...'
  1156. });
  1157. uni.request({
  1158. url: `${apiBaseUrl}/wechat/identity/verify`,
  1159. method: 'POST',
  1160. data: {
  1161. name: this.formData.name,
  1162. id_number: this.formData.idCard,
  1163. mobile: this.formData.phone
  1164. },
  1165. header: {
  1166. 'content-type': 'application/x-www-form-urlencoded'
  1167. },
  1168. success: (res) => {
  1169. uni.hideLoading();
  1170. console.log(res);
  1171. if (res.data.code === 200) {
  1172. // 验证通过,进入下一步
  1173. const nextIndex = this.currentStepIndex + 1;
  1174. if (nextIndex < this.steps.length) {
  1175. this.currentStep = this.steps[nextIndex].id;
  1176. uni.pageScrollTo({
  1177. scrollTop: 0,
  1178. duration: 300
  1179. });
  1180. }
  1181. /* 保存姓名 */
  1182. this.setUserInfo(this.formData);
  1183. } else {
  1184. // 验证失败,显示错误信息
  1185. this.handleVerificationError(res.data);
  1186. }
  1187. },
  1188. fail: (err) => {
  1189. this.handleRequestError(err);
  1190. }
  1191. });
  1192. },
  1193. setUserInfo(data) {
  1194. uni.request({
  1195. url: `${apiBaseUrl}/wechat/updateUserInfo`,
  1196. method: 'POST',
  1197. data: {
  1198. openid: JSON.parse(uni.getStorageSync('userInfo')).openid,
  1199. name: data.name,
  1200. id_number: data.idCard,
  1201. purePhoneNumber: data.phone,
  1202. tenant_id: 1,
  1203. examine:0
  1204. },
  1205. header: {
  1206. 'content-type': 'application/x-www-form-urlencoded'
  1207. },
  1208. success: (res) => {
  1209. console.log(res);
  1210. }
  1211. });
  1212. },
  1213. // 处理验证错误
  1214. handleVerificationError(data) {
  1215. this.formErrors.name = '姓名验证失败,请检查姓名是否正确';
  1216. this.formErrors.idCard = '身份证号验证失败,请检查身份证号是否正确';
  1217. this.formErrors.phone = '手机号验证失败,请检查手机号是否正确';
  1218. uni.showToast({
  1219. title: data.msg || '身份验证失败',
  1220. icon: 'none'
  1221. });
  1222. },
  1223. // 处理请求错误
  1224. handleRequestError(err) {
  1225. uni.hideLoading();
  1226. uni.showToast({
  1227. title: '网络错误,请检查网络连接',
  1228. icon: 'none',
  1229. duration: 2000
  1230. });
  1231. console.error('请求失败:', err);
  1232. },
  1233. // 验证当前步骤的必填项
  1234. validateCurrentStep() {
  1235. const validations = {
  1236. // 第一步:基本信息验证
  1237. 1: () => {
  1238. const basicChecks = [
  1239. { value: this.formData.name, message: '请输入姓名' },
  1240. { value: this.formData.gender, message: '请选择性别' },
  1241. { value: this.formData.phone, message: '请输入手机号' },
  1242. { value: this.formData.idCard, message: '请输入身份证号' }
  1243. ];
  1244. for (const check of basicChecks) {
  1245. if (!check.value) {
  1246. uni.showToast({ title: check.message, icon: 'none' });
  1247. return false;
  1248. }
  1249. }
  1250. // 女性三期状态检查
  1251. if (this.formData.gender === '女' && this.threePeriodIndex === -1) {
  1252. uni.showToast({ title: '请选择是否为三期', icon: 'none' });
  1253. return false;
  1254. }
  1255. return true;
  1256. },
  1257. // 第二步:家庭成员验证
  1258. 3: () => {
  1259. if (this.familyMembers.length === 0) {
  1260. uni.showToast({ title: '请至少添加一位家庭成员', icon: 'none' });
  1261. return false;
  1262. }
  1263. return true;
  1264. },
  1265. // 第三步:教育经历验证
  1266. 5: () => {
  1267. if (this.educationList.length === 0) {
  1268. uni.showToast({ title: '请至少添加一项教育经历', icon: 'none' });
  1269. return false;
  1270. }
  1271. return true;
  1272. },
  1273. // 第四步:专业技能验证
  1274. 6: () => {
  1275. if (!this.formData.skills) {
  1276. uni.showToast({ title: '请描述您的专业技能', icon: 'none' });
  1277. return false;
  1278. }
  1279. return true;
  1280. },
  1281. // 第五步:工作经历验证
  1282. 8: () => {
  1283. if (this.workList.length === 0) {
  1284. uni.showToast({ title: '请至少添加一项工作经历', icon: 'none' });
  1285. return false;
  1286. }
  1287. // 验证每个工作经历的必填项
  1288. for (let i = 0; i < this.workList.length; i++) {
  1289. const work = this.workList[i];
  1290. const workChecks = [
  1291. { value: work.startTime, message: `单位${i+1}:请选择开始时间` },
  1292. { value: work.endTime, message: `单位${i+1}:请选择结束时间` },
  1293. { value: work.companyName, message: `单位${i+1}:请输入单位名称` },
  1294. { value: work.department, message: `单位${i+1}:请输入任职部门` },
  1295. { value: work.position, message: `单位${i+1}:请输入担任职务` }
  1296. ];
  1297. for (const check of workChecks) {
  1298. if (!check.value) {
  1299. uni.showToast({ title: check.message, icon: 'none' });
  1300. return false;
  1301. }
  1302. }
  1303. }
  1304. return true;
  1305. }
  1306. };
  1307. return validations[this.currentStep] ? validations[this.currentStep]() : true;
  1308. },
  1309. // Add method to fetch user data
  1310. fetchUserData() {
  1311. this.isLoading = true;
  1312. // Get openid from storage
  1313. const userInfo = uni.getStorageSync('userInfo') ? JSON.parse(uni.getStorageSync('userInfo')) : {};
  1314. const openid = userInfo.openid;
  1315. if (!openid) {
  1316. uni.showToast({
  1317. title: '用户信息获取失败,请重新登录',
  1318. icon: 'none'
  1319. });
  1320. this.isLoading = false;
  1321. return;
  1322. }
  1323. uni.request({
  1324. url: `${apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=1&openid=${openid}`,
  1325. method: 'GET',
  1326. success: (res) => {
  1327. // 无论结果如何,都保持承诺书显示状态
  1328. this.showPromiseModal = true;
  1329. /* if (res.data.code === 2000) { */
  1330. // Successfully fetched data
  1331. this.populateFormData(res.data.data);
  1332. /* } else {
  1333. uni.showToast({
  1334. title: res.data.msg || '获取用户信息失败',
  1335. icon: 'none'
  1336. });
  1337. } */
  1338. },
  1339. fail: (err) => {
  1340. /* console.error('获取用户信息失败:', err);
  1341. uni.showToast({
  1342. title: '网络错误,请检查网络连接',
  1343. icon: 'none'
  1344. }); */
  1345. },
  1346. complete: () => {
  1347. this.isLoading = false;
  1348. }
  1349. });
  1350. },
  1351. // Add method to populate form data with fetched data
  1352. populateFormData(data) {
  1353. const { user_info, profile, educations, work_experiences, family_members } = data;
  1354. // Populate basic user info
  1355. if (user_info) {
  1356. this.formData.name = user_info.name || '';
  1357. this.formData.gender = user_info.gender_text || '';
  1358. this.genderIndex = this.genderOptions.findIndex(item => item === this.formData.gender);
  1359. this.formData.idCard = user_info.id_card || '';
  1360. this.formData.phone = user_info.phone || '';
  1361. this.formData.email = user_info.email || '';
  1362. }
  1363. // Populate profile data
  1364. if (profile) {
  1365. // Set political status
  1366. this.formData.political = profile.political_status || '';
  1367. this.politicalIndex = this.politicalOptions.findIndex(item => item === this.formData.political);
  1368. // Set ethnic
  1369. this.formData.ethnic = profile.ethnicity || '';
  1370. this.ethnicIndex = this.ethnicOptions.findIndex(item => item === this.formData.ethnic);
  1371. // Set height and weight
  1372. this.formData.height = profile.height || '';
  1373. this.formData.weight = profile.weight || '';
  1374. // Set native place and residence
  1375. this.formData.nativePlace = profile.native_place || '';
  1376. this.formData.residence = profile.household_location || '';
  1377. // Set current address
  1378. this.formData.currentAddress = profile.current_address || '';
  1379. // Set marriage status
  1380. this.formData.marriage = profile.marital_status_text || '';
  1381. this.marriageIndex = this.marriageOptions.findIndex(item => item === this.formData.marriage);
  1382. // Set three period status for female
  1383. if (this.formData.gender === '女' && profile.female_status !== undefined) {
  1384. const femaleStatusMap = {0: '无', 1: '孕期', 2: '产期', 3: '哺乳期'};
  1385. this.formData.threePeriod = femaleStatusMap[profile.female_status] || '无';
  1386. this.threePeriodIndex = this.threePeriodOptions.findIndex(item => item === this.formData.threePeriod);
  1387. }
  1388. // Set expected salary
  1389. this.formData.expectedSalary = profile.expected_salary || '';
  1390. // Set emergency contact
  1391. this.formData.emergencyContact = profile.emergency_contact || '';
  1392. this.formData.emergencyPhone = profile.emergency_phone || '';
  1393. // Set hobby and motto
  1394. this.formData.hobby = profile.specialties || '';
  1395. this.formData.motto = profile.life_motto || '';
  1396. // Set recruitment source
  1397. const sourceTypeMap = {
  1398. 1: 'school',
  1399. 2: 'social',
  1400. 3: 'social',
  1401. 4: 'social',
  1402. 5: 'social'
  1403. };
  1404. const socialSourceMap = {
  1405. 2: 'BOSS',
  1406. 3: 'zhilian',
  1407. 4: 'liepin',
  1408. 5: 'other'
  1409. };
  1410. this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || 'social';
  1411. if (this.formData.sourceType === 'social') {
  1412. this.formData.socialSource = socialSourceMap[profile.recruitment_source] || '';
  1413. if (this.formData.socialSource === 'other') {
  1414. this.formData.otherSocialSource = profile.recruitment_source_detail || '';
  1415. }
  1416. } else if (this.formData.sourceType === 'school') {
  1417. this.formData.otherSchoolSource = profile.recruitment_source_detail || '';
  1418. }
  1419. }
  1420. // Populate educations data
  1421. if (educations && educations.length > 0) {
  1422. this.educationList = educations.map(edu => {
  1423. const degreeMap = {
  1424. 1: '高中',
  1425. 2: '大专',
  1426. 3: '本科',
  1427. 4: '硕士',
  1428. 5: '博士'
  1429. };
  1430. return {
  1431. startTime: edu.start_date || '',
  1432. endTime: edu.end_date || '',
  1433. schoolName: edu.school_name || '',
  1434. major: edu.major || '',
  1435. degree: degreeMap[edu.degree] || ''
  1436. };
  1437. });
  1438. }
  1439. // Populate work experience data
  1440. if (work_experiences && work_experiences.length > 0) {
  1441. this.workList = work_experiences.map(work => {
  1442. return {
  1443. startTime: work.start_date || '',
  1444. endTime: work.end_date || '',
  1445. companyName: work.company_name || '',
  1446. department: work.department || '',
  1447. employeeCount: work.company_size || '',
  1448. position: work.position || '',
  1449. monthlySalary: work.monthly_salary || '',
  1450. supervisor: work.supervisor_name || '',
  1451. supervisorPhone: work.supervisor_phone || ''
  1452. };
  1453. });
  1454. }
  1455. // Populate family members data
  1456. if (family_members && family_members.length > 0) {
  1457. this.familyMembers = family_members.map(member => {
  1458. return {
  1459. relation: member.relation || '',
  1460. name: member.name || '',
  1461. workplaceOrAddress: member.workplace || '',
  1462. position: member.position || '',
  1463. phone: member.phone || '',
  1464. isEmergencyContact: member.isEmergencyContact || false
  1465. };
  1466. });
  1467. }
  1468. // 移除这段代码,确保承诺书始终显示
  1469. // if (user_info && user_info.is_profile_complete) {
  1470. // this.showPromiseModal = false;
  1471. // }
  1472. },
  1473. // 处理紧急联系人开关变化
  1474. handleEmergencyContactChange(e) {
  1475. this.familyMemberForm.isEmergencyContact = e.detail.value;
  1476. // 如果设置为紧急联系人,自动填充到紧急联系人字段
  1477. if (e.detail.value) {
  1478. this.formData.emergencyContact = this.familyMemberForm.name;
  1479. this.formData.emergencyPhone = this.familyMemberForm.phone;
  1480. }
  1481. },
  1482. },
  1483. // 添加监听器来清除错误信息
  1484. watch: {
  1485. 'formData.name': function(newVal) {
  1486. if (newVal && this.formErrors.name) {
  1487. this.formErrors.name = '';
  1488. }
  1489. },
  1490. 'formData.idCard': function(newVal) {
  1491. if (newVal && this.formErrors.idCard) {
  1492. this.formErrors.idCard = '';
  1493. }
  1494. },
  1495. 'formData.phone': function(newVal) {
  1496. if (newVal && this.formErrors.phone) {
  1497. this.formErrors.phone = '';
  1498. }
  1499. }
  1500. },
  1501. }
  1502. </script>
  1503. <style>
  1504. .personal-container {
  1505. padding: 20rpx;
  1506. }
  1507. .form-title {
  1508. font-size: 36rpx;
  1509. font-weight: bold;
  1510. text-align: center;
  1511. margin-bottom: 30rpx;
  1512. }
  1513. .form-container {
  1514. background-color: #fff;
  1515. border-radius: 10rpx;
  1516. padding: 20rpx;
  1517. }
  1518. .section-title {
  1519. font-size: 32rpx;
  1520. font-weight: bold;
  1521. margin: 30rpx 0 20rpx 10rpx;
  1522. color: #333;
  1523. border-left: 4rpx solid #0039b3;
  1524. padding-left: 15rpx;
  1525. }
  1526. .form-row {
  1527. display: flex;
  1528. flex-direction: row;
  1529. margin-bottom: 20rpx;
  1530. flex-wrap: wrap;
  1531. }
  1532. .form-item {
  1533. flex: 1;
  1534. min-width: 300rpx;
  1535. margin: 10rpx;
  1536. border-bottom: 1px solid #eee;
  1537. padding-bottom: 10rpx;
  1538. }
  1539. .label {
  1540. font-size: 28rpx;
  1541. color: #333;
  1542. margin-right: 10rpx;
  1543. display: block;
  1544. margin-bottom: 10rpx;
  1545. }
  1546. input {
  1547. font-size: 28rpx;
  1548. height: 60rpx;
  1549. }
  1550. .picker-text {
  1551. font-size: 28rpx;
  1552. height: 60rpx;
  1553. line-height: 60rpx;
  1554. color: #666;
  1555. }
  1556. .submit-btn {
  1557. margin-top: 40rpx;
  1558. background-color: #0039b3;
  1559. color: #fff;
  1560. }
  1561. .family-members-list {
  1562. margin-top: 20rpx;
  1563. }
  1564. .family-member-item {
  1565. background-color: #f8f8f8;
  1566. border-radius: 8rpx;
  1567. padding: 20rpx;
  1568. margin-bottom: 20rpx;
  1569. }
  1570. .family-member-header {
  1571. display: flex;
  1572. justify-content: space-between;
  1573. align-items: center;
  1574. margin-bottom: 15rpx;
  1575. border-bottom: 1px solid #eee;
  1576. padding-bottom: 10rpx;
  1577. }
  1578. .family-member-title {
  1579. font-size: 30rpx;
  1580. font-weight: bold;
  1581. color: #333;
  1582. }
  1583. .family-member-actions {
  1584. display: flex;
  1585. gap: 20rpx;
  1586. }
  1587. .family-member-edit {
  1588. font-size: 26rpx;
  1589. color: #1890ff;
  1590. }
  1591. .family-member-delete {
  1592. font-size: 26rpx;
  1593. color: #ff4d4f;
  1594. }
  1595. .form-subtitle {
  1596. font-size: 28rpx;
  1597. font-weight: bold;
  1598. margin-bottom: 20rpx;
  1599. display: flex;
  1600. justify-content: space-between;
  1601. align-items: center;
  1602. }
  1603. .cancel-edit {
  1604. font-size: 26rpx;
  1605. color: #999;
  1606. font-weight: normal;
  1607. }
  1608. .family-member-content {
  1609. padding: 10rpx 0;
  1610. }
  1611. .family-member-row {
  1612. display: flex;
  1613. margin-bottom: 10rpx;
  1614. }
  1615. .family-member-label {
  1616. font-size: 26rpx;
  1617. color: #666;
  1618. width: 200rpx;
  1619. }
  1620. .family-member-value {
  1621. font-size: 26rpx;
  1622. color: #333;
  1623. flex: 1;
  1624. }
  1625. .family-member-form {
  1626. background-color: #fff;
  1627. border-radius: 8rpx;
  1628. padding: 20rpx;
  1629. margin-top: 20rpx;
  1630. }
  1631. .form-row button-row {
  1632. display: flex;
  1633. justify-content: center;
  1634. margin-top: 20rpx;
  1635. }
  1636. .form-item button-container {
  1637. display: flex;
  1638. flex-direction: column;
  1639. align-items: center;
  1640. }
  1641. .circle-btn {
  1642. width: 40rpx;
  1643. height: 40rpx;
  1644. border-radius: 50%;
  1645. background-color: #0039b3;
  1646. display: flex;
  1647. justify-content: center;
  1648. align-items: center;
  1649. margin-bottom: 10rpx;
  1650. }
  1651. .btn-icon {
  1652. font-size: 32rpx;
  1653. color: #fff;
  1654. }
  1655. .btn-text {
  1656. font-size: 28rpx;
  1657. color: #333;
  1658. }
  1659. /* 添加圆形按钮相关样式 */
  1660. .button-row {
  1661. justify-content: center;
  1662. margin-top: 30rpx;
  1663. }
  1664. .button-container {
  1665. display: flex;
  1666. flex-direction: column;
  1667. align-items: center;
  1668. border-bottom: none;
  1669. min-width: auto;
  1670. }
  1671. .circle-btn {
  1672. width: 100rpx;
  1673. height: 100rpx;
  1674. border-radius: 50%;
  1675. padding: 0;
  1676. display: flex;
  1677. align-items: center;
  1678. justify-content: center;
  1679. background-color: #0039b3;
  1680. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.1);
  1681. margin: 0;
  1682. }
  1683. .btn-icon {
  1684. font-size: 50rpx;
  1685. color: #fff;
  1686. line-height: 1;
  1687. }
  1688. .btn-text {
  1689. font-size: 24rpx;
  1690. color: #666;
  1691. margin-top: 10rpx;
  1692. }
  1693. /* 编辑状态下的按钮颜色 */
  1694. .circle-btn.editing {
  1695. background-color: #1890ff;
  1696. }
  1697. /* 移除原来的添加按钮样式 */
  1698. .add-member-btn {
  1699. display: none;
  1700. }
  1701. /* 应聘来源样式 */
  1702. .source-container {
  1703. background-color: #fff;
  1704. border-radius: 10rpx;
  1705. padding: 20rpx;
  1706. margin-bottom: 30rpx;
  1707. }
  1708. .source-row {
  1709. display: flex;
  1710. margin-bottom: 20rpx;
  1711. align-items: flex-start;
  1712. }
  1713. .source-label {
  1714. width: 120rpx;
  1715. font-size: 28rpx;
  1716. color: #333;
  1717. padding-top: 6rpx;
  1718. }
  1719. .source-options {
  1720. flex: 1;
  1721. display: flex;
  1722. flex-wrap: wrap;
  1723. }
  1724. .source-option {
  1725. display: flex;
  1726. align-items: center;
  1727. margin-right: 30rpx;
  1728. margin-bottom: 15rpx;
  1729. }
  1730. .source-option text {
  1731. font-size: 28rpx;
  1732. margin-left: 8rpx;
  1733. }
  1734. .other-option {
  1735. flex-basis: 100%;
  1736. margin-top: 10rpx;
  1737. }
  1738. .other-option input {
  1739. border-bottom: 1px solid #eee;
  1740. width: 300rpx;
  1741. margin-left: 10rpx;
  1742. font-size: 28rpx;
  1743. }
  1744. /* 教育经历样式 */
  1745. .education-list {
  1746. margin-top: 20rpx;
  1747. }
  1748. .education-item {
  1749. background-color: #f8f8f8;
  1750. border-radius: 8rpx;
  1751. padding: 20rpx;
  1752. margin-bottom: 20rpx;
  1753. }
  1754. .education-header {
  1755. display: flex;
  1756. justify-content: space-between;
  1757. align-items: center;
  1758. margin-bottom: 15rpx;
  1759. border-bottom: 1px solid #eee;
  1760. padding-bottom: 10rpx;
  1761. }
  1762. .education-title {
  1763. font-size: 30rpx;
  1764. font-weight: bold;
  1765. color: #333;
  1766. }
  1767. .education-actions {
  1768. display: flex;
  1769. gap: 20rpx;
  1770. }
  1771. .education-edit {
  1772. font-size: 26rpx;
  1773. color: #1890ff;
  1774. }
  1775. .education-delete {
  1776. font-size: 26rpx;
  1777. color: #ff4d4f;
  1778. }
  1779. .education-content {
  1780. padding: 10rpx 0;
  1781. }
  1782. .education-row {
  1783. display: flex;
  1784. margin-bottom: 10rpx;
  1785. }
  1786. .education-label {
  1787. font-size: 26rpx;
  1788. color: #666;
  1789. width: 150rpx;
  1790. }
  1791. .education-value {
  1792. font-size: 26rpx;
  1793. color: #333;
  1794. flex: 1;
  1795. }
  1796. .education-form {
  1797. background-color: #fff;
  1798. border-radius: 8rpx;
  1799. padding: 20rpx;
  1800. margin-top: 20rpx;
  1801. }
  1802. .date-range {
  1803. display: flex;
  1804. align-items: center;
  1805. justify-content: space-around;
  1806. }
  1807. .date-separator {
  1808. margin: 0 10rpx;
  1809. color: #666;
  1810. }
  1811. /* 专业技能和培训样式 */
  1812. .skills-container, .training-container {
  1813. background-color: #fff;
  1814. border-radius: 10rpx;
  1815. padding: 20rpx;
  1816. margin-bottom: 20rpx;
  1817. }
  1818. .skills-textarea, .training-textarea {
  1819. width: 100%;
  1820. height: 200rpx;
  1821. font-size: 28rpx;
  1822. line-height: 1.5;
  1823. padding: 10rpx;
  1824. box-sizing: border-box;
  1825. border: 1px solid #eee;
  1826. border-radius: 6rpx;
  1827. }
  1828. /* 工作经历样式 */
  1829. .work-list {
  1830. margin-top: 20rpx;
  1831. }
  1832. .work-item {
  1833. background-color: #f8f8f8;
  1834. border-radius: 8rpx;
  1835. padding: 20rpx;
  1836. margin-bottom: 20rpx;
  1837. }
  1838. .work-header {
  1839. display: flex;
  1840. justify-content: space-between;
  1841. align-items: center;
  1842. margin-bottom: 15rpx;
  1843. border-bottom: 1px solid #eee;
  1844. padding-bottom: 10rpx;
  1845. }
  1846. .work-title {
  1847. font-size: 30rpx;
  1848. font-weight: bold;
  1849. color: #333;
  1850. }
  1851. .work-actions {
  1852. display: flex;
  1853. gap: 20rpx;
  1854. }
  1855. .work-edit {
  1856. font-size: 26rpx;
  1857. color: #1890ff;
  1858. }
  1859. .work-delete {
  1860. font-size: 26rpx;
  1861. color: #ff4d4f;
  1862. }
  1863. .work-content {
  1864. padding: 10rpx 0;
  1865. }
  1866. .work-row {
  1867. display: flex;
  1868. margin-bottom: 10rpx;
  1869. }
  1870. .work-label {
  1871. font-size: 26rpx;
  1872. color: #666;
  1873. width: 150rpx;
  1874. }
  1875. .work-value {
  1876. font-size: 26rpx;
  1877. color: #333;
  1878. flex: 1;
  1879. }
  1880. .work-form {
  1881. background-color: #fff;
  1882. border-radius: 8rpx;
  1883. padding: 20rpx;
  1884. margin-top: 20rpx;
  1885. }
  1886. /* 步骤指示器样式 */
  1887. .steps-indicator {
  1888. display: flex;
  1889. justify-content: space-between;
  1890. margin-bottom: 30rpx;
  1891. padding: 20rpx;
  1892. background-color: #fff;
  1893. border-radius: 10rpx;
  1894. overflow-x: auto;
  1895. }
  1896. .step-item {
  1897. display: flex;
  1898. flex-direction: column;
  1899. align-items: center;
  1900. position: relative;
  1901. min-width: 120rpx;
  1902. }
  1903. .step-item:not(:last-child)::after {
  1904. content: '';
  1905. position: absolute;
  1906. top: 20rpx;
  1907. right: -50%;
  1908. width: 100%;
  1909. height: 2rpx;
  1910. background-color: #ddd;
  1911. z-index: 1;
  1912. }
  1913. .step-item.active:not(:last-child)::after {
  1914. background-color: #0039b3;
  1915. }
  1916. .step-number {
  1917. width: 40rpx;
  1918. height: 40rpx;
  1919. border-radius: 50%;
  1920. background-color: #ddd;
  1921. color: #fff;
  1922. display: flex;
  1923. justify-content: center;
  1924. align-items: center;
  1925. font-size: 24rpx;
  1926. margin-bottom: 10rpx;
  1927. position: relative;
  1928. z-index: 2;
  1929. }
  1930. .step-item.active .step-number {
  1931. background-color: #0039b3;
  1932. }
  1933. .step-item.current .step-number {
  1934. background-color: #0039b3;
  1935. box-shadow: 0 0 0 4rpx rgba(0, 122, 255, 0.2);
  1936. }
  1937. .step-name {
  1938. font-size: 22rpx;
  1939. color: #999;
  1940. text-align: center;
  1941. }
  1942. .step-item.active .step-name {
  1943. color: #333;
  1944. }
  1945. .step-item.current .step-name {
  1946. color: #0039b3;
  1947. font-weight: bold;
  1948. }
  1949. /* 导航按钮样式 */
  1950. .nav-buttons {
  1951. display: flex;
  1952. justify-content: space-between;
  1953. margin-top: 40rpx;
  1954. padding: 0 20rpx;
  1955. }
  1956. .nav-btn {
  1957. flex: 1;
  1958. margin: 0 10rpx;
  1959. height: 80rpx;
  1960. line-height: 80rpx;
  1961. text-align: center;
  1962. border-radius: 40rpx;
  1963. font-size: 28rpx;
  1964. }
  1965. .prev-btn {
  1966. background-color: #f0f0f0;
  1967. color: #666;
  1968. }
  1969. .next-btn {
  1970. background-color: #0039b3;
  1971. color: #fff;
  1972. }
  1973. .submit-btn {
  1974. flex: 1;
  1975. margin: 0 10rpx;
  1976. height: 80rpx;
  1977. line-height: 80rpx;
  1978. text-align: center;
  1979. border-radius: 40rpx;
  1980. font-size: 28rpx;
  1981. background-color: #0039b3;
  1982. color: #fff;
  1983. }
  1984. /* 确认提交页样式 */
  1985. .confirm-container {
  1986. background-color: #fff;
  1987. border-radius: 10rpx;
  1988. padding: 20rpx;
  1989. margin-bottom: 30rpx;
  1990. }
  1991. .confirm-message {
  1992. padding: 20rpx;
  1993. background-color: #f6f6f6;
  1994. border-radius: 8rpx;
  1995. margin-bottom: 20rpx;
  1996. }
  1997. .info-summary {
  1998. padding: 20rpx;
  1999. }
  2000. .summary-item {
  2001. display: flex;
  2002. margin-bottom: 15rpx;
  2003. }
  2004. .summary-label {
  2005. width: 150rpx;
  2006. font-size: 28rpx;
  2007. color: #666;
  2008. }
  2009. .summary-value {
  2010. flex: 1;
  2011. font-size: 28rpx;
  2012. color: #333;
  2013. }
  2014. .input-error {
  2015. border-bottom: 1px solid #ff4d4f !important;
  2016. }
  2017. .error-message {
  2018. color: #ff4d4f;
  2019. font-size: 24rpx;
  2020. margin-top: 6rpx;
  2021. display: block;
  2022. }
  2023. /* 添加承诺书弹框样式 */
  2024. .promise-modal {
  2025. position: fixed;
  2026. top: 0;
  2027. left: 0;
  2028. right: 0;
  2029. bottom: 0;
  2030. background-color: rgba(0, 0, 0, 0.5);
  2031. z-index: 999;
  2032. display: flex;
  2033. justify-content: center;
  2034. align-items: center;
  2035. }
  2036. .promise-content {
  2037. width: 80%;
  2038. max-width: 600rpx;
  2039. background-color: #fff;
  2040. border-radius: 12rpx;
  2041. padding: 30rpx;
  2042. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
  2043. }
  2044. .promise-title {
  2045. font-size: 34rpx;
  2046. font-weight: bold;
  2047. text-align: center;
  2048. margin-bottom: 20rpx;
  2049. color: #333;
  2050. }
  2051. .promise-text {
  2052. height: 600rpx;
  2053. margin-bottom: 20rpx;
  2054. /* padding: 20rpx; */
  2055. background-color: #f8f8f8;
  2056. border-radius: 8rpx;
  2057. font-size: 28rpx;
  2058. line-height: 1.6;
  2059. color: #333;
  2060. }
  2061. .promise-checkbox {
  2062. display: flex;
  2063. align-items: center;
  2064. margin-bottom: 30rpx;
  2065. padding: 0 10rpx;
  2066. }
  2067. .promise-checkbox text {
  2068. font-size: 28rpx;
  2069. margin-left: 10rpx;
  2070. color: #333;
  2071. }
  2072. .promise-buttons {
  2073. display: flex;
  2074. justify-content: center;
  2075. }
  2076. .promise-btn {
  2077. width: 200rpx;
  2078. height: 80rpx;
  2079. line-height: 80rpx;
  2080. text-align: center;
  2081. border-radius: 40rpx;
  2082. font-size: 28rpx;
  2083. }
  2084. .confirm-btn {
  2085. background-color: #0039b3;
  2086. color: #fff;
  2087. }
  2088. .confirm-btn[disabled] {
  2089. background-color: #cccccc;
  2090. color: #ffffff;
  2091. }
  2092. /* Loading indicator styles */
  2093. .loading-container {
  2094. position: fixed;
  2095. top: 0;
  2096. left: 0;
  2097. right: 0;
  2098. bottom: 0;
  2099. background-color: rgba(255, 255, 255, 0.8);
  2100. display: flex;
  2101. flex-direction: column;
  2102. justify-content: center;
  2103. align-items: center;
  2104. z-index: 1000;
  2105. }
  2106. .loading-spinner {
  2107. width: 60rpx;
  2108. height: 60rpx;
  2109. border: 6rpx solid #f3f3f3;
  2110. border-top: 6rpx solid #0039b3;
  2111. border-radius: 50%;
  2112. animation: spin 1s linear infinite;
  2113. margin-bottom: 20rpx;
  2114. }
  2115. .loading-text {
  2116. font-size: 28rpx;
  2117. color: #666;
  2118. }
  2119. @keyframes spin {
  2120. 0% { transform: rotate(0deg); }
  2121. 100% { transform: rotate(360deg); }
  2122. }
  2123. /* 添加开关样式 */
  2124. .form-item switch {
  2125. margin-top: 10rpx;
  2126. }
  2127. </style>