educationExperience.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <template>
  2. <view class="work-experience">
  3. <!-- 自定义导航栏 -->
  4. <view class="custom-navbar">
  5. <view class="navbar-content">
  6. <view class="nav-left" @click="goBack">
  7. <u-icon name="arrow-leftward" color="#333" size="42"></u-icon>
  8. </view>
  9. <view class="nav-title">教育经历</view>
  10. <view class="nav-right"></view>
  11. </view>
  12. </view>
  13. <!-- 主要内容 -->
  14. <view class="main-content">
  15. <!-- 公司信息 -->
  16. <view class="form-section">
  17. <!-- 公司名称 -->
  18. <view class="form-item">
  19. <view class="form-label">学校名称</view>
  20. <input
  21. v-model="formData.companyName"
  22. placeholder="请填写学校名称"
  23. class="form-input"
  24. />
  25. </view>
  26. </view>
  27. <!-- 岗位履历 -->
  28. <view class="form-section">
  29. <!-- 任职时间 -->
  30. <view class="form-item">
  31. <view class="form-label">
  32. <text class="required-mark">*</text>
  33. <text class="label-text">在校时间</text>
  34. </view>
  35. <view class="form-input">
  36. <uni-datetime-picker
  37. v-model="formData.employmentTime"
  38. type="daterange"
  39. rangeSeparator="至"
  40. :border="false"
  41. startPlaceholder="选择入校时间"
  42. endPlaceholder="选择离校时间"
  43. />
  44. <!-- <text v-if="resume.employmentTime">{{ resume.employmentTime }}</text> -->
  45. <!-- <text v-else class="placeholder">{{ hasCrossBorderExperience ? '选择任职时间&离职时间' : '选择在职时间&离职时间' }}</text> -->
  46. <image src="../../static/images/index/Iconly_Light_Calendar.svg" style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image>
  47. </view>
  48. </view>
  49. <!-- 所在部门 -->
  50. <view class="form-item">
  51. <view class="form-label">
  52. <text class="required-mark">*</text>
  53. <text class="label-text">学历</text>
  54. </view>
  55. <view class="form-input">
  56. <picker class="picker" mode="selector" :range="departments" @change="selectDepartment">
  57. <text>{{departments.length>0?departments[formData.departmentIndex]:'请选择学历'}}</text>
  58. </picker>
  59. <u-icon name="arrow-down" color="#999" size="36"></u-icon>
  60. </view>
  61. </view>
  62. <!-- 工作业绩 -->
  63. <view class="form-item">
  64. <view class="form-label">专业</view>
  65. <view class="form-input">
  66. <textarea auto-height v-model="formData.workPerformance" placeholder="选填,请输入"></textarea>
  67. </view>
  68. </view>
  69. <!-- 工作内容 -->
  70. <view class="form-item">
  71. <view class="form-label">经历内容</view>
  72. <view class="form-input">
  73. <textarea auto-height v-model="formData.workContent" placeholder="选填,请输入"></textarea>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- 底部保存按钮 -->
  79. <view class="bottom-btn-container">
  80. <view class="save-btn" @click="saveWorkExperience">
  81. <text>保存</text>
  82. </view>
  83. </view>
  84. <!-- 添加技能弹窗 -->
  85. <u-popup v-model="showAddSkill" mode="center" border-radius="24" width="80%">
  86. <view class="add-skill-popup">
  87. <view class="popup-title">添加技能</view>
  88. <view class="popup-content">
  89. <input
  90. v-model="newSkillName"
  91. placeholder="请输入技能名称"
  92. class="skill-input"
  93. maxlength="10"
  94. />
  95. </view>
  96. <view class="popup-buttons">
  97. <view class="popup-btn cancel-btn" @click="cancelAddSkill">取消</view>
  98. <view class="popup-btn confirm-btn" @click="confirmAddSkill">确定</view>
  99. </view>
  100. </view>
  101. </u-popup>
  102. </view>
  103. </template>
  104. <script>
  105. var id=''
  106. export default {
  107. data() {
  108. return {
  109. showAddSkill: false,
  110. newSkillName: '',
  111. currentResumeIndex: 0,
  112. formData: {
  113. companyName: '',
  114. employmentTime: [],
  115. departmentIndex: 0,
  116. workContent: '',
  117. workPerformance: ''
  118. },
  119. departments:[
  120. "初中",
  121. "高中",
  122. "中专",
  123. "大专",
  124. "本科",
  125. "硕士",
  126. "博士",
  127. "博士后"
  128. ],
  129. isWork:false
  130. }
  131. },
  132. onLoad(options) {
  133. // 接收从在线简历页面传递的业务类型参数
  134. id=options&&options.id?options.id:''
  135. if(id!=''&&id!=0)
  136. this.getData()
  137. // 监听技能设置更新
  138. },
  139. beforeDestroy() {
  140. },
  141. computed: {
  142. },
  143. methods: {
  144. goBack() {
  145. uni.navigateBack()
  146. },
  147. getData(){
  148. var that=this
  149. this.$Request.getT("/app/userFirst/selectEdu", {eduId:id}).then((res) => {
  150. if (res.code == 0) {
  151. res=res.data
  152. that.formData.companyName= res.school
  153. that.formData.employmentTime= [res.startTime,res.endTime]
  154. that.formData.departmentIndex= that.departments.indexOf(res.degree)<=0?0:that.departments.indexOf(res.degree)
  155. that.formData.workContent= res.profession
  156. that.formData.workPerformance= res.detail
  157. } else {
  158. uni.showToast({
  159. title: res.msg,
  160. icon: "none",
  161. });
  162. }
  163. });
  164. },
  165. selectDepartment(e){
  166. this.formData.departmentIndex=e.detail.value
  167. },
  168. formatter(type, value) {
  169. if (type === 'year') {
  170. return `${value}年`
  171. }
  172. if (type === 'month') {
  173. return `${value}月`
  174. }
  175. if (type === 'day') {
  176. return `${value}日`
  177. }
  178. return value
  179. },
  180. saveWorkExperience() {
  181. console.log(this.formData.resumes)
  182. if (!this.formData.companyName) {
  183. uni.showToast({ title: "请输入学校名称", icon: "none" });
  184. return;
  185. }
  186. if (this.formData.employmentTime.length<=0) {
  187. uni.showToast({ title: "请选择在校时间", icon: "none" });
  188. return;
  189. }
  190. let data={
  191. eduId:id,
  192. school:this.formData.companyName,
  193. profession:this.formData.workPerformance,
  194. startTime:this.formData.employmentTime.length<=0?'':this.formData.employmentTime[0],
  195. endTime:this.formData.employmentTime.length<=0?'':this.formData.employmentTime[1],
  196. degree:this.departments[this.formData.departmentIndex],
  197. detail:this.formData.workContent
  198. }
  199. if(this.isWork)
  200. return
  201. this.isWork=true
  202. uni.showLoading({ title: "提交中..." });
  203. this.$Request.postJson("/app/userFirst/addEdu", data).then((res) => {
  204. uni.hideLoading();
  205. this.isWork=false
  206. this.formData.companyName=''
  207. if (res.code == 0) {
  208. uni.showToast({ title: "保存成功", icon: "none" });
  209. // 实际开发中可以在这里添加跳转逻辑
  210. uni.$emit('updateResume')
  211. setTimeout(() => {
  212. uni.navigateBack()
  213. }, 1000);
  214. } else {
  215. uni.showToast({
  216. title: res.msg,
  217. icon: "none",
  218. });
  219. }
  220. });
  221. },
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. .work-experience {
  227. min-height: 100vh;
  228. padding-bottom: 120rpx;
  229. }
  230. .custom-navbar {
  231. position: fixed;
  232. top: 0;
  233. left: 0;
  234. right: 0;
  235. padding-top: 80rpx;
  236. background-color: #ffffff;
  237. z-index: 9999;
  238. .navbar-content {
  239. display: flex;
  240. align-items: center;
  241. justify-content: space-between;
  242. height: 100%;
  243. padding: 0 40rpx;
  244. .nav-left, .nav-right {
  245. width: 60rpx;
  246. height: 60rpx;
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. }
  251. .nav-title {
  252. color: rgba(51, 51, 51, 1);
  253. font-family: DM Sans;
  254. font-size: 36rpx;
  255. font-weight: 700;
  256. line-height: 26px;
  257. letter-spacing: 0px;
  258. text-align: center;
  259. }
  260. }
  261. }
  262. .main-content {
  263. margin-top: 88rpx;
  264. padding: 80rpx 20rpx 40rpx 20rpx;
  265. }
  266. .form-section {
  267. background: #fff;
  268. border-radius: 16rpx;
  269. padding: 0rpx 10rpx;
  270. .section-title {
  271. color: rgba(23, 23, 37, 1);
  272. font-family: Inter;
  273. font-size: 32rpx;
  274. font-weight: 600;
  275. line-height: 48rpx;
  276. letter-spacing: 0%;
  277. text-align: left;
  278. padding: 16rpx 0 32rpx 0;
  279. }
  280. }
  281. .form-item {
  282. margin-bottom: 30rpx;
  283. .form-label {
  284. color: rgba(31, 44, 55, 1);
  285. font-family: DM Sans;
  286. font-size: 16px;
  287. font-weight: 500;
  288. line-height: 22px;
  289. letter-spacing: 0%;
  290. text-align: left;
  291. margin-bottom: 20rpx;
  292. .required-mark {
  293. color: #FF3B30;
  294. font-size: 18px;
  295. font-weight: 500;
  296. margin-right: 4rpx;
  297. }
  298. .label-text {
  299. color: rgba(31, 44, 55, 1);
  300. font-family: DM Sans;
  301. font-size: 16px;
  302. font-weight: 500;
  303. line-height: 22px;
  304. letter-spacing: 0%;
  305. text-align: left;
  306. }
  307. }
  308. .form-input {
  309. width: 100%;
  310. min-height: 80rpx;
  311. padding: 0 40rpx;
  312. border: 1px solid rgba(227, 231, 236, 1);
  313. border-radius: 24px;
  314. background: rgba(255, 255, 255, 1);
  315. display: flex;
  316. align-items: center;
  317. justify-content: space-between;
  318. .placeholder {
  319. color: #999999;
  320. }
  321. picker{
  322. width: 100%;
  323. }
  324. textarea{
  325. width: 100%;
  326. padding: 20rpx 0;
  327. height: fit-content;
  328. min-height: 40rpx;
  329. }
  330. }
  331. }
  332. .skills-input-container {
  333. width: 100%;
  334. min-height: 80rpx;
  335. padding: 0rpx 40rpx;
  336. border: 1px solid rgba(227, 231, 236, 1);
  337. border-radius: 32px;
  338. background: rgba(255, 255, 255, 1);
  339. display: flex;
  340. align-items: center;
  341. justify-content: space-between;
  342. .skills-tags {
  343. display: flex;
  344. flex-wrap: wrap;
  345. gap: 12rpx;
  346. flex: 1;
  347. .skill-tag {
  348. padding: 8rpx 16rpx;
  349. background: #F5F5F5;
  350. border-radius: 8rpx;
  351. display: flex;
  352. align-items: center;
  353. gap: 8rpx;
  354. text {
  355. font-size: 24rpx;
  356. color: #666666;
  357. }
  358. }
  359. }
  360. .add-skill-btn {
  361. width: 40rpx;
  362. height: 40rpx;
  363. border: 1rpx solid rgba(102, 102, 102, 1);
  364. border-radius: 8rpx;
  365. display: flex;
  366. align-items: center;
  367. justify-content: center;
  368. background: #fff;
  369. flex-shrink: 0;
  370. }
  371. }
  372. .add-resume-btn {
  373. width: 100%;
  374. height: 80rpx;
  375. border: 1rpx solid #007AFF;
  376. border-radius: 60rpx;
  377. display: flex;
  378. align-items: center;
  379. justify-content: center;
  380. margin-top: 20rpx;
  381. text {
  382. color: #007AFF;
  383. font-size: 28rpx;
  384. font-weight: 500;
  385. }
  386. }
  387. .bottom-btn-container {
  388. position: fixed;
  389. bottom: 0;
  390. left: 0;
  391. right: 0;
  392. padding: 30rpx 20rpx;
  393. background: #fff;
  394. border-top: 1px solid #f0f0f0;
  395. z-index: 98;
  396. }
  397. .save-btn {
  398. width: 100%;
  399. height: 88rpx;
  400. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  401. border-radius: 44rpx;
  402. display: flex;
  403. align-items: center;
  404. justify-content: center;
  405. text {
  406. font-size: 32rpx;
  407. font-weight: 600;
  408. color: #fff;
  409. }
  410. }
  411. .add-skill-popup {
  412. background: #fff;
  413. border-radius: 24rpx;
  414. padding: 40rpx;
  415. .popup-title {
  416. color: rgba(34, 37, 42, 1);
  417. font-size: 36rpx;
  418. font-weight: 500;
  419. text-align: center;
  420. margin-bottom: 30rpx;
  421. }
  422. .popup-content {
  423. margin-bottom: 30rpx;
  424. .skill-input {
  425. width: 100%;
  426. height: 80rpx;
  427. padding: 0 20rpx;
  428. border: 1rpx solid #E5E5EA;
  429. border-radius: 12rpx;
  430. font-size: 28rpx;
  431. color: rgba(34, 37, 42, 1);
  432. background: #F7F8FA;
  433. }
  434. }
  435. .popup-buttons {
  436. display: flex;
  437. gap: 20rpx;
  438. .popup-btn {
  439. flex: 1;
  440. height: 80rpx;
  441. border-radius: 12rpx;
  442. display: flex;
  443. align-items: center;
  444. justify-content: center;
  445. font-size: 28rpx;
  446. font-weight: 500;
  447. }
  448. .cancel-btn {
  449. background: #F7F8FA;
  450. color: rgba(102, 102, 102, 1);
  451. }
  452. .confirm-btn {
  453. background: #007AFF;
  454. color: #fff;
  455. }
  456. }
  457. }
  458. .checkbox-container {
  459. display: flex;
  460. flex-wrap: nowrap;
  461. gap: 10rpx;
  462. /deep/ .u-checkbox-group {
  463. display: flex;
  464. flex-wrap: nowrap;
  465. width: 100%;
  466. }
  467. /deep/ .u-checkbox {
  468. flex: 1;
  469. min-width: 0;
  470. margin-right: 0;
  471. }
  472. /deep/ .u-checkbox__label {
  473. color: var(--Grayscale/Grayscale 100, rgba(23, 23, 37, 1));
  474. font-family: DM Sans;
  475. font-size: 24rpx;
  476. font-weight: 400;
  477. line-height: 48rpx;
  478. letter-spacing: 0%;
  479. text-align: left;
  480. }
  481. }
  482. </style>