educationExperience.vue 11 KB

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