educationExperience.vue 12 KB

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