workExperience.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  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. <!-- 公司业务类型 -->
  27. <view class="form-item">
  28. <view class="form-label" style="margin-bottom: 20rpx;">
  29. <text class="required-mark">*</text>
  30. <text class="label-text">公司业务类型</text>
  31. </view>
  32. <view class="checkbox-container">
  33. <u-checkbox-group
  34. @change="checkboxGroupChange"
  35. :wrap="false"
  36. shape="square"
  37. active-color="#007AFF"
  38. >
  39. <u-checkbox
  40. v-for="(option, index) in businessTypeOptions"
  41. :key="index"
  42. :name="option.value"
  43. v-model="option.checked"
  44. class="checkbox-item"
  45. >
  46. {{ option.label }}
  47. </u-checkbox>
  48. </u-checkbox-group>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 岗位履历 -->
  53. <view class="form-section" v-for="(resume, index) in formData.resumes" :key="index">
  54. <view class="section-title" v-if="hasCrossBorderExperience" >岗位履历 ({{ index + 1 }})</view>
  55. <!-- 任职时间 -->
  56. <view class="form-item">
  57. <view class="form-label">
  58. <text class="required-mark">*</text>
  59. <text class="label-text">{{ hasCrossBorderExperience ? '任职时间' : '在职时间' }}</text>
  60. </view>
  61. <view class="form-input" @click="selectEmploymentTime(index)">
  62. <text v-if="resume.employmentTime">{{ resume.employmentTime }}</text>
  63. <text v-else class="placeholder">{{ hasCrossBorderExperience ? '选择任职时间&离职时间' : '选择在职时间&离职时间' }}</text>
  64. <u-icon name="calendar" color="#999" size="60"></u-icon>
  65. </view>
  66. </view>
  67. <!-- 所在部门 -->
  68. <view class="form-item">
  69. <view class="form-label">
  70. <text class="required-mark">*</text>
  71. <text class="label-text">所在部门</text>
  72. </view>
  73. <view class="form-input" @click="selectDepartment(index)">
  74. <text v-if="resume.department">{{ resume.department }}</text>
  75. <text v-else class="placeholder">请选择部门</text>
  76. <u-icon name="arrow-down" color="#999" size="42"></u-icon>
  77. </view>
  78. </view>
  79. <!-- 岗位 -->
  80. <view class="form-item">
  81. <view class="form-label">
  82. <text class="required-mark">*</text>
  83. <text class="label-text">岗位</text>
  84. </view>
  85. <view class="form-input" @click="selectPosition(index)">
  86. <text v-if="resume.position">{{ resume.position }}</text>
  87. <text v-else class="placeholder">请选择岗位</text>
  88. <u-icon name="arrow-down" color="#999" size="42"></u-icon>
  89. </view>
  90. </view>
  91. <!-- 岗位职级 -->
  92. <view class="form-item">
  93. <view class="form-label">岗位职级</view>
  94. <view class="form-input" @click="selectPositionLevel(index)">
  95. <text v-if="resume.positionLevel">{{ resume.positionLevel }}</text>
  96. <text v-else class="placeholder">请选择职级</text>
  97. <u-icon name="arrow-down" color="#999" size="42"></u-icon>
  98. </view>
  99. </view>
  100. <!-- 岗位职业技能 -->
  101. <view class="form-item">
  102. <view class="form-label">
  103. <text class="required-mark">*</text>
  104. <text class="label-text">岗位职业技能</text>
  105. </view>
  106. <view class="skills-input-container">
  107. <view class="skills-tags">
  108. <view
  109. v-for="(skill, skillIndex) in resume.skills"
  110. :key="skillIndex"
  111. class="skill-tag"
  112. >
  113. <text>{{ skill }}</text>
  114. <u-icon name="close" color="#999" size="16" @click="removeSkill(index, skillIndex)"></u-icon>
  115. </view>
  116. </view>
  117. <view class="add-skill-btn" @click="addSkill(index)">
  118. <u-icon name="plus" color="rgba(102, 102, 102, 1)" size="28"></u-icon>
  119. </view>
  120. </view>
  121. </view>
  122. <!-- 工作内容 -->
  123. <view class="form-item">
  124. <view class="form-label">工作内容</view>
  125. <view class="form-input" @click="selectWorkContent(index)">
  126. <text v-if="resume.workContent">{{ resume.workContent }}</text>
  127. <text v-else class="placeholder">选填,请输入</text>
  128. <u-icon name="arrow-down" color="#999" size="42"></u-icon>
  129. </view>
  130. </view>
  131. <!-- 工作业绩 -->
  132. <view class="form-item">
  133. <view class="form-label">工作业绩</view>
  134. <view class="form-input" @click="selectWorkPerformance(index)">
  135. <text v-if="resume.workPerformance">{{ resume.workPerformance }}</text>
  136. <text v-else class="placeholder">选填,请输入</text>
  137. <u-icon name="arrow-down" color="#999" size="42"></u-icon>
  138. </view>
  139. </view>
  140. <!-- 添加岗位履历按钮 -->
  141. <view class="add-resume-btn" @click="addResume" v-if="index === formData.resumes.length - 1 && hasCrossBorderExperience">
  142. <text>添加岗位履历</text>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 底部保存按钮 -->
  147. <view class="bottom-btn-container">
  148. <view class="save-btn" @click="saveWorkExperience">
  149. <text>保存</text>
  150. </view>
  151. </view>
  152. <!-- 添加技能弹窗 -->
  153. <u-popup v-model="showAddSkill" mode="center" border-radius="24" width="80%">
  154. <view class="add-skill-popup">
  155. <view class="popup-title">添加技能</view>
  156. <view class="popup-content">
  157. <input
  158. v-model="newSkillName"
  159. placeholder="请输入技能名称"
  160. class="skill-input"
  161. maxlength="10"
  162. />
  163. </view>
  164. <view class="popup-buttons">
  165. <view class="popup-btn cancel-btn" @click="cancelAddSkill">取消</view>
  166. <view class="popup-btn confirm-btn" @click="confirmAddSkill">确定</view>
  167. </view>
  168. </view>
  169. </u-popup>
  170. </view>
  171. </template>
  172. <script>
  173. export default {
  174. data() {
  175. return {
  176. showAddSkill: false,
  177. newSkillName: '',
  178. currentResumeIndex: 0,
  179. businessTypeOptions: [
  180. { label: '跨境电商', value: 'cross-border-ecommerce', checked: false },
  181. { label: '国内电商', value: 'domestic-ecommerce', checked: false },
  182. { label: '外贸', value: 'foreign-trade', checked: false },
  183. { label: '其他', value: 'other', checked: false }
  184. ],
  185. formData: {
  186. companyName: '',
  187. businessTypes: [],
  188. resumes: [{
  189. employmentTime: '',
  190. department: '运营部',
  191. position: '亚马逊运营',
  192. positionLevel: '资深',
  193. skills: ['铺货', '品牌精品', '精品精铺', '店铺运营'],
  194. workContent: '',
  195. workPerformance: ''
  196. }]
  197. }
  198. }
  199. },
  200. onLoad(options) {
  201. // 接收从在线简历页面传递的业务类型参数
  202. if (options.businessTypes) {
  203. try {
  204. const businessTypes = JSON.parse(decodeURIComponent(options.businessTypes))
  205. this.formData.businessTypes = businessTypes
  206. console.log('接收到的业务类型:', businessTypes)
  207. console.log('是否有跨境经验:', this.hasCrossBorderExperience)
  208. } catch (e) {
  209. console.error('解析业务类型参数失败:', e)
  210. }
  211. }
  212. },
  213. computed: {
  214. hasCrossBorderExperience() {
  215. return this.formData.businessTypes.includes('cross-border-ecommerce')
  216. }
  217. },
  218. methods: {
  219. goBack() {
  220. uni.navigateBack()
  221. },
  222. checkboxGroupChange(e) {
  223. console.log('选中的业务类型:', e)
  224. // 更新 formData.businessTypes 以保持数据同步
  225. this.formData.businessTypes = e
  226. },
  227. selectEmploymentTime(index) {
  228. // 选择任职时间
  229. uni.showToast({
  230. title: '选择任职时间',
  231. icon: 'none'
  232. })
  233. },
  234. selectDepartment(index) {
  235. // 选择部门
  236. uni.showToast({
  237. title: '选择部门',
  238. icon: 'none'
  239. })
  240. },
  241. selectPosition(index) {
  242. // 选择岗位
  243. uni.showToast({
  244. title: '选择岗位',
  245. icon: 'none'
  246. })
  247. },
  248. selectPositionLevel(index) {
  249. // 选择岗位职级
  250. uni.showToast({
  251. title: '选择岗位职级',
  252. icon: 'none'
  253. })
  254. },
  255. addSkill(index) {
  256. this.currentResumeIndex = index
  257. this.showAddSkill = true
  258. this.newSkillName = ''
  259. },
  260. removeSkill(resumeIndex, skillIndex) {
  261. this.formData.resumes[resumeIndex].skills.splice(skillIndex, 1)
  262. },
  263. cancelAddSkill() {
  264. this.showAddSkill = false
  265. this.newSkillName = ''
  266. },
  267. confirmAddSkill() {
  268. if (this.newSkillName.trim()) {
  269. this.formData.resumes[this.currentResumeIndex].skills.push(this.newSkillName.trim())
  270. this.showAddSkill = false
  271. this.newSkillName = ''
  272. } else {
  273. uni.showToast({
  274. title: '请输入技能名称',
  275. icon: 'none'
  276. })
  277. }
  278. },
  279. selectWorkContent(index) {
  280. // 选择工作内容
  281. uni.showToast({
  282. title: '选择工作内容',
  283. icon: 'none'
  284. })
  285. },
  286. selectWorkPerformance(index) {
  287. // 选择工作业绩
  288. uni.showToast({
  289. title: '选择工作业绩',
  290. icon: 'none'
  291. })
  292. },
  293. addResume() {
  294. this.formData.resumes.push({
  295. employmentTime: '',
  296. department: '',
  297. position: '',
  298. positionLevel: '',
  299. skills: [],
  300. workContent: '',
  301. workPerformance: ''
  302. })
  303. },
  304. saveWorkExperience() {
  305. uni.showToast({
  306. title: '保存成功',
  307. icon: 'success'
  308. })
  309. setTimeout(() => {
  310. uni.navigateBack()
  311. }, 1500)
  312. }
  313. }
  314. }
  315. </script>
  316. <style lang="scss" scoped>
  317. .work-experience {
  318. min-height: 100vh;
  319. padding-bottom: 120rpx;
  320. }
  321. .custom-navbar {
  322. position: fixed;
  323. top: 0;
  324. left: 0;
  325. right: 0;
  326. padding-top: 80rpx;
  327. background-color: #ffffff;
  328. z-index: 9999;
  329. .navbar-content {
  330. display: flex;
  331. align-items: center;
  332. justify-content: space-between;
  333. height: 100%;
  334. padding: 0 40rpx;
  335. .nav-left, .nav-right {
  336. width: 60rpx;
  337. height: 60rpx;
  338. display: flex;
  339. align-items: center;
  340. justify-content: center;
  341. }
  342. .nav-title {
  343. color: rgba(51, 51, 51, 1);
  344. font-family: DM Sans;
  345. font-size: 36rpx;
  346. font-weight: 700;
  347. line-height: 26px;
  348. letter-spacing: 0px;
  349. text-align: center;
  350. }
  351. }
  352. }
  353. .main-content {
  354. margin-top: 88rpx;
  355. padding: 80rpx 20rpx 40rpx 20rpx;
  356. }
  357. .form-section {
  358. background: #fff;
  359. border-radius: 16rpx;
  360. padding: 0rpx 10rpx;
  361. .section-title {
  362. color: rgba(23, 23, 37, 1);
  363. font-family: Inter;
  364. font-size: 20px;
  365. font-weight: 600;
  366. line-height: 24px;
  367. letter-spacing: 0%;
  368. text-align: left;
  369. }
  370. }
  371. .form-item {
  372. margin-bottom: 30rpx;
  373. .form-label {
  374. color: rgba(31, 44, 55, 1);
  375. font-family: DM Sans;
  376. font-size: 16px;
  377. font-weight: 500;
  378. line-height: 22px;
  379. letter-spacing: 0%;
  380. text-align: left;
  381. margin-bottom: 20rpx;
  382. .required-mark {
  383. color: #FF3B30;
  384. font-size: 18px;
  385. font-weight: 500;
  386. margin-right: 4rpx;
  387. }
  388. .label-text {
  389. color: rgba(31, 44, 55, 1);
  390. font-family: DM Sans;
  391. font-size: 16px;
  392. font-weight: 500;
  393. line-height: 22px;
  394. letter-spacing: 0%;
  395. text-align: left;
  396. }
  397. }
  398. .form-input {
  399. width: 100%;
  400. height: 80rpx;
  401. padding: 0 40rpx;
  402. border: 1px solid rgba(227, 231, 236, 1);
  403. border-radius: 24px;
  404. background: rgba(255, 255, 255, 1);
  405. display: flex;
  406. align-items: center;
  407. justify-content: space-between;
  408. .placeholder {
  409. color: #999999;
  410. }
  411. }
  412. }
  413. .form-section {
  414. margin-top: 40rpx;
  415. .section-title {
  416. color: rgba(23, 23, 37, 1);
  417. font-family: Inter;
  418. font-size: 24px;
  419. font-weight: 600;
  420. line-height: 24px;
  421. letter-spacing: 0%;
  422. text-align: left;
  423. margin-bottom: 40rpx;
  424. }
  425. }
  426. .skills-input-container {
  427. width: 100%;
  428. min-height: 80rpx;
  429. padding: 0rpx 40rpx;
  430. border: 1px solid rgba(227, 231, 236, 1);
  431. border-radius: 32px;
  432. background: rgba(255, 255, 255, 1);
  433. display: flex;
  434. align-items: center;
  435. justify-content: space-between;
  436. .skills-tags {
  437. display: flex;
  438. flex-wrap: wrap;
  439. gap: 12rpx;
  440. flex: 1;
  441. .skill-tag {
  442. padding: 8rpx 16rpx;
  443. background: #F5F5F5;
  444. border-radius: 8rpx;
  445. display: flex;
  446. align-items: center;
  447. gap: 8rpx;
  448. text {
  449. font-size: 24rpx;
  450. color: #666666;
  451. }
  452. }
  453. }
  454. .add-skill-btn {
  455. width: 40rpx;
  456. height: 40rpx;
  457. border: 1rpx solid rgba(102, 102, 102, 1);
  458. border-radius: 8rpx;
  459. display: flex;
  460. align-items: center;
  461. justify-content: center;
  462. background: #fff;
  463. flex-shrink: 0;
  464. }
  465. }
  466. .add-resume-btn {
  467. width: 100%;
  468. height: 80rpx;
  469. border: 1rpx solid #007AFF;
  470. border-radius: 60rpx;
  471. display: flex;
  472. align-items: center;
  473. justify-content: center;
  474. margin-top: 20rpx;
  475. text {
  476. color: #007AFF;
  477. font-size: 28rpx;
  478. font-weight: 500;
  479. }
  480. }
  481. .bottom-btn-container {
  482. position: fixed;
  483. bottom: 0;
  484. left: 0;
  485. right: 0;
  486. padding: 30rpx 20rpx;
  487. background: #fff;
  488. border-top: 1px solid #f0f0f0;
  489. z-index: 9999;
  490. }
  491. .save-btn {
  492. width: 100%;
  493. height: 88rpx;
  494. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  495. border-radius: 44rpx;
  496. display: flex;
  497. align-items: center;
  498. justify-content: center;
  499. text {
  500. font-size: 32rpx;
  501. font-weight: 600;
  502. color: #fff;
  503. }
  504. }
  505. .add-skill-popup {
  506. background: #fff;
  507. border-radius: 24rpx;
  508. padding: 40rpx;
  509. .popup-title {
  510. color: rgba(34, 37, 42, 1);
  511. font-size: 36rpx;
  512. font-weight: 500;
  513. text-align: center;
  514. margin-bottom: 30rpx;
  515. }
  516. .popup-content {
  517. margin-bottom: 30rpx;
  518. .skill-input {
  519. width: 100%;
  520. height: 80rpx;
  521. padding: 0 20rpx;
  522. border: 1rpx solid #E5E5EA;
  523. border-radius: 12rpx;
  524. font-size: 28rpx;
  525. color: rgba(34, 37, 42, 1);
  526. background: #F7F8FA;
  527. }
  528. }
  529. .popup-buttons {
  530. display: flex;
  531. gap: 20rpx;
  532. .popup-btn {
  533. flex: 1;
  534. height: 80rpx;
  535. border-radius: 12rpx;
  536. display: flex;
  537. align-items: center;
  538. justify-content: center;
  539. font-size: 28rpx;
  540. font-weight: 500;
  541. }
  542. .cancel-btn {
  543. background: #F7F8FA;
  544. color: rgba(102, 102, 102, 1);
  545. }
  546. .confirm-btn {
  547. background: #007AFF;
  548. color: #fff;
  549. }
  550. }
  551. }
  552. .checkbox-container {
  553. display: flex;
  554. flex-wrap: nowrap;
  555. gap: 10rpx;
  556. /deep/ .u-checkbox-group {
  557. display: flex;
  558. flex-wrap: nowrap;
  559. width: 100%;
  560. }
  561. /deep/ .u-checkbox {
  562. flex: 1;
  563. min-width: 0;
  564. margin-right: 0;
  565. }
  566. }
  567. </style>