educationExperience.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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. </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. 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. }
  234. .custom-navbar {
  235. position: fixed;
  236. top: 0;
  237. left: 0;
  238. right: 0;
  239. padding-top: 80rpx;
  240. background-color: #ffffff;
  241. z-index: 9999;
  242. .navbar-content {
  243. display: flex;
  244. align-items: center;
  245. justify-content: space-between;
  246. height: 100%;
  247. padding: 0 40rpx;
  248. .nav-left, .nav-right {
  249. width: 60rpx;
  250. height: 60rpx;
  251. display: flex;
  252. align-items: center;
  253. justify-content: center;
  254. }
  255. .nav-title {
  256. color: rgba(51, 51, 51, 1);
  257. font-family: DM Sans;
  258. font-size: 36rpx;
  259. font-weight: 700;
  260. line-height: 26px;
  261. letter-spacing: 0px;
  262. text-align: center;
  263. }
  264. }
  265. }
  266. .main-content {
  267. margin-top: 88rpx;
  268. padding: 80rpx 20rpx 40rpx 20rpx;
  269. }
  270. .form-section {
  271. background: #fff;
  272. border-radius: 16rpx;
  273. padding: 0rpx 10rpx;
  274. .section-title {
  275. color: rgba(23, 23, 37, 1);
  276. font-family: Inter;
  277. font-size: 32rpx;
  278. font-weight: 600;
  279. line-height: 48rpx;
  280. letter-spacing: 0%;
  281. text-align: left;
  282. padding: 16rpx 0 32rpx 0;
  283. }
  284. }
  285. .form-item {
  286. margin-bottom: 30rpx;
  287. .form-label {
  288. color: rgba(31, 44, 55, 1);
  289. font-family: DM Sans;
  290. font-size: 16px;
  291. font-weight: 500;
  292. line-height: 22px;
  293. letter-spacing: 0%;
  294. text-align: left;
  295. margin-bottom: 20rpx;
  296. .required-mark {
  297. color: #FF3B30;
  298. font-size: 18px;
  299. font-weight: 500;
  300. margin-right: 4rpx;
  301. }
  302. .label-text {
  303. color: rgba(31, 44, 55, 1);
  304. font-family: DM Sans;
  305. font-size: 16px;
  306. font-weight: 500;
  307. line-height: 22px;
  308. letter-spacing: 0%;
  309. text-align: left;
  310. }
  311. }
  312. .form-input {
  313. width: 100%;
  314. min-height: 80rpx;
  315. padding: 0 40rpx;
  316. border: 1px solid rgba(227, 231, 236, 1);
  317. border-radius: 24px;
  318. background: rgba(255, 255, 255, 1);
  319. display: flex;
  320. align-items: center;
  321. justify-content: space-between;
  322. .placeholder {
  323. color: #999999;
  324. }
  325. picker{
  326. width: 100%;
  327. }
  328. textarea{
  329. width: 100%;
  330. padding: 20rpx 0;
  331. height: fit-content;
  332. min-height: 40rpx;
  333. }
  334. }
  335. }
  336. .skills-input-container {
  337. width: 100%;
  338. min-height: 80rpx;
  339. padding: 0rpx 40rpx;
  340. border: 1px solid rgba(227, 231, 236, 1);
  341. border-radius: 32px;
  342. background: rgba(255, 255, 255, 1);
  343. display: flex;
  344. align-items: center;
  345. justify-content: space-between;
  346. .skills-tags {
  347. display: flex;
  348. flex-wrap: wrap;
  349. gap: 12rpx;
  350. flex: 1;
  351. .skill-tag {
  352. padding: 8rpx 16rpx;
  353. background: #F5F5F5;
  354. border-radius: 8rpx;
  355. display: flex;
  356. align-items: center;
  357. gap: 8rpx;
  358. text {
  359. font-size: 24rpx;
  360. color: #666666;
  361. }
  362. }
  363. }
  364. .add-skill-btn {
  365. width: 40rpx;
  366. height: 40rpx;
  367. border: 1rpx solid rgba(102, 102, 102, 1);
  368. border-radius: 8rpx;
  369. display: flex;
  370. align-items: center;
  371. justify-content: center;
  372. background: #fff;
  373. flex-shrink: 0;
  374. }
  375. }
  376. .add-resume-btn {
  377. width: 100%;
  378. height: 80rpx;
  379. border: 1rpx solid #007AFF;
  380. border-radius: 60rpx;
  381. display: flex;
  382. align-items: center;
  383. justify-content: center;
  384. margin-top: 20rpx;
  385. text {
  386. color: #007AFF;
  387. font-size: 28rpx;
  388. font-weight: 500;
  389. }
  390. }
  391. .bottom-btn-container {
  392. position: fixed;
  393. bottom: 0;
  394. left: 0;
  395. right: 0;
  396. padding: 30rpx 20rpx;
  397. background: #fff;
  398. border-top: 1px solid #f0f0f0;
  399. z-index: 98;
  400. }
  401. .save-btn {
  402. width: 100%;
  403. height: 88rpx;
  404. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  405. border-radius: 44rpx;
  406. display: flex;
  407. align-items: center;
  408. justify-content: center;
  409. text {
  410. font-size: 32rpx;
  411. font-weight: 600;
  412. color: #fff;
  413. }
  414. }
  415. .add-skill-popup {
  416. background: #fff;
  417. border-radius: 24rpx;
  418. padding: 40rpx;
  419. .popup-title {
  420. color: rgba(34, 37, 42, 1);
  421. font-size: 36rpx;
  422. font-weight: 500;
  423. text-align: center;
  424. margin-bottom: 30rpx;
  425. }
  426. .popup-content {
  427. margin-bottom: 30rpx;
  428. .skill-input {
  429. width: 100%;
  430. height: 80rpx;
  431. padding: 0 20rpx;
  432. border: 1rpx solid #E5E5EA;
  433. border-radius: 12rpx;
  434. font-size: 28rpx;
  435. color: rgba(34, 37, 42, 1);
  436. background: #F7F8FA;
  437. }
  438. }
  439. .popup-buttons {
  440. display: flex;
  441. gap: 20rpx;
  442. .popup-btn {
  443. flex: 1;
  444. height: 80rpx;
  445. border-radius: 12rpx;
  446. display: flex;
  447. align-items: center;
  448. justify-content: center;
  449. font-size: 28rpx;
  450. font-weight: 500;
  451. }
  452. .cancel-btn {
  453. background: #F7F8FA;
  454. color: rgba(102, 102, 102, 1);
  455. }
  456. .confirm-btn {
  457. background: #007AFF;
  458. color: #fff;
  459. }
  460. }
  461. }
  462. .checkbox-container {
  463. display: flex;
  464. flex-wrap: nowrap;
  465. gap: 10rpx;
  466. /deep/ .u-checkbox-group {
  467. display: flex;
  468. flex-wrap: nowrap;
  469. width: 100%;
  470. }
  471. /deep/ .u-checkbox {
  472. flex: 1;
  473. min-width: 0;
  474. margin-right: 0;
  475. }
  476. /deep/ .u-checkbox__label {
  477. color: var(--Grayscale/Grayscale 100, rgba(23, 23, 37, 1));
  478. font-family: DM Sans;
  479. font-size: 24rpx;
  480. font-weight: 400;
  481. line-height: 48rpx;
  482. letter-spacing: 0%;
  483. text-align: left;
  484. }
  485. }
  486. </style>