index.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. import {
  2. getResume
  3. } from '../../services/index.js'
  4. import {
  5. imgServerUrl
  6. } from '../../config/config.js'
  7. import {
  8. showToast
  9. } from '../../utils/tips.js'
  10. import {
  11. formatTime
  12. } from '../../utils/util.js'
  13. const app = getApp();
  14. Page({
  15. data: {
  16. imgServerUrl: imgServerUrl,
  17. hpUserResumeId: '', //是否有简历
  18. eduList: ["请选择", "小学", "中学", "高中", "大专", "本科", "研究生", "博士", "博士后"],
  19. eduName: '', //学历
  20. expYear: "", //工作几年
  21. hpUserResumeId: '', //用户简历表id
  22. expectationPosition: ["普工", "客服", "销售", "服务员", "物流仓储", "司机", "才艺技能", "文员助理", "快递配送", "促销导购", "展会演出", "家教培训", "模特", "贸易采购", "厨师", "编辑", "线上推广", "设计", "技工", "保洁", "其它"],
  23. salaryList: [{
  24. "expectationSalary": -1,
  25. "hightNum": '不限'
  26. },
  27. {
  28. "expectationSalary": 0,
  29. "hightNum": '1000~2000'
  30. },
  31. {
  32. "expectationSalary": 1,
  33. "hightNum": '2001~3000'
  34. },
  35. {
  36. "expectationSalary": 2,
  37. "hightNum": '3001~4000'
  38. },
  39. {
  40. "expectationSalary": 3,
  41. "hightNum": '4001~5000'
  42. },
  43. {
  44. "expectationSalary": 4,
  45. "hightNum": '5001~6000'
  46. },
  47. {
  48. "expectationSalary": 5,
  49. "hightNum": '6001~7000'
  50. },
  51. {
  52. "expectationSalary": 6,
  53. "hightNum": '7001~8000'
  54. },
  55. {
  56. "expectationSalary": 7,
  57. "hightNum": '8001~9000'
  58. },
  59. {
  60. "expectationSalary": 8,
  61. "hightNum": '9001~10000'
  62. }, {
  63. "expectationSalary": 9,
  64. "hightNum": '10000以上'
  65. }
  66. ],
  67. },
  68. onLoad: function(options) {
  69. var hpUserResumeId = options.hpUserResumeId;
  70. this.setData({
  71. hpUserResumeId
  72. })
  73. if (!hpUserResumeId) {
  74. wx.navigateTo({
  75. url: '../user-info/index',
  76. })
  77. }
  78. },
  79. onShow: function(options) {
  80. this.fetchData();
  81. },
  82. //获取用户简历详情
  83. fetchData() {
  84. let paramsObj = {
  85. user_id: app.globalData.userId,
  86. user_token: app.globalData.userToken,
  87. member_id: app.globalData.memberId
  88. }
  89. Object.assign(paramsObj);
  90. getResume(paramsObj).then(data => {
  91. if (!data.data.userResume) {
  92. wx.navigateTo({
  93. url: '../user-info/index',
  94. })
  95. }
  96. let {
  97. userResume
  98. } = data.data
  99. var eduName = this.data.eduList[userResume.highestQualification];
  100. var hpUserResumeId = userResume.hpUserResumeId;
  101. var expList = userResume.hpResumeWorkExperienceList;
  102. wx.setStorageSync("expList", expList);
  103. if (!userResume.headImg) {
  104. userResume.headImg = `${imgServerUrl}/images/avatar/man.png`;
  105. }
  106. if (userResume.expectationSalary) {
  107. var salaryList = this.data.salaryList;
  108. for (var i = 0; i < salaryList.length; i++) {
  109. if (salaryList[i].expectationSalary == userResume.expectationSalary) {
  110. userResume.expectationSalary = salaryList[i].hightNum
  111. }
  112. }
  113. }
  114. var year = userResume.birthYear;
  115. if (year) {
  116. var date = new Date;
  117. var year1 = date.getFullYear();
  118. year = year1 - year + 1;
  119. }
  120. this.setData({
  121. userResume,
  122. eduName: eduName,
  123. expList: expList,
  124. year: year
  125. })
  126. wx.setStorageSync('userResume', userResume)
  127. })
  128. },
  129. // 修改基本信息
  130. toUserInfo() {
  131. wx.navigateTo({
  132. url: '../user-info/user-info?hpUserResumeId=' + this.data.hpUserResumeId,
  133. })
  134. },
  135. // 修改求职意向
  136. toUserJob(e) {
  137. wx.navigateTo({
  138. url: '../user-job/index?hpUserResumeId=' + this.data.hpUserResumeId,
  139. })
  140. },
  141. // 修改工作经验
  142. toUserWorks(e) {
  143. let {
  144. type,
  145. index
  146. } = e.detail;
  147. if (type == "edit") {
  148. wx.navigateTo({
  149. url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
  150. })
  151. } else {
  152. wx.navigateTo({
  153. url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId
  154. })
  155. }
  156. },
  157. //修改教育背景
  158. toUserEdu(e) {
  159. let {
  160. type,
  161. index
  162. } = e.currentTarget.dataset
  163. if (type == "edit") {
  164. wx.navigateTo({
  165. url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
  166. })
  167. } else {
  168. wx.navigateTo({
  169. url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId,
  170. })
  171. }
  172. }
  173. })