index.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. console.log("ghj",data)
  92. if (!data.data.userResume) {
  93. wx.navigateTo({
  94. url: '../user-info/index',
  95. })
  96. }
  97. let {
  98. userResume
  99. } = data.data
  100. var eduName = this.data.eduList[userResume.highestQualification];
  101. var hpUserResumeId = userResume.hpUserResumeId;
  102. var expList = userResume.hpResumeWorkExperienceList;
  103. wx.setStorageSync("expList", expList);
  104. if (!userResume.headImg) {
  105. userResume.headImg = `${imgServerUrl}/images/avatar/man.png`;
  106. }
  107. if (userResume.expectationSalary) {
  108. var salaryList = this.data.salaryList;
  109. for (var i = 0; i < salaryList.length; i++) {
  110. if (salaryList[i].expectationSalary == userResume.expectationSalary) {
  111. userResume.expectationSalary = salaryList[i].hightNum
  112. }
  113. }
  114. }
  115. this.setData({
  116. userResume,
  117. eduName: eduName,
  118. expList: expList
  119. })
  120. wx.setStorageSync('userResume', userResume)
  121. })
  122. },
  123. // 修改基本信息
  124. toUserInfo() {
  125. wx.navigateTo({
  126. url: '../user-info/user-info?hpUserResumeId=' + this.data.hpUserResumeId,
  127. })
  128. },
  129. // 修改求职意向
  130. toUserJob(e) {
  131. wx.navigateTo({
  132. url: '../user-job/index?hpUserResumeId=' + this.data.hpUserResumeId,
  133. })
  134. },
  135. // 修改工作经验
  136. toUserWorks(e) {
  137. let {
  138. type,
  139. index
  140. } = e.currentTarget.dataset
  141. if (type == "edit") {
  142. wx.navigateTo({
  143. url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
  144. })
  145. } else {
  146. wx.navigateTo({
  147. url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId
  148. })
  149. }
  150. },
  151. //修改教育背景
  152. toUserEdu(e) {
  153. let {
  154. type,
  155. index
  156. } = e.currentTarget.dataset
  157. if (type == "edit") {
  158. wx.navigateTo({
  159. url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
  160. })
  161. } else {
  162. wx.navigateTo({
  163. url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId,
  164. })
  165. }
  166. }
  167. })