educationExperience.vue 11 KB

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