jianli.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // components/jianli/jianli.js
  2. import {
  3. imgServerUrl
  4. } from '../../config/config.js'
  5. Component({
  6. /**
  7. * 组件的属性列表
  8. */
  9. properties: {
  10. userResume: { // 简历
  11. type: Object,
  12. value: {},
  13. observer() {
  14. // 当简历有值传进来时 获取container元素高度 为水印提供总高度值
  15. setTimeout(() => {
  16. this.createSelectorQuery().select('.container').fields({
  17. dataset: true,
  18. size: true,
  19. scrollOffset: true,
  20. properties: ['scrollX', 'scrollY'],
  21. computedStyle: ['margin', 'backgroundColor'],
  22. context: true,
  23. }, (res) => {
  24. if (res) {
  25. this.setData({
  26. height: res.height
  27. })
  28. }
  29. }).exec()
  30. }, 200);
  31. }
  32. },
  33. expList: { // 经验列表
  34. type: Array,
  35. value: []
  36. },
  37. edit: { // 是否可以编辑
  38. type: Boolean,
  39. value: false
  40. }
  41. },
  42. /**
  43. * 组件的初始数据
  44. */
  45. data: {
  46. // oss路径
  47. imgServerUrl,
  48. // 水印总高度
  49. height: 0,
  50. // 学历列表
  51. eduList: ["请选择", "小学", "中学", "高中", "大专", "本科", "研究生", "博士", "博士后"],
  52. // 工种列表
  53. expectationPosition: ["普工", "客服", "销售", "服务员", "物流仓储", "司机", "才艺技能", "文员助理", "快递配送", "促销导购", "展会演出", "家教培训", "模特", "贸易采购", "厨师", "编辑", "线上推广", "设计", "技工", "保洁", "其它"],
  54. },
  55. /**
  56. * 组件的方法列表
  57. */
  58. methods: {
  59. // 编辑个人信息
  60. user() {
  61. this.triggerEvent('user')
  62. },
  63. // 编辑求职意向
  64. job() {
  65. this.triggerEvent('job')
  66. },
  67. // 编辑工作经历
  68. edit(e) {
  69. const { index } = e.detail;
  70. this.triggerEvent('edit', { type: 'edit', index })
  71. },
  72. // 添加工作经历
  73. addNew() {
  74. this.triggerEvent('creat', { type: 'new' })
  75. }
  76. }
  77. })